Skip to content

Commit

Permalink
perf, core: Introduce attrs to count in either host or guest mode
Browse files Browse the repository at this point in the history
The two new attributes exclude_guest and exclude_host can
bes used by user-space to tell the kernel to setup
performance counter to either only count while the CPU is in
guest or in host mode.

An additional check is also introduced to make sure
user-space does not try to exclude guest and host mode from
counting.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1317816084-18026-2-git-send-email-gleb@redhat.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Joerg Roedel authored and Ingo Molnar committed Oct 6, 2011
1 parent 7b4f86a commit a240f76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ struct perf_event_attr {
mmap_data : 1, /* non-exec mmap data */
sample_id_all : 1, /* sample_type all events */

__reserved_1 : 45;
exclude_host : 1, /* don't count in host */
exclude_guest : 1, /* don't count in guest */

__reserved_1 : 43;

union {
__u32 wakeup_events; /* wakeup every n events */
Expand Down

0 comments on commit a240f76

Please sign in to comment.