Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
};