Skip to content

Commit 47f2cc2

Browse files
authored
Merge pull request #18 from cesar-avalos3/update-nvbit
Update NVBit to v1.5
2 parents f480040 + 3d71d64 commit 47f2cc2

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

util/tracer_nvbit/install_nvbit.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ DATA_SUBDIR="/data_dirs/"
33
DATA_ROOT=$BASH_ROOT$DATA_SUBDIR
44

55
if [ ! -d $DATA_ROOT ]; then
6-
wget https://github.com/NVlabs/NVBit/releases/download/1.4/nvbit-Linux-x86_64-1.4.tar.bz2
7-
tar -xf nvbit-Linux-x86_64-1.4.tar.bz2 -C $BASH_ROOT
8-
rm nvbit-Linux-x86_64-1.4.tar.bz2
6+
wget https://github.com/NVlabs/NVBit/releases/download/1.5/nvbit-Linux-x86_64-1.5.tar.bz2
7+
tar -xf nvbit-Linux-x86_64-1.5.tar.bz2 -C $BASH_ROOT
8+
rm nvbit-Linux-x86_64-1.5.tar.bz2
99
fi
1010

1111

util/tracer_nvbit/tracer_tool/tracer_tool.cu

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
108108

109109
const std::vector<Instr *> &instrs = nvbit_get_instrs(ctx, f);
110110
if (verbose) {
111-
printf("Inspecting function %s at address 0x%lx\n",
112-
nvbit_get_func_name(ctx, f), nvbit_get_func_addr(f), true);
111+
printf("Inspecting function %s at address 0x%lx\n", nvbit_get_func_name(ctx, f), nvbit_get_func_addr(f), true);
113112
}
114113

115114
uint32_t cnt = 0;
@@ -137,7 +136,7 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
137136
nvbit_insert_call(instr, "instrument_inst", IPOINT_BEFORE);
138137

139138
/* pass predicate value */
140-
nvbit_add_call_arg_pred_val(instr);
139+
nvbit_add_call_arg_guard_pred_val(instr);
141140

142141
/* send opcode and pc */
143142
nvbit_add_call_arg_const_val32(instr, opcode_id);
@@ -153,10 +152,10 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
153152
/* find dst reg and handle the special case if the oprd[0] is mem (e.g.
154153
* store and RED)*/
155154
if (instr->getNumOperands() > 0 &&
156-
instr->getOperand(0)->type == Instr::operandType::REG)
155+
instr->getOperand(0)->type == InstrType::OperandType::REG)
157156
dst_oprd = instr->getOperand(0)->u.reg.num;
158157
else if (instr->getNumOperands() > 0 &&
159-
instr->getOperand(0)->type == Instr::operandType::MREF) {
158+
instr->getOperand(0)->type == InstrType::OperandType::MREF) {
160159
src_oprd[0] = instr->getOperand(0)->u.mref.ra_num;
161160
mem_oper_idx = 0;
162161
srcNum++;
@@ -165,16 +164,16 @@ void instrument_function_if_needed(CUcontext ctx, CUfunction func) {
165164
// find src regs and mem
166165
for (int i = 1; i < MAX_SRC; i++) {
167166
if (i < instr->getNumOperands()) {
168-
const Instr::operand_t *op = instr->getOperand(i);
169-
if (op->type == Instr::operandType::MREF) {
167+
const InstrType::operand_t *op = instr->getOperand(i);
168+
if (op->type == InstrType::OperandType::MREF) {
170169
// mem is found
171170
assert(srcNum < MAX_SRC);
172171
src_oprd[srcNum] = instr->getOperand(i)->u.mref.ra_num;
173172
srcNum++;
174173
// TO DO: handle LDGSTS with two mem refs
175174
assert(mem_oper_idx == -1); // ensure one memory operand per inst
176175
mem_oper_idx++;
177-
} else if (op->type == Instr::operandType::REG) {
176+
} else if (op->type == InstrType::OperandType::REG) {
178177
// reg is found
179178
assert(srcNum < MAX_SRC);
180179
src_oprd[srcNum] = instr->getOperand(i)->u.reg.num;

0 commit comments

Comments
 (0)