This repository includes all the necessary files for the hands-on lab for DrCCTProf tutorial at CGO'22.
Try to implement a DrCCTProf client to count instruction instances* within unique calling contexts.
*
Instructions of the same PC (program counter) may appear in different call paths.
You just need to complete the function void InsCount(int32_t opaqueHandle) :
- Get the current context handle.
Tip: use API
context_handle_t drcctlib_get_context_handle(void *drcontex, int32_t opaqueHandle)
- Increment the instruction execution frequency with the current context handle Tip: use ctxt_hndl_exec_num_array to get and store the execution frequency of each context handle.
Use the following commands to get source code and build:
$ git clone --recurse https://github.com/Xuhpclab/drcctprof_tutorial.git
$ ./build.sh
Once you complete the implementation, run the following command to build your source code and run the tool to profile the test application:
$ ./run.sh
This will generate two output files: one is a text file and the other is a .drcctprof file. You can directly open the text file or open .drcctprof file in VSCode with EasyView installed.