I want to use PAPI to develop a tool to monitor a benchmark's performance. The output should be per a ceratin number of seconds or per a certain number of instructions. The tool should call the benchmark to run in the command line. I have workout these but encounter a problem. If i use PAPI_read in the parent process to read the child process's performance counters before the child process terminate normally. I can get the values correctly. If i read the values before the child process terminate, i always get 0. How to solve this problem? anyone has some clues?
I also tried to kill the child process, then read the performance counters of it. I also get 0s. Any suggestions are welcome!