diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 25 |
2 files changed, 17 insertions, 10 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 3de397764cb3..ed9b5b6905fa 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1021,7 +1021,7 @@ static void event__process_sample(const event_t *self, | |||
1021 | return; | 1021 | return; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | if (self->header.misc & PERF_RECORD_MISC_EXACT) | 1024 | if (self->header.misc & PERF_RECORD_MISC_EXACT_IP) |
1025 | exact_samples++; | 1025 | exact_samples++; |
1026 | 1026 | ||
1027 | if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 || | 1027 | if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 || |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index bc8b7e614207..ae7f5917935c 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -654,10 +654,6 @@ parse_raw_event(const char **strp, struct perf_event_attr *attr) | |||
654 | return EVT_FAILED; | 654 | return EVT_FAILED; |
655 | n = hex2u64(str + 1, &config); | 655 | n = hex2u64(str + 1, &config); |
656 | if (n > 0) { | 656 | if (n > 0) { |
657 | if (str[n+1] == 'p') { | ||
658 | attr->precise = 1; | ||
659 | n++; | ||
660 | } | ||
661 | *strp = str + n + 1; | 657 | *strp = str + n + 1; |
662 | attr->type = PERF_TYPE_RAW; | 658 | attr->type = PERF_TYPE_RAW; |
663 | attr->config = config; | 659 | attr->config = config; |
@@ -692,19 +688,29 @@ static enum event_result | |||
692 | parse_event_modifier(const char **strp, struct perf_event_attr *attr) | 688 | parse_event_modifier(const char **strp, struct perf_event_attr *attr) |
693 | { | 689 | { |
694 | const char *str = *strp; | 690 | const char *str = *strp; |
695 | int eu = 1, ek = 1, eh = 1; | 691 | int exclude = 0; |
692 | int eu = 0, ek = 0, eh = 0, precise = 0; | ||
696 | 693 | ||
697 | if (*str++ != ':') | 694 | if (*str++ != ':') |
698 | return 0; | 695 | return 0; |
699 | while (*str) { | 696 | while (*str) { |
700 | if (*str == 'u') | 697 | if (*str == 'u') { |
698 | if (!exclude) | ||
699 | exclude = eu = ek = eh = 1; | ||
701 | eu = 0; | 700 | eu = 0; |
702 | else if (*str == 'k') | 701 | } else if (*str == 'k') { |
702 | if (!exclude) | ||
703 | exclude = eu = ek = eh = 1; | ||
703 | ek = 0; | 704 | ek = 0; |
704 | else if (*str == 'h') | 705 | } else if (*str == 'h') { |
706 | if (!exclude) | ||
707 | exclude = eu = ek = eh = 1; | ||
705 | eh = 0; | 708 | eh = 0; |
706 | else | 709 | } else if (*str == 'p') { |
710 | precise++; | ||
711 | } else | ||
707 | break; | 712 | break; |
713 | |||
708 | ++str; | 714 | ++str; |
709 | } | 715 | } |
710 | if (str >= *strp + 2) { | 716 | if (str >= *strp + 2) { |
@@ -712,6 +718,7 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr) | |||
712 | attr->exclude_user = eu; | 718 | attr->exclude_user = eu; |
713 | attr->exclude_kernel = ek; | 719 | attr->exclude_kernel = ek; |
714 | attr->exclude_hv = eh; | 720 | attr->exclude_hv = eh; |
721 | attr->precise_ip = precise; | ||
715 | return 1; | 722 | return 1; |
716 | } | 723 | } |
717 | return 0; | 724 | return 0; |