diff options
-rw-r--r-- | tools/perf/Documentation/perf-list.txt | 2 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt index 7a527f7e9da9..ddc22525228d 100644 --- a/tools/perf/Documentation/perf-list.txt +++ b/tools/perf/Documentation/perf-list.txt | |||
@@ -21,6 +21,8 @@ EVENT MODIFIERS | |||
21 | Events can optionally have a modifer by appending a colon and one or | 21 | Events can optionally have a modifer by appending a colon and one or |
22 | more modifiers. Modifiers allow the user to restrict when events are | 22 | more modifiers. Modifiers allow the user to restrict when events are |
23 | counted with 'u' for user-space, 'k' for kernel, 'h' for hypervisor. | 23 | counted with 'u' for user-space, 'k' for kernel, 'h' for hypervisor. |
24 | Additional modifiers are 'G' for guest counting (in KVM guests) and 'H' | ||
25 | for host counting (not in KVM guests). | ||
24 | 26 | ||
25 | The 'p' modifier can be used for specifying how precise the instruction | 27 | The 'p' modifier can be used for specifying how precise the instruction |
26 | address should be. The 'p' modifier is currently only implemented for | 28 | address should be. The 'p' modifier is currently only implemented for |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index dcf999c766b1..b029296d20d9 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -735,8 +735,8 @@ static int | |||
735 | parse_event_modifier(const char **strp, struct perf_event_attr *attr) | 735 | parse_event_modifier(const char **strp, struct perf_event_attr *attr) |
736 | { | 736 | { |
737 | const char *str = *strp; | 737 | const char *str = *strp; |
738 | int exclude = 0; | 738 | int exclude = 0, exclude_GH = 0; |
739 | int eu = 0, ek = 0, eh = 0, precise = 0; | 739 | int eu = 0, ek = 0, eh = 0, eH = 0, eG = 0, precise = 0; |
740 | 740 | ||
741 | if (!*str) | 741 | if (!*str) |
742 | return 0; | 742 | return 0; |
@@ -760,6 +760,14 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr) | |||
760 | if (!exclude) | 760 | if (!exclude) |
761 | exclude = eu = ek = eh = 1; | 761 | exclude = eu = ek = eh = 1; |
762 | eh = 0; | 762 | eh = 0; |
763 | } else if (*str == 'G') { | ||
764 | if (!exclude_GH) | ||
765 | exclude_GH = eG = eH = 1; | ||
766 | eG = 0; | ||
767 | } else if (*str == 'H') { | ||
768 | if (!exclude_GH) | ||
769 | exclude_GH = eG = eH = 1; | ||
770 | eH = 0; | ||
763 | } else if (*str == 'p') { | 771 | } else if (*str == 'p') { |
764 | precise++; | 772 | precise++; |
765 | } else | 773 | } else |
@@ -776,6 +784,8 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr) | |||
776 | attr->exclude_kernel = ek; | 784 | attr->exclude_kernel = ek; |
777 | attr->exclude_hv = eh; | 785 | attr->exclude_hv = eh; |
778 | attr->precise_ip = precise; | 786 | attr->precise_ip = precise; |
787 | attr->exclude_host = eH; | ||
788 | attr->exclude_guest = eG; | ||
779 | 789 | ||
780 | return 0; | 790 | return 0; |
781 | } | 791 | } |