Loading kernel/watchdog.c +8 −2 Original line number Diff line number Diff line Loading @@ -363,8 +363,14 @@ static int watchdog_nmi_enable(int cpu) goto out_save; } printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n", cpu, PTR_ERR(event)); /* vary the KERN level based on the returned errno */ if (PTR_ERR(event) == -EOPNOTSUPP) printk(KERN_INFO "NMI watchdog disabled (cpu%i): not supported (no LAPIC?)\n", cpu); else if (PTR_ERR(event) == -ENOENT) printk(KERN_WARNING "NMI watchdog disabled (cpu%i): hardware events not enabled\n", cpu); else printk(KERN_ERR "NMI watchdog disabled (cpu%i): unable to create perf event: %ld\n", cpu, PTR_ERR(event)); return PTR_ERR(event); /* success path */ Loading tools/perf/builtin-record.c +3 −3 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ static int __cmd_record(int argc, const char **argv) perf_event__synthesize_guest_os); if (!system_wide) perf_event__synthesize_thread(target_tid, perf_event__synthesize_thread_map(evsel_list->threads, process_synthesized_event, session); else Loading tools/perf/builtin-report.c +3 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ static const char default_pretty_printing_style[] = "normal"; static const char *pretty_printing_style = default_pretty_printing_style; static char callchain_default_opt[] = "fractal,0.5"; static symbol_filter_t annotate_init; static struct hists *perf_session__hists_findnew(struct perf_session *self, u64 event_stream, u32 type, Loading Loading @@ -167,7 +168,7 @@ static int process_sample_event(union perf_event *event, struct perf_event_attr *attr; if (perf_event__preprocess_sample(event, session, &al, sample, symbol__annotate_init) < 0) { annotate_init) < 0) { fprintf(stderr, "problem processing %d event, skipping it.\n", event->header.type); return -1; Loading Loading @@ -520,6 +521,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) */ if (use_browser > 0) { symbol_conf.priv_size = sizeof(struct annotation); annotate_init = symbol__annotate_init; /* * For searching by name on the "Browse map details". * providing it only in verbose mode not to bloat too Loading tools/perf/builtin-top.c +2 −2 Original line number Diff line number Diff line Loading @@ -876,8 +876,8 @@ static int __cmd_top(void) return -ENOMEM; if (top.target_tid != -1) perf_event__synthesize_thread(top.target_tid, perf_event__process, session); perf_event__synthesize_thread_map(top.evlist->threads, perf_event__process, session); else perf_event__synthesize_threads(perf_event__process, session); Loading tools/perf/util/event.c +14 −5 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include "string.h" #include "strlist.h" #include "thread.h" #include "thread_map.h" static const char *perf_event__names[] = { [0] = "TOTAL", Loading Loading @@ -265,11 +266,12 @@ static int __event__synthesize_thread(union perf_event *comm_event, process, session); } int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, int perf_event__synthesize_thread_map(struct thread_map *threads, perf_event__handler_t process, struct perf_session *session) { union perf_event *comm_event, *mmap_event; int err = -1; int err = -1, thread; comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); if (comm_event == NULL) Loading @@ -279,8 +281,15 @@ int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, if (mmap_event == NULL) goto out_free_comm; err = __event__synthesize_thread(comm_event, mmap_event, pid, process, session); err = 0; for (thread = 0; thread < threads->nr; ++thread) { if (__event__synthesize_thread(comm_event, mmap_event, threads->map[thread], process, session)) { err = -1; break; } } free(mmap_event); out_free_comm: free(comm_event); Loading Loading
kernel/watchdog.c +8 −2 Original line number Diff line number Diff line Loading @@ -363,8 +363,14 @@ static int watchdog_nmi_enable(int cpu) goto out_save; } printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n", cpu, PTR_ERR(event)); /* vary the KERN level based on the returned errno */ if (PTR_ERR(event) == -EOPNOTSUPP) printk(KERN_INFO "NMI watchdog disabled (cpu%i): not supported (no LAPIC?)\n", cpu); else if (PTR_ERR(event) == -ENOENT) printk(KERN_WARNING "NMI watchdog disabled (cpu%i): hardware events not enabled\n", cpu); else printk(KERN_ERR "NMI watchdog disabled (cpu%i): unable to create perf event: %ld\n", cpu, PTR_ERR(event)); return PTR_ERR(event); /* success path */ Loading
tools/perf/builtin-record.c +3 −3 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ static int __cmd_record(int argc, const char **argv) perf_event__synthesize_guest_os); if (!system_wide) perf_event__synthesize_thread(target_tid, perf_event__synthesize_thread_map(evsel_list->threads, process_synthesized_event, session); else Loading
tools/perf/builtin-report.c +3 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ static const char default_pretty_printing_style[] = "normal"; static const char *pretty_printing_style = default_pretty_printing_style; static char callchain_default_opt[] = "fractal,0.5"; static symbol_filter_t annotate_init; static struct hists *perf_session__hists_findnew(struct perf_session *self, u64 event_stream, u32 type, Loading Loading @@ -167,7 +168,7 @@ static int process_sample_event(union perf_event *event, struct perf_event_attr *attr; if (perf_event__preprocess_sample(event, session, &al, sample, symbol__annotate_init) < 0) { annotate_init) < 0) { fprintf(stderr, "problem processing %d event, skipping it.\n", event->header.type); return -1; Loading Loading @@ -520,6 +521,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) */ if (use_browser > 0) { symbol_conf.priv_size = sizeof(struct annotation); annotate_init = symbol__annotate_init; /* * For searching by name on the "Browse map details". * providing it only in verbose mode not to bloat too Loading
tools/perf/builtin-top.c +2 −2 Original line number Diff line number Diff line Loading @@ -876,8 +876,8 @@ static int __cmd_top(void) return -ENOMEM; if (top.target_tid != -1) perf_event__synthesize_thread(top.target_tid, perf_event__process, session); perf_event__synthesize_thread_map(top.evlist->threads, perf_event__process, session); else perf_event__synthesize_threads(perf_event__process, session); Loading
tools/perf/util/event.c +14 −5 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include "string.h" #include "strlist.h" #include "thread.h" #include "thread_map.h" static const char *perf_event__names[] = { [0] = "TOTAL", Loading Loading @@ -265,11 +266,12 @@ static int __event__synthesize_thread(union perf_event *comm_event, process, session); } int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, int perf_event__synthesize_thread_map(struct thread_map *threads, perf_event__handler_t process, struct perf_session *session) { union perf_event *comm_event, *mmap_event; int err = -1; int err = -1, thread; comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); if (comm_event == NULL) Loading @@ -279,8 +281,15 @@ int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, if (mmap_event == NULL) goto out_free_comm; err = __event__synthesize_thread(comm_event, mmap_event, pid, process, session); err = 0; for (thread = 0; thread < threads->nr; ++thread) { if (__event__synthesize_thread(comm_event, mmap_event, threads->map[thread], process, session)) { err = -1; break; } } free(mmap_event); out_free_comm: free(comm_event); Loading