diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-02-11 20:24:52 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-02-11 20:24:52 -0500 |
commit | 40262a71536d0b4a7486b279fa39463cfffabcc2 (patch) | |
tree | 2a63d79f17dff257b8ac160f0138bdb00f6e4747 | |
parent | 3e86858133c632060b290985837a11dbe2e0cc0e (diff) | |
parent | 0849327d13a0bd7f6512b7c21f4b3e79efb2076d (diff) |
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
-rw-r--r-- | kernel/watchdog.c | 10 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 6 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rw-r--r-- | tools/perf/util/event.c | 19 | ||||
-rw-r--r-- | tools/perf/util/event.h | 6 |
6 files changed, 34 insertions, 15 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index f37f974aa81b..18bb15776c57 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -363,8 +363,14 @@ static int watchdog_nmi_enable(int cpu) | |||
363 | goto out_save; | 363 | goto out_save; |
364 | } | 364 | } |
365 | 365 | ||
366 | printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n", | 366 | |
367 | cpu, PTR_ERR(event)); | 367 | /* vary the KERN level based on the returned errno */ |
368 | if (PTR_ERR(event) == -EOPNOTSUPP) | ||
369 | printk(KERN_INFO "NMI watchdog disabled (cpu%i): not supported (no LAPIC?)\n", cpu); | ||
370 | else if (PTR_ERR(event) == -ENOENT) | ||
371 | printk(KERN_WARNING "NMI watchdog disabled (cpu%i): hardware events not enabled\n", cpu); | ||
372 | else | ||
373 | printk(KERN_ERR "NMI watchdog disabled (cpu%i): unable to create perf event: %ld\n", cpu, PTR_ERR(event)); | ||
368 | return PTR_ERR(event); | 374 | return PTR_ERR(event); |
369 | 375 | ||
370 | /* success path */ | 376 | /* success path */ |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 07f8d6d852c2..12e0e41696d9 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -680,9 +680,9 @@ static int __cmd_record(int argc, const char **argv) | |||
680 | perf_event__synthesize_guest_os); | 680 | perf_event__synthesize_guest_os); |
681 | 681 | ||
682 | if (!system_wide) | 682 | if (!system_wide) |
683 | perf_event__synthesize_thread(target_tid, | 683 | perf_event__synthesize_thread_map(evsel_list->threads, |
684 | process_synthesized_event, | 684 | process_synthesized_event, |
685 | session); | 685 | session); |
686 | else | 686 | else |
687 | perf_event__synthesize_threads(process_synthesized_event, | 687 | perf_event__synthesize_threads(process_synthesized_event, |
688 | session); | 688 | session); |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f403aced4cba..f9a99a1ce609 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -44,6 +44,7 @@ static const char default_pretty_printing_style[] = "normal"; | |||
44 | static const char *pretty_printing_style = default_pretty_printing_style; | 44 | static const char *pretty_printing_style = default_pretty_printing_style; |
45 | 45 | ||
46 | static char callchain_default_opt[] = "fractal,0.5"; | 46 | static char callchain_default_opt[] = "fractal,0.5"; |
47 | static symbol_filter_t annotate_init; | ||
47 | 48 | ||
48 | static struct hists *perf_session__hists_findnew(struct perf_session *self, | 49 | static struct hists *perf_session__hists_findnew(struct perf_session *self, |
49 | u64 event_stream, u32 type, | 50 | u64 event_stream, u32 type, |
@@ -167,7 +168,7 @@ static int process_sample_event(union perf_event *event, | |||
167 | struct perf_event_attr *attr; | 168 | struct perf_event_attr *attr; |
168 | 169 | ||
169 | if (perf_event__preprocess_sample(event, session, &al, sample, | 170 | if (perf_event__preprocess_sample(event, session, &al, sample, |
170 | symbol__annotate_init) < 0) { | 171 | annotate_init) < 0) { |
171 | fprintf(stderr, "problem processing %d event, skipping it.\n", | 172 | fprintf(stderr, "problem processing %d event, skipping it.\n", |
172 | event->header.type); | 173 | event->header.type); |
173 | return -1; | 174 | return -1; |
@@ -520,6 +521,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
520 | */ | 521 | */ |
521 | if (use_browser > 0) { | 522 | if (use_browser > 0) { |
522 | symbol_conf.priv_size = sizeof(struct annotation); | 523 | symbol_conf.priv_size = sizeof(struct annotation); |
524 | annotate_init = symbol__annotate_init; | ||
523 | /* | 525 | /* |
524 | * For searching by name on the "Browse map details". | 526 | * For searching by name on the "Browse map details". |
525 | * providing it only in verbose mode not to bloat too | 527 | * providing it only in verbose mode not to bloat too |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 210c736e6db4..c9fd66d4a082 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -876,8 +876,8 @@ static int __cmd_top(void) | |||
876 | return -ENOMEM; | 876 | return -ENOMEM; |
877 | 877 | ||
878 | if (top.target_tid != -1) | 878 | if (top.target_tid != -1) |
879 | perf_event__synthesize_thread(top.target_tid, perf_event__process, | 879 | perf_event__synthesize_thread_map(top.evlist->threads, |
880 | session); | 880 | perf_event__process, session); |
881 | else | 881 | else |
882 | perf_event__synthesize_threads(perf_event__process, session); | 882 | perf_event__synthesize_threads(perf_event__process, session); |
883 | 883 | ||
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 731265f4ad19..fbf5754c8866 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "string.h" | 6 | #include "string.h" |
7 | #include "strlist.h" | 7 | #include "strlist.h" |
8 | #include "thread.h" | 8 | #include "thread.h" |
9 | #include "thread_map.h" | ||
9 | 10 | ||
10 | static const char *perf_event__names[] = { | 11 | static const char *perf_event__names[] = { |
11 | [0] = "TOTAL", | 12 | [0] = "TOTAL", |
@@ -265,11 +266,12 @@ static int __event__synthesize_thread(union perf_event *comm_event, | |||
265 | process, session); | 266 | process, session); |
266 | } | 267 | } |
267 | 268 | ||
268 | int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, | 269 | int perf_event__synthesize_thread_map(struct thread_map *threads, |
269 | struct perf_session *session) | 270 | perf_event__handler_t process, |
271 | struct perf_session *session) | ||
270 | { | 272 | { |
271 | union perf_event *comm_event, *mmap_event; | 273 | union perf_event *comm_event, *mmap_event; |
272 | int err = -1; | 274 | int err = -1, thread; |
273 | 275 | ||
274 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); | 276 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); |
275 | if (comm_event == NULL) | 277 | if (comm_event == NULL) |
@@ -279,8 +281,15 @@ int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, | |||
279 | if (mmap_event == NULL) | 281 | if (mmap_event == NULL) |
280 | goto out_free_comm; | 282 | goto out_free_comm; |
281 | 283 | ||
282 | err = __event__synthesize_thread(comm_event, mmap_event, pid, | 284 | err = 0; |
283 | process, session); | 285 | for (thread = 0; thread < threads->nr; ++thread) { |
286 | if (__event__synthesize_thread(comm_event, mmap_event, | ||
287 | threads->map[thread], | ||
288 | process, session)) { | ||
289 | err = -1; | ||
290 | break; | ||
291 | } | ||
292 | } | ||
284 | free(mmap_event); | 293 | free(mmap_event); |
285 | out_free_comm: | 294 | out_free_comm: |
286 | free(comm_event); | 295 | free(comm_event); |
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index eecb42273d59..9c35170fb379 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -135,6 +135,7 @@ union perf_event { | |||
135 | void perf_event__print_totals(void); | 135 | void perf_event__print_totals(void); |
136 | 136 | ||
137 | struct perf_session; | 137 | struct perf_session; |
138 | struct thread_map; | ||
138 | 139 | ||
139 | typedef int (*perf_event__handler_synth_t)(union perf_event *event, | 140 | typedef int (*perf_event__handler_synth_t)(union perf_event *event, |
140 | struct perf_session *session); | 141 | struct perf_session *session); |
@@ -142,8 +143,9 @@ typedef int (*perf_event__handler_t)(union perf_event *event, | |||
142 | struct perf_sample *sample, | 143 | struct perf_sample *sample, |
143 | struct perf_session *session); | 144 | struct perf_session *session); |
144 | 145 | ||
145 | int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, | 146 | int perf_event__synthesize_thread_map(struct thread_map *threads, |
146 | struct perf_session *session); | 147 | perf_event__handler_t process, |
148 | struct perf_session *session); | ||
147 | int perf_event__synthesize_threads(perf_event__handler_t process, | 149 | int perf_event__synthesize_threads(perf_event__handler_t process, |
148 | struct perf_session *session); | 150 | struct perf_session *session); |
149 | int perf_event__synthesize_kernel_mmap(perf_event__handler_t process, | 151 | int perf_event__synthesize_kernel_mmap(perf_event__handler_t process, |