Hi,

Is there a way to export the name of the image which produced the most number of samples during a given interval without parsing the report produced by the opreport command? I wrote a program to extract the dominant thread information after forking the opreport process but it turned out to be a slow, inefficient process unsuitable for my purpose.
I was wondering if there is a simpler function in the oprofile library which I could use to achieve this directly.
If there is a simpler tool which can give me this information, like 'top' or 'ps' , but which comes with a convenient API, that will be acceptable as well.  I am reading the source code of ps and top, and they do not seem to have any straightforward library function which could be used by other applications to identify the most dominant thread during any given interval.
My main concern is the speed at which the dominant thread can be identified, the faster the better. The metric could also be CPU utilization percent to identify dominance.


Thanks,
-Dhruv