Skip to content

Conversation

@shumeit
Copy link

@shumeit shumeit commented May 16, 2018

During profiling, LLFI tries to inject endProfiling callback functions at the end of the main function.
In the original codes, LLFI obtains the last instruction in the last basic block and injects endProfiling before the last instruction. It's generally true in most cases but in some cases the return/unreachable instruction is not always in the last instruction in the last basic block.

In my case, the return instruction is in the BB that is before the last BB in the main function. Therefore, to handle this problem, we'll check if the instruction obtained is return or unreachable instruction. If it's not, then iterate through all the functions in main() to find the real return/unreachable instruction.

One issue occurred after the modification is not yet solved.
When we turn on the "tracingPropagation" option in input.yaml and run the instrumentation, there will be error regarding to the violation of SSA form in LLVM.

…s at the end of the main function.

In the original codes, LLFI obtains the last instruction in the last basic block and injects endProfiling before the last instruction.
It's generally true in most cases but in some cases the return/unreachable instruction is not always in the last instruction in the last basic block.
In my case, the return instruction is in the BB that is before the last BB in the main function.
Therefore, to handle this problem, we'll check if the instruction obtained is return or unreachable instruction.
If it's not, then iterate all the functions in main() to find the real return/unreachable instruction.

There are stll some problems about this modification. For example, when we turn on the "tracingPropagation" option in input.yaml and run the instrumentation, there will be error regarding to the violation of SSA form in LLVM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant