diff options
author | Matt Fleming <[email protected]> | 2015-01-23 18:45:41 +0000 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2015-02-25 13:53:29 +0100 |
commit | eacd3ecc34472ce3751eedfc94e44c7cc6eb6305 (patch) | |
tree | 6a250e7e1c4b58cebeefc9be767479991d75ac9e /tools/perf/scripts/python | |
parent | 39bed6cbb842d8edf5a26b01122b391d36775b5e (diff) |
perf: Add ->count() function to read per-package counters
For PMU drivers that record per-package counters, the ->count variable
cannot be used to record an accurate aggregated value, since it's not
possible to perform SMP cross-calls to cpus on other packages from the
context in which we update ->count.
Introduce a new optional ->count() accessor function that can be used to
customize how values are collected. If a PMU driver doesn't provide a
->count() function, we fallback to the existing code.
There is necessarily a window of staleness with this approach because
the task that generated the counter value may not have been scheduled by
the cpu recently.
An alternative and more complex approach would be to use a hrtimer to
periodically refresh the values from a more permissive scheduling
context. So, we're trading off complexity for accuracy.
Signed-off-by: Matt Fleming <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kanaka Juvva <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Vikas Shivappa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions