]> Git Repo - linux.git/commitdiff
perf, core: Introduce attrs to count in either host or guest mode
authorJoerg Roedel <[email protected]>
Wed, 5 Oct 2011 12:01:16 +0000 (14:01 +0200)
committerIngo Molnar <[email protected]>
Thu, 6 Oct 2011 11:00:28 +0000 (13:00 +0200)
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 <[email protected]>
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/linux/perf_event.h

index c816075c01ceb3772241e17729dabd244be62764..1e9ebe5e0091e7fa1b1fabb72f72af979f35104c 100644 (file)
@@ -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 */
This page took 0.052489 seconds and 4 git commands to generate.