diff options
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 6 | ||||
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 9 | ||||
-rw-r--r-- | tools/lib/traceevent/parse-filter.c | 15 | ||||
-rw-r--r-- | tools/perf/perf.h | 2 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 6 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 3 | ||||
-rw-r--r-- | tools/perf/util/python.c | 2 | ||||
-rw-r--r-- | tools/perf/util/setup.py | 1 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 6 |
9 files changed, 44 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 915b876edd1e..3373f84d1397 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -338,6 +338,9 @@ int x86_setup_perfctr(struct perf_event *event) | |||
338 | /* BTS is currently only allowed for user-mode. */ | 338 | /* BTS is currently only allowed for user-mode. */ |
339 | if (!attr->exclude_kernel) | 339 | if (!attr->exclude_kernel) |
340 | return -EOPNOTSUPP; | 340 | return -EOPNOTSUPP; |
341 | |||
342 | if (!attr->exclude_guest) | ||
343 | return -EOPNOTSUPP; | ||
341 | } | 344 | } |
342 | 345 | ||
343 | hwc->config |= config; | 346 | hwc->config |= config; |
@@ -380,6 +383,9 @@ int x86_pmu_hw_config(struct perf_event *event) | |||
380 | if (event->attr.precise_ip) { | 383 | if (event->attr.precise_ip) { |
381 | int precise = 0; | 384 | int precise = 0; |
382 | 385 | ||
386 | if (!event->attr.exclude_guest) | ||
387 | return -EOPNOTSUPP; | ||
388 | |||
383 | /* Support for constant skid */ | 389 | /* Support for constant skid */ |
384 | if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) { | 390 | if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) { |
385 | precise++; | 391 | precise++; |
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 47264b4652b9..f2989c525e48 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
@@ -2602,6 +2602,9 @@ find_func_handler(struct pevent *pevent, char *func_name) | |||
2602 | { | 2602 | { |
2603 | struct pevent_function_handler *func; | 2603 | struct pevent_function_handler *func; |
2604 | 2604 | ||
2605 | if (!pevent) | ||
2606 | return NULL; | ||
2607 | |||
2605 | for (func = pevent->func_handlers; func; func = func->next) { | 2608 | for (func = pevent->func_handlers; func; func = func->next) { |
2606 | if (strcmp(func->name, func_name) == 0) | 2609 | if (strcmp(func->name, func_name) == 0) |
2607 | break; | 2610 | break; |
@@ -4938,6 +4941,9 @@ enum pevent_errno __pevent_parse_format(struct event_format **eventp, | |||
4938 | goto event_alloc_failed; | 4941 | goto event_alloc_failed; |
4939 | } | 4942 | } |
4940 | 4943 | ||
4944 | /* Add pevent to event so that it can be referenced */ | ||
4945 | event->pevent = pevent; | ||
4946 | |||
4941 | ret = event_read_format(event); | 4947 | ret = event_read_format(event); |
4942 | if (ret < 0) { | 4948 | if (ret < 0) { |
4943 | ret = PEVENT_ERRNO__READ_FORMAT_FAILED; | 4949 | ret = PEVENT_ERRNO__READ_FORMAT_FAILED; |
@@ -5041,9 +5047,6 @@ enum pevent_errno pevent_parse_event(struct pevent *pevent, const char *buf, | |||
5041 | if (event == NULL) | 5047 | if (event == NULL) |
5042 | return ret; | 5048 | return ret; |
5043 | 5049 | ||
5044 | /* Add pevent to event so that it can be referenced */ | ||
5045 | event->pevent = pevent; | ||
5046 | |||
5047 | if (add_event(pevent, event)) { | 5050 | if (add_event(pevent, event)) { |
5048 | ret = PEVENT_ERRNO__MEM_ALLOC_FAILED; | 5051 | ret = PEVENT_ERRNO__MEM_ALLOC_FAILED; |
5049 | goto event_add_failed; | 5052 | goto event_add_failed; |
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index ad17855528f9..5ea4326ad11f 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c | |||
@@ -209,7 +209,16 @@ static void free_arg(struct filter_arg *arg) | |||
209 | switch (arg->type) { | 209 | switch (arg->type) { |
210 | case FILTER_ARG_NONE: | 210 | case FILTER_ARG_NONE: |
211 | case FILTER_ARG_BOOLEAN: | 211 | case FILTER_ARG_BOOLEAN: |
212 | break; | ||
213 | |||
212 | case FILTER_ARG_NUM: | 214 | case FILTER_ARG_NUM: |
215 | free_arg(arg->num.left); | ||
216 | free_arg(arg->num.right); | ||
217 | break; | ||
218 | |||
219 | case FILTER_ARG_EXP: | ||
220 | free_arg(arg->exp.left); | ||
221 | free_arg(arg->exp.right); | ||
213 | break; | 222 | break; |
214 | 223 | ||
215 | case FILTER_ARG_STR: | 224 | case FILTER_ARG_STR: |
@@ -218,6 +227,12 @@ static void free_arg(struct filter_arg *arg) | |||
218 | free(arg->str.buffer); | 227 | free(arg->str.buffer); |
219 | break; | 228 | break; |
220 | 229 | ||
230 | case FILTER_ARG_VALUE: | ||
231 | if (arg->value.type == FILTER_STRING || | ||
232 | arg->value.type == FILTER_CHAR) | ||
233 | free(arg->value.str); | ||
234 | break; | ||
235 | |||
221 | case FILTER_ARG_OP: | 236 | case FILTER_ARG_OP: |
222 | free_arg(arg->op.left); | 237 | free_arg(arg->op.left); |
223 | free_arg(arg->op.right); | 238 | free_arg(arg->op.right); |
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 276287783a03..c50985eaec41 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -57,7 +57,7 @@ void get_term_dimensions(struct winsize *ws); | |||
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #ifdef __sparc__ | 59 | #ifdef __sparc__ |
60 | #include "../../arch/sparc/include/asm/unistd.h" | 60 | #include "../../arch/sparc/include/uapi/asm/unistd.h" |
61 | #define rmb() asm volatile("":::"memory") | 61 | #define rmb() asm volatile("":::"memory") |
62 | #define cpu_relax() asm volatile("":::"memory") | 62 | #define cpu_relax() asm volatile("":::"memory") |
63 | #define CPUINFO_PROC "cpu" | 63 | #define CPUINFO_PROC "cpu" |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 0568536ecf67..ef2f93ca7496 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -610,6 +610,7 @@ static int hist_browser__show_entry(struct hist_browser *browser, | |||
610 | char folded_sign = ' '; | 610 | char folded_sign = ' '; |
611 | bool current_entry = ui_browser__is_current_entry(&browser->b, row); | 611 | bool current_entry = ui_browser__is_current_entry(&browser->b, row); |
612 | off_t row_offset = entry->row_offset; | 612 | off_t row_offset = entry->row_offset; |
613 | bool first = true; | ||
613 | 614 | ||
614 | if (current_entry) { | 615 | if (current_entry) { |
615 | browser->he_selection = entry; | 616 | browser->he_selection = entry; |
@@ -633,10 +634,11 @@ static int hist_browser__show_entry(struct hist_browser *browser, | |||
633 | if (!perf_hpp__format[i].cond) | 634 | if (!perf_hpp__format[i].cond) |
634 | continue; | 635 | continue; |
635 | 636 | ||
636 | if (i) { | 637 | if (!first) { |
637 | slsmg_printf(" "); | 638 | slsmg_printf(" "); |
638 | width -= 2; | 639 | width -= 2; |
639 | } | 640 | } |
641 | first = false; | ||
640 | 642 | ||
641 | if (perf_hpp__format[i].color) { | 643 | if (perf_hpp__format[i].color) { |
642 | hpp.ptr = &percent; | 644 | hpp.ptr = &percent; |
@@ -645,7 +647,7 @@ static int hist_browser__show_entry(struct hist_browser *browser, | |||
645 | 647 | ||
646 | ui_browser__set_percent_color(&browser->b, percent, current_entry); | 648 | ui_browser__set_percent_color(&browser->b, percent, current_entry); |
647 | 649 | ||
648 | if (i == 0 && symbol_conf.use_callchain) { | 650 | if (i == PERF_HPP__OVERHEAD && symbol_conf.use_callchain) { |
649 | slsmg_printf("%c ", folded_sign); | 651 | slsmg_printf("%c ", folded_sign); |
650 | width -= 2; | 652 | width -= 2; |
651 | } | 653 | } |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index aed38e4b9dfa..75c7b0fca6d9 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -690,6 +690,9 @@ static int get_event_modifier(struct event_modifier *mod, char *str, | |||
690 | eH = 0; | 690 | eH = 0; |
691 | } else if (*str == 'p') { | 691 | } else if (*str == 'p') { |
692 | precise++; | 692 | precise++; |
693 | /* use of precise requires exclude_guest */ | ||
694 | if (!exclude_GH) | ||
695 | eG = 1; | ||
693 | } else | 696 | } else |
694 | break; | 697 | break; |
695 | 698 | ||
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 9181bf212fb9..a2657fd96837 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -1015,6 +1015,8 @@ PyMODINIT_FUNC initperf(void) | |||
1015 | pyrf_cpu_map__setup_types() < 0) | 1015 | pyrf_cpu_map__setup_types() < 0) |
1016 | return; | 1016 | return; |
1017 | 1017 | ||
1018 | page_size = sysconf(_SC_PAGE_SIZE); | ||
1019 | |||
1018 | Py_INCREF(&pyrf_evlist__type); | 1020 | Py_INCREF(&pyrf_evlist__type); |
1019 | PyModule_AddObject(module, "evlist", (PyObject*)&pyrf_evlist__type); | 1021 | PyModule_AddObject(module, "evlist", (PyObject*)&pyrf_evlist__type); |
1020 | 1022 | ||
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index d0f9f29cf181..09c3cea95d3b 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py | |||
@@ -31,6 +31,7 @@ perf = Extension('perf', | |||
31 | sources = ext_sources, | 31 | sources = ext_sources, |
32 | include_dirs = ['util/include'], | 32 | include_dirs = ['util/include'], |
33 | extra_compile_args = cflags, | 33 | extra_compile_args = cflags, |
34 | extra_objects = [build_tmp + '/../../libtraceevent.a'], | ||
34 | ) | 35 | ) |
35 | 36 | ||
36 | setup(name='perf', | 37 | setup(name='perf', |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index b5b1b9211960..cfd1c0feb32d 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -260,6 +260,12 @@ static int hist_entry__srcline_snprintf(struct hist_entry *self, char *bf, | |||
260 | if (path != NULL) | 260 | if (path != NULL) |
261 | goto out_path; | 261 | goto out_path; |
262 | 262 | ||
263 | if (!self->ms.map) | ||
264 | goto out_ip; | ||
265 | |||
266 | if (!strncmp(self->ms.map->dso->long_name, "/tmp/perf-", 10)) | ||
267 | goto out_ip; | ||
268 | |||
263 | snprintf(cmd, sizeof(cmd), "addr2line -e %s %016" PRIx64, | 269 | snprintf(cmd, sizeof(cmd), "addr2line -e %s %016" PRIx64, |
264 | self->ms.map->dso->long_name, self->ip); | 270 | self->ms.map->dso->long_name, self->ip); |
265 | fp = popen(cmd, "r"); | 271 | fp = popen(cmd, "r"); |