Skip to content

Commit

Permalink
bugfix to track caller inst
Browse files Browse the repository at this point in the history
  • Loading branch information
yebinchon committed Apr 9, 2024
1 parent 8505f85 commit cd0064b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
24 changes: 18 additions & 6 deletions src/runtime/ProfilingModules/DependenceWithContextModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,28 @@ void DependenceWithContextModule::loop_exit() __attribute__((always_inline)) {
nested_level--;
}

void DependenceWithContextModule::func_entry(uint32_t instr) {
if (nested_level == 1) {
//void DependenceWithContextModule::func_entry(uint32_t instr) {
// if (nested_level == 1) {
// context = instr;
// }
//}
//
//void DependenceWithContextModule::func_exit(uint32_t instr) {
// if (nested_level == 1) {
// context = 0;
// }
//}

void DependenceWithContextModule::push(uint32_t instr) __attribute__((always_inline)) {
if(func_level == 0)
context = instr;
}
func_level++;
}

void DependenceWithContextModule::func_exit(uint32_t instr) {
if (nested_level == 1) {
void DependenceWithContextModule::pop() __attribute__((always_inline)) {
func_level--;
if(func_level == 0)
context = 0;
}
}

void DependenceWithContextModule::merge_dep(DependenceWithContextModule &other) {
Expand Down
8 changes: 6 additions & 2 deletions src/runtime/ProfilingModules/DependenceWithContextModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class DependenceWithContextModule : public LocalWriteModule {

unsigned int context = 0;
int nested_level = 0;
int func_level = 0;

#ifdef COLLECT_TRACE
// Collect trace
Expand Down Expand Up @@ -80,8 +81,11 @@ class DependenceWithContextModule : public LocalWriteModule {
void loop_invoc();
void loop_iter();
void loop_exit();
void func_entry(uint32_t context);
void func_exit(uint32_t context);
//void func_entry(uint32_t context);
//void func_exit(uint32_t context);
//FIXME: do we also need ext_push/pop?
void push(uint32_t instr);
void pop();

void merge_dep(DependenceWithContextModule &other);
};

0 comments on commit cd0064b

Please sign in to comment.