Re: [PATCH] Fix behavior and documentation for '--threshold' option
Steven Munroe <[email protected]>
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Organization | IBM Linux technology Center |
| Message-ID | <[email protected]> |
On Thu, 2014-08-28 at 13:06 -0500, Maynard Johnson wrote: > Fix behavior and documentation for '--threshold' option > > A user reported some issues with how the opreport and opannotate > '--threshold' option was working. He was using operf to collect > a profile using mulitiple events (PM_CMPLU_STALL_REJECT_LHS and > PM_MRK_ST_FWD). For a particular symbol in his profile data, he > had 0% for PM_CMPLU_STALL_REJECT_LHS and 12% for PM_MRK_ST_FWD. > But when he ran 'opannotate --assembly -t 1', he was surprised to > see that the function in question was not in the output at all, > even though the ratio of samples for the PM_CMPLU_STALL_REJECT_LHS > was well above the 1% threshold. > The events are stored in alphabetical order in a C++ set. When > applying the threshold level against a symbol, the code was only > looking at the ratio of samples for the first event in the set > (PM_CMPLU_STALL_REJECT_LHS, in this case). This is not the intended > behavior (IMHO), so this patch looks at all ratios for every event > and will only filter out the sample data for a given symbol if none > of the events meets the threshold. > > This issue applies to opreport as well, and the same fix works for > both opreport and 'opannotate --assembly'. > I tested the new code with operf and opannotate and verified the results. As requested I now see functions (symbols) from both events with a --threshold of 1 > On the other hand, 'opannotate --source' applies the threshold to > a given source file (contrary to the man page). The same problem > exists there, where annotation for a given source file was not displayed > if the ratio of samples for the first event in the set did not meet the > specified threshold. This patch fixes that problem as well. ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/