diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-03-19 03:05:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-03-19 03:05:47 -0400 |
commit | 538592ff0b008237ae88f5ce5fb1247127dc3ce5 (patch) | |
tree | e6d688f188c1ec0dde44af613f6ff69e8578051f /tools | |
parent | 0afd2d51029961281572d02545c7bde1b3f4292c (diff) | |
parent | a51e87cb5a0fbebee15a3373d951dbf6f59a76c2 (diff) |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo:
User visible:
* Fixup header alignment in 'perf sched latency' output (Ramkumar Ramachandra)
* Fix off-by-one error in 'perf timechart record' argv handling (Ramkumar Ramachandra)
* Print the evsel name in the annotate stdio output, prep to fix support
outputting annotation for multiple events, not just for the first one
(Arnaldo Carvalho de Melo)
Internals:
* Use tid in mmap/mmap2 events to find maps (Don Zickus)
* Record the reason for filtering an address_location (Namhyung Kim)
* Apply all filters to an addr_location (Namhyung Kim)
* Merge al->filtered with hist_entry->filtered in report/hists (Namhyung Kim)
* Fix memory leak when synthesizing thread records (Namhyung Kim)
* Use ui__has_annotation() in 'report' (Namhyung Kim)
Cleanups:
* Remove unused thread__find_map function (Jiri Olsa)
* Remove unused simple_strtoul() function (Ramkumar Ramachandra)
Documentation:
* Update function names in debug messages (Ramkumar Ramachandra)
* Update some code references in design.txt (Ramkumar Ramachandra)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-report.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-sched.c | 10 | ||||
-rw-r--r-- | tools/perf/builtin-timechart.c | 4 | ||||
-rw-r--r-- | tools/perf/design.txt | 12 | ||||
-rw-r--r-- | tools/perf/tests/hists_link.c | 1 | ||||
-rw-r--r-- | tools/perf/util/annotate.c | 14 | ||||
-rw-r--r-- | tools/perf/util/event.c | 34 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 4 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 9 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 9 | ||||
-rw-r--r-- | tools/perf/util/include/linux/kernel.h | 6 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 6 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 2 | ||||
-rw-r--r-- | tools/perf/util/thread.h | 6 |
14 files changed, 58 insertions, 63 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index c47bf586fcba..c8f21137dfd8 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -231,7 +231,7 @@ static int process_sample_event(struct perf_tool *tool, | |||
231 | return -1; | 231 | return -1; |
232 | } | 232 | } |
233 | 233 | ||
234 | if (al.filtered || (rep->hide_unresolved && al.sym == NULL)) | 234 | if (rep->hide_unresolved && al.sym == NULL) |
235 | return 0; | 235 | return 0; |
236 | 236 | ||
237 | if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) | 237 | if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) |
@@ -928,7 +928,7 @@ repeat: | |||
928 | * so don't allocate extra space that won't be used in the stdio | 928 | * so don't allocate extra space that won't be used in the stdio |
929 | * implementation. | 929 | * implementation. |
930 | */ | 930 | */ |
931 | if (use_browser == 1 && sort__has_sym) { | 931 | if (ui__has_annotation()) { |
932 | symbol_conf.priv_size = sizeof(struct annotation); | 932 | symbol_conf.priv_size = sizeof(struct annotation); |
933 | machines__set_symbol_filter(&session->machines, | 933 | machines__set_symbol_filter(&session->machines, |
934 | symbol__annotate_init); | 934 | symbol__annotate_init); |
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 6a76a07b6789..9ac0a495c954 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1124,7 +1124,7 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_ | |||
1124 | 1124 | ||
1125 | avg = work_list->total_lat / work_list->nb_atoms; | 1125 | avg = work_list->total_lat / work_list->nb_atoms; |
1126 | 1126 | ||
1127 | printf("|%11.3f ms |%9" PRIu64 " | avg:%9.3f ms | max:%9.3f ms | max at: %9.6f s\n", | 1127 | printf("|%11.3f ms |%9" PRIu64 " | avg:%9.3f ms | max:%9.3f ms | max at: %13.6f s\n", |
1128 | (double)work_list->total_runtime / 1e6, | 1128 | (double)work_list->total_runtime / 1e6, |
1129 | work_list->nb_atoms, (double)avg / 1e6, | 1129 | work_list->nb_atoms, (double)avg / 1e6, |
1130 | (double)work_list->max_lat / 1e6, | 1130 | (double)work_list->max_lat / 1e6, |
@@ -1527,9 +1527,9 @@ static int perf_sched__lat(struct perf_sched *sched) | |||
1527 | 1527 | ||
1528 | perf_sched__sort_lat(sched); | 1528 | perf_sched__sort_lat(sched); |
1529 | 1529 | ||
1530 | printf("\n ---------------------------------------------------------------------------------------------------------------\n"); | 1530 | printf("\n -----------------------------------------------------------------------------------------------------------------\n"); |
1531 | printf(" Task | Runtime ms | Switches | Average delay ms | Maximum delay ms | Maximum delay at |\n"); | 1531 | printf(" Task | Runtime ms | Switches | Average delay ms | Maximum delay ms | Maximum delay at |\n"); |
1532 | printf(" ---------------------------------------------------------------------------------------------------------------\n"); | 1532 | printf(" -----------------------------------------------------------------------------------------------------------------\n"); |
1533 | 1533 | ||
1534 | next = rb_first(&sched->sorted_atom_root); | 1534 | next = rb_first(&sched->sorted_atom_root); |
1535 | 1535 | ||
@@ -1541,7 +1541,7 @@ static int perf_sched__lat(struct perf_sched *sched) | |||
1541 | next = rb_next(next); | 1541 | next = rb_next(next); |
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | printf(" -----------------------------------------------------------------------------------------\n"); | 1544 | printf(" -----------------------------------------------------------------------------------------------------------------\n"); |
1545 | printf(" TOTAL: |%11.3f ms |%9" PRIu64 " |\n", | 1545 | printf(" TOTAL: |%11.3f ms |%9" PRIu64 " |\n", |
1546 | (double)sched->all_runtime / 1e6, sched->all_count); | 1546 | (double)sched->all_runtime / 1e6, sched->all_count); |
1547 | 1547 | ||
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 25526d6eae59..74db2568b867 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -494,7 +494,7 @@ static const char *cat_backtrace(union perf_event *event, | |||
494 | continue; | 494 | continue; |
495 | } | 495 | } |
496 | 496 | ||
497 | tal.filtered = false; | 497 | tal.filtered = 0; |
498 | thread__find_addr_location(al.thread, machine, cpumode, | 498 | thread__find_addr_location(al.thread, machine, cpumode, |
499 | MAP__FUNCTION, ip, &tal); | 499 | MAP__FUNCTION, ip, &tal); |
500 | 500 | ||
@@ -1238,7 +1238,7 @@ static int timechart__record(struct timechart *tchart, int argc, const char **ar | |||
1238 | for (i = 0; i < old_power_args_nr; i++) | 1238 | for (i = 0; i < old_power_args_nr; i++) |
1239 | *p++ = strdup(old_power_args[i]); | 1239 | *p++ = strdup(old_power_args[i]); |
1240 | 1240 | ||
1241 | for (j = 1; j < (unsigned int)argc; j++) | 1241 | for (j = 0; j < (unsigned int)argc; j++) |
1242 | *p++ = argv[j]; | 1242 | *p++ = argv[j]; |
1243 | 1243 | ||
1244 | return cmd_record(rec_argc, rec_argv, NULL); | 1244 | return cmd_record(rec_argc, rec_argv, NULL); |
diff --git a/tools/perf/design.txt b/tools/perf/design.txt index 63a0e6f04a01..a28dca2582aa 100644 --- a/tools/perf/design.txt +++ b/tools/perf/design.txt | |||
@@ -18,7 +18,7 @@ underlying hardware counters. | |||
18 | Performance counters are accessed via special file descriptors. | 18 | Performance counters are accessed via special file descriptors. |
19 | There's one file descriptor per virtual counter used. | 19 | There's one file descriptor per virtual counter used. |
20 | 20 | ||
21 | The special file descriptor is opened via the perf_event_open() | 21 | The special file descriptor is opened via the sys_perf_event_open() |
22 | system call: | 22 | system call: |
23 | 23 | ||
24 | int sys_perf_event_open(struct perf_event_attr *hw_event_uptr, | 24 | int sys_perf_event_open(struct perf_event_attr *hw_event_uptr, |
@@ -82,7 +82,7 @@ machine-specific. | |||
82 | If 'raw_type' is 0, then the 'type' field says what kind of counter | 82 | If 'raw_type' is 0, then the 'type' field says what kind of counter |
83 | this is, with the following encoding: | 83 | this is, with the following encoding: |
84 | 84 | ||
85 | enum perf_event_types { | 85 | enum perf_type_id { |
86 | PERF_TYPE_HARDWARE = 0, | 86 | PERF_TYPE_HARDWARE = 0, |
87 | PERF_TYPE_SOFTWARE = 1, | 87 | PERF_TYPE_SOFTWARE = 1, |
88 | PERF_TYPE_TRACEPOINT = 2, | 88 | PERF_TYPE_TRACEPOINT = 2, |
@@ -95,7 +95,7 @@ specified by 'event_id': | |||
95 | * Generalized performance counter event types, used by the hw_event.event_id | 95 | * Generalized performance counter event types, used by the hw_event.event_id |
96 | * parameter of the sys_perf_event_open() syscall: | 96 | * parameter of the sys_perf_event_open() syscall: |
97 | */ | 97 | */ |
98 | enum hw_event_ids { | 98 | enum perf_hw_id { |
99 | /* | 99 | /* |
100 | * Common hardware events, generalized by the kernel: | 100 | * Common hardware events, generalized by the kernel: |
101 | */ | 101 | */ |
@@ -129,7 +129,7 @@ software events, selected by 'event_id': | |||
129 | * physical and sw events of the kernel (and allow the profiling of them as | 129 | * physical and sw events of the kernel (and allow the profiling of them as |
130 | * well): | 130 | * well): |
131 | */ | 131 | */ |
132 | enum sw_event_ids { | 132 | enum perf_sw_ids { |
133 | PERF_COUNT_SW_CPU_CLOCK = 0, | 133 | PERF_COUNT_SW_CPU_CLOCK = 0, |
134 | PERF_COUNT_SW_TASK_CLOCK = 1, | 134 | PERF_COUNT_SW_TASK_CLOCK = 1, |
135 | PERF_COUNT_SW_PAGE_FAULTS = 2, | 135 | PERF_COUNT_SW_PAGE_FAULTS = 2, |
@@ -230,7 +230,7 @@ these events are recorded in the ring-buffer (see below). | |||
230 | The 'comm' bit allows tracking of process comm data on process creation. | 230 | The 'comm' bit allows tracking of process comm data on process creation. |
231 | This too is recorded in the ring-buffer (see below). | 231 | This too is recorded in the ring-buffer (see below). |
232 | 232 | ||
233 | The 'pid' parameter to the perf_event_open() system call allows the | 233 | The 'pid' parameter to the sys_perf_event_open() system call allows the |
234 | counter to be specific to a task: | 234 | counter to be specific to a task: |
235 | 235 | ||
236 | pid == 0: if the pid parameter is zero, the counter is attached to the | 236 | pid == 0: if the pid parameter is zero, the counter is attached to the |
@@ -260,7 +260,7 @@ The 'flags' parameter is currently unused and must be zero. | |||
260 | 260 | ||
261 | The 'group_fd' parameter allows counter "groups" to be set up. A | 261 | The 'group_fd' parameter allows counter "groups" to be set up. A |
262 | counter group has one counter which is the group "leader". The leader | 262 | counter group has one counter which is the group "leader". The leader |
263 | is created first, with group_fd = -1 in the perf_event_open call | 263 | is created first, with group_fd = -1 in the sys_perf_event_open call |
264 | that creates it. The rest of the group members are created | 264 | that creates it. The rest of the group members are created |
265 | subsequently, with group_fd giving the fd of the group leader. | 265 | subsequently, with group_fd giving the fd of the group leader. |
266 | (A single counter on its own is created with group_fd = -1 and is | 266 | (A single counter on its own is created with group_fd = -1 and is |
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c index 2b6519e0e36f..7ccbc7b6ae77 100644 --- a/tools/perf/tests/hists_link.c +++ b/tools/perf/tests/hists_link.c | |||
@@ -101,6 +101,7 @@ static struct machine *setup_fake_machine(struct machines *machines) | |||
101 | .mmap = { | 101 | .mmap = { |
102 | .header = { .misc = PERF_RECORD_MISC_USER, }, | 102 | .header = { .misc = PERF_RECORD_MISC_USER, }, |
103 | .pid = fake_mmap_info[i].pid, | 103 | .pid = fake_mmap_info[i].pid, |
104 | .tid = fake_mmap_info[i].pid, | ||
104 | .start = fake_mmap_info[i].start, | 105 | .start = fake_mmap_info[i].start, |
105 | .len = 0x1000ULL, | 106 | .len = 0x1000ULL, |
106 | .pgoff = 0ULL, | 107 | .pgoff = 0ULL, |
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 3aa555ff9d89..809b4c50beae 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -1236,6 +1236,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1236 | struct dso *dso = map->dso; | 1236 | struct dso *dso = map->dso; |
1237 | char *filename; | 1237 | char *filename; |
1238 | const char *d_filename; | 1238 | const char *d_filename; |
1239 | const char *evsel_name = perf_evsel__name(evsel); | ||
1239 | struct annotation *notes = symbol__annotation(sym); | 1240 | struct annotation *notes = symbol__annotation(sym); |
1240 | struct disasm_line *pos, *queue = NULL; | 1241 | struct disasm_line *pos, *queue = NULL; |
1241 | u64 start = map__rip_2objdump(map, sym->start); | 1242 | u64 start = map__rip_2objdump(map, sym->start); |
@@ -1243,7 +1244,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1243 | int more = 0; | 1244 | int more = 0; |
1244 | u64 len; | 1245 | u64 len; |
1245 | int width = 8; | 1246 | int width = 8; |
1246 | int namelen; | 1247 | int namelen, evsel_name_len, graph_dotted_len; |
1247 | 1248 | ||
1248 | filename = strdup(dso->long_name); | 1249 | filename = strdup(dso->long_name); |
1249 | if (!filename) | 1250 | if (!filename) |
@@ -1256,14 +1257,17 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1256 | 1257 | ||
1257 | len = symbol__size(sym); | 1258 | len = symbol__size(sym); |
1258 | namelen = strlen(d_filename); | 1259 | namelen = strlen(d_filename); |
1260 | evsel_name_len = strlen(evsel_name); | ||
1259 | 1261 | ||
1260 | if (perf_evsel__is_group_event(evsel)) | 1262 | if (perf_evsel__is_group_event(evsel)) |
1261 | width *= evsel->nr_members; | 1263 | width *= evsel->nr_members; |
1262 | 1264 | ||
1263 | printf(" %-*.*s| Source code & Disassembly of %s\n", | 1265 | printf(" %-*.*s| Source code & Disassembly of %s for %s\n", |
1264 | width, width, "Percent", d_filename); | 1266 | width, width, "Percent", d_filename, evsel_name); |
1265 | printf("-%-*.*s-------------------------------------\n", | 1267 | |
1266 | width+namelen, width+namelen, graph_dotted_line); | 1268 | graph_dotted_len = width + namelen + evsel_name_len; |
1269 | printf("-%-*.*s-----------------------------------------\n", | ||
1270 | graph_dotted_len, graph_dotted_len, graph_dotted_line); | ||
1267 | 1271 | ||
1268 | if (verbose) | 1272 | if (verbose) |
1269 | symbol__annotate_hits(sym, evsel); | 1273 | symbol__annotate_hits(sym, evsel); |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 3e580be0f6fb..9d12aa6dd485 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/types.h> | 1 | #include <linux/types.h> |
2 | #include "event.h" | 2 | #include "event.h" |
3 | #include "debug.h" | 3 | #include "debug.h" |
4 | #include "hist.h" | ||
4 | #include "machine.h" | 5 | #include "machine.h" |
5 | #include "sort.h" | 6 | #include "sort.h" |
6 | #include "string.h" | 7 | #include "string.h" |
@@ -445,6 +446,9 @@ int perf_event__synthesize_threads(struct perf_tool *tool, | |||
445 | union perf_event *comm_event, *mmap_event, *fork_event; | 446 | union perf_event *comm_event, *mmap_event, *fork_event; |
446 | int err = -1; | 447 | int err = -1; |
447 | 448 | ||
449 | if (machine__is_default_guest(machine)) | ||
450 | return 0; | ||
451 | |||
448 | comm_event = malloc(sizeof(comm_event->comm) + machine->id_hdr_size); | 452 | comm_event = malloc(sizeof(comm_event->comm) + machine->id_hdr_size); |
449 | if (comm_event == NULL) | 453 | if (comm_event == NULL) |
450 | goto out; | 454 | goto out; |
@@ -457,9 +461,6 @@ int perf_event__synthesize_threads(struct perf_tool *tool, | |||
457 | if (fork_event == NULL) | 461 | if (fork_event == NULL) |
458 | goto out_free_mmap; | 462 | goto out_free_mmap; |
459 | 463 | ||
460 | if (machine__is_default_guest(machine)) | ||
461 | return 0; | ||
462 | |||
463 | snprintf(proc_path, sizeof(proc_path), "%s/proc", machine->root_dir); | 464 | snprintf(proc_path, sizeof(proc_path), "%s/proc", machine->root_dir); |
464 | proc = opendir(proc_path); | 465 | proc = opendir(proc_path); |
465 | 466 | ||
@@ -705,7 +706,7 @@ void thread__find_addr_map(struct thread *thread, | |||
705 | al->thread = thread; | 706 | al->thread = thread; |
706 | al->addr = addr; | 707 | al->addr = addr; |
707 | al->cpumode = cpumode; | 708 | al->cpumode = cpumode; |
708 | al->filtered = false; | 709 | al->filtered = 0; |
709 | 710 | ||
710 | if (machine == NULL) { | 711 | if (machine == NULL) { |
711 | al->map = NULL; | 712 | al->map = NULL; |
@@ -731,11 +732,11 @@ void thread__find_addr_map(struct thread *thread, | |||
731 | if ((cpumode == PERF_RECORD_MISC_GUEST_USER || | 732 | if ((cpumode == PERF_RECORD_MISC_GUEST_USER || |
732 | cpumode == PERF_RECORD_MISC_GUEST_KERNEL) && | 733 | cpumode == PERF_RECORD_MISC_GUEST_KERNEL) && |
733 | !perf_guest) | 734 | !perf_guest) |
734 | al->filtered = true; | 735 | al->filtered |= (1 << HIST_FILTER__GUEST); |
735 | if ((cpumode == PERF_RECORD_MISC_USER || | 736 | if ((cpumode == PERF_RECORD_MISC_USER || |
736 | cpumode == PERF_RECORD_MISC_KERNEL) && | 737 | cpumode == PERF_RECORD_MISC_KERNEL) && |
737 | !perf_host) | 738 | !perf_host) |
738 | al->filtered = true; | 739 | al->filtered |= (1 << HIST_FILTER__HOST); |
739 | 740 | ||
740 | return; | 741 | return; |
741 | } | 742 | } |
@@ -792,9 +793,6 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
792 | if (thread == NULL) | 793 | if (thread == NULL) |
793 | return -1; | 794 | return -1; |
794 | 795 | ||
795 | if (thread__is_filtered(thread)) | ||
796 | goto out_filtered; | ||
797 | |||
798 | dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); | 796 | dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); |
799 | /* | 797 | /* |
800 | * Have we already created the kernel maps for this machine? | 798 | * Have we already created the kernel maps for this machine? |
@@ -812,6 +810,10 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
812 | dump_printf(" ...... dso: %s\n", | 810 | dump_printf(" ...... dso: %s\n", |
813 | al->map ? al->map->dso->long_name : | 811 | al->map ? al->map->dso->long_name : |
814 | al->level == 'H' ? "[hypervisor]" : "<not found>"); | 812 | al->level == 'H' ? "[hypervisor]" : "<not found>"); |
813 | |||
814 | if (thread__is_filtered(thread)) | ||
815 | al->filtered |= (1 << HIST_FILTER__THREAD); | ||
816 | |||
815 | al->sym = NULL; | 817 | al->sym = NULL; |
816 | al->cpu = sample->cpu; | 818 | al->cpu = sample->cpu; |
817 | 819 | ||
@@ -823,8 +825,9 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
823 | dso->short_name) || | 825 | dso->short_name) || |
824 | (dso->short_name != dso->long_name && | 826 | (dso->short_name != dso->long_name && |
825 | strlist__has_entry(symbol_conf.dso_list, | 827 | strlist__has_entry(symbol_conf.dso_list, |
826 | dso->long_name))))) | 828 | dso->long_name))))) { |
827 | goto out_filtered; | 829 | al->filtered |= (1 << HIST_FILTER__DSO); |
830 | } | ||
828 | 831 | ||
829 | al->sym = map__find_symbol(al->map, al->addr, | 832 | al->sym = map__find_symbol(al->map, al->addr, |
830 | machine->symbol_filter); | 833 | machine->symbol_filter); |
@@ -832,12 +835,9 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
832 | 835 | ||
833 | if (symbol_conf.sym_list && | 836 | if (symbol_conf.sym_list && |
834 | (!al->sym || !strlist__has_entry(symbol_conf.sym_list, | 837 | (!al->sym || !strlist__has_entry(symbol_conf.sym_list, |
835 | al->sym->name))) | 838 | al->sym->name))) { |
836 | goto out_filtered; | 839 | al->filtered |= (1 << HIST_FILTER__SYMBOL); |
837 | 840 | } | |
838 | return 0; | ||
839 | 841 | ||
840 | out_filtered: | ||
841 | al->filtered = true; | ||
842 | return 0; | 842 | return 0; |
843 | } | 843 | } |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 26b67b11c65b..5c28d82b76c4 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -1023,7 +1023,7 @@ retry_sample_id: | |||
1023 | 1023 | ||
1024 | group_fd = get_group_fd(evsel, cpu, thread); | 1024 | group_fd = get_group_fd(evsel, cpu, thread); |
1025 | retry_open: | 1025 | retry_open: |
1026 | pr_debug2("perf_event_open: pid %d cpu %d group_fd %d flags %#lx\n", | 1026 | pr_debug2("sys_perf_event_open: pid %d cpu %d group_fd %d flags %#lx\n", |
1027 | pid, cpus->map[cpu], group_fd, flags); | 1027 | pid, cpus->map[cpu], group_fd, flags); |
1028 | 1028 | ||
1029 | FD(evsel, cpu, thread) = sys_perf_event_open(&evsel->attr, | 1029 | FD(evsel, cpu, thread) = sys_perf_event_open(&evsel->attr, |
@@ -1032,7 +1032,7 @@ retry_open: | |||
1032 | group_fd, flags); | 1032 | group_fd, flags); |
1033 | if (FD(evsel, cpu, thread) < 0) { | 1033 | if (FD(evsel, cpu, thread) < 0) { |
1034 | err = -errno; | 1034 | err = -errno; |
1035 | pr_debug2("perf_event_open failed, error %d\n", | 1035 | pr_debug2("sys_perf_event_open failed, error %d\n", |
1036 | err); | 1036 | err); |
1037 | goto try_fallback; | 1037 | goto try_fallback; |
1038 | } | 1038 | } |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 0466efa71140..f38590d7561b 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -13,13 +13,6 @@ static bool hists__filter_entry_by_thread(struct hists *hists, | |||
13 | static bool hists__filter_entry_by_symbol(struct hists *hists, | 13 | static bool hists__filter_entry_by_symbol(struct hists *hists, |
14 | struct hist_entry *he); | 14 | struct hist_entry *he); |
15 | 15 | ||
16 | enum hist_filter { | ||
17 | HIST_FILTER__DSO, | ||
18 | HIST_FILTER__THREAD, | ||
19 | HIST_FILTER__PARENT, | ||
20 | HIST_FILTER__SYMBOL, | ||
21 | }; | ||
22 | |||
23 | struct callchain_param callchain_param = { | 16 | struct callchain_param callchain_param = { |
24 | .mode = CHAIN_GRAPH_REL, | 17 | .mode = CHAIN_GRAPH_REL, |
25 | .min_percent = 0.5, | 18 | .min_percent = 0.5, |
@@ -429,7 +422,7 @@ struct hist_entry *__hists__add_entry(struct hists *hists, | |||
429 | .weight = weight, | 422 | .weight = weight, |
430 | }, | 423 | }, |
431 | .parent = sym_parent, | 424 | .parent = sym_parent, |
432 | .filtered = symbol__parent_filter(sym_parent), | 425 | .filtered = symbol__parent_filter(sym_parent) | al->filtered, |
433 | .hists = hists, | 426 | .hists = hists, |
434 | .branch_info = bi, | 427 | .branch_info = bi, |
435 | .mem_info = mi, | 428 | .mem_info = mi, |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 0c76bf972736..1f1f513dfe7f 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -14,6 +14,15 @@ struct hist_entry; | |||
14 | struct addr_location; | 14 | struct addr_location; |
15 | struct symbol; | 15 | struct symbol; |
16 | 16 | ||
17 | enum hist_filter { | ||
18 | HIST_FILTER__DSO, | ||
19 | HIST_FILTER__THREAD, | ||
20 | HIST_FILTER__PARENT, | ||
21 | HIST_FILTER__SYMBOL, | ||
22 | HIST_FILTER__GUEST, | ||
23 | HIST_FILTER__HOST, | ||
24 | }; | ||
25 | |||
17 | /* | 26 | /* |
18 | * The kernel collects the number of events it couldn't send in a stretch and | 27 | * The kernel collects the number of events it couldn't send in a stretch and |
19 | * when possible sends this number in a PERF_RECORD_LOST event. The number of | 28 | * when possible sends this number in a PERF_RECORD_LOST event. The number of |
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h index d8c927c868ee..9844c31b7c2b 100644 --- a/tools/perf/util/include/linux/kernel.h +++ b/tools/perf/util/include/linux/kernel.h | |||
@@ -94,12 +94,6 @@ static inline int scnprintf(char * buf, size_t size, const char * fmt, ...) | |||
94 | return (i >= ssize) ? (ssize - 1) : i; | 94 | return (i >= ssize) ? (ssize - 1) : i; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline unsigned long | ||
98 | simple_strtoul(const char *nptr, char **endptr, int base) | ||
99 | { | ||
100 | return strtoul(nptr, endptr, base); | ||
101 | } | ||
102 | |||
103 | int eprintf(int level, | 97 | int eprintf(int level, |
104 | const char *fmt, ...) __attribute__((format(printf, 2, 3))); | 98 | const char *fmt, ...) __attribute__((format(printf, 2, 3))); |
105 | 99 | ||
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 5cecd98c1bc0..a53cd0b8c151 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1027,7 +1027,7 @@ int machine__process_mmap2_event(struct machine *machine, | |||
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | thread = machine__findnew_thread(machine, event->mmap2.pid, | 1029 | thread = machine__findnew_thread(machine, event->mmap2.pid, |
1030 | event->mmap2.pid); | 1030 | event->mmap2.tid); |
1031 | if (thread == NULL) | 1031 | if (thread == NULL) |
1032 | goto out_problem; | 1032 | goto out_problem; |
1033 | 1033 | ||
@@ -1075,7 +1075,7 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event | |||
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | thread = machine__findnew_thread(machine, event->mmap.pid, | 1077 | thread = machine__findnew_thread(machine, event->mmap.pid, |
1078 | event->mmap.pid); | 1078 | event->mmap.tid); |
1079 | if (thread == NULL) | 1079 | if (thread == NULL) |
1080 | goto out_problem; | 1080 | goto out_problem; |
1081 | 1081 | ||
@@ -1312,7 +1312,7 @@ static int machine__resolve_callchain_sample(struct machine *machine, | |||
1312 | continue; | 1312 | continue; |
1313 | } | 1313 | } |
1314 | 1314 | ||
1315 | al.filtered = false; | 1315 | al.filtered = 0; |
1316 | thread__find_addr_location(thread, machine, cpumode, | 1316 | thread__find_addr_location(thread, machine, cpumode, |
1317 | MAP__FUNCTION, ip, &al); | 1317 | MAP__FUNCTION, ip, &al); |
1318 | if (al.sym != NULL) { | 1318 | if (al.sym != NULL) { |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 2553ae04b788..501e4e722e8e 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -186,7 +186,7 @@ struct addr_location { | |||
186 | struct symbol *sym; | 186 | struct symbol *sym; |
187 | u64 addr; | 187 | u64 addr; |
188 | char level; | 188 | char level; |
189 | bool filtered; | 189 | u8 filtered; |
190 | u8 cpumode; | 190 | u8 cpumode; |
191 | s32 cpu; | 191 | s32 cpu; |
192 | }; | 192 | }; |
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 9a070743270c..9b29f085aede 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -44,12 +44,6 @@ void thread__insert_map(struct thread *thread, struct map *map); | |||
44 | int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp); | 44 | int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp); |
45 | size_t thread__fprintf(struct thread *thread, FILE *fp); | 45 | size_t thread__fprintf(struct thread *thread, FILE *fp); |
46 | 46 | ||
47 | static inline struct map *thread__find_map(struct thread *thread, | ||
48 | enum map_type type, u64 addr) | ||
49 | { | ||
50 | return thread ? map_groups__find(&thread->mg, type, addr) : NULL; | ||
51 | } | ||
52 | |||
53 | void thread__find_addr_map(struct thread *thread, struct machine *machine, | 47 | void thread__find_addr_map(struct thread *thread, struct machine *machine, |
54 | u8 cpumode, enum map_type type, u64 addr, | 48 | u8 cpumode, enum map_type type, u64 addr, |
55 | struct addr_location *al); | 49 | struct addr_location *al); |