Commit 40262a71 authored by Ingo Molnar's avatar Ingo Molnar

Merge branch 'perf/core' of...

Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
parents 3e868581 0849327d
...@@ -363,8 +363,14 @@ static int watchdog_nmi_enable(int cpu) ...@@ -363,8 +363,14 @@ static int watchdog_nmi_enable(int cpu)
goto out_save; 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); return PTR_ERR(event);
/* success path */ /* success path */
......
...@@ -680,7 +680,7 @@ static int __cmd_record(int argc, const char **argv) ...@@ -680,7 +680,7 @@ static int __cmd_record(int argc, const char **argv)
perf_event__synthesize_guest_os); perf_event__synthesize_guest_os);
if (!system_wide) if (!system_wide)
perf_event__synthesize_thread(target_tid, perf_event__synthesize_thread_map(evsel_list->threads,
process_synthesized_event, process_synthesized_event,
session); session);
else else
......
...@@ -44,6 +44,7 @@ static const char default_pretty_printing_style[] = "normal"; ...@@ -44,6 +44,7 @@ static const char default_pretty_printing_style[] = "normal";
static const char *pretty_printing_style = default_pretty_printing_style; static const char *pretty_printing_style = default_pretty_printing_style;
static char callchain_default_opt[] = "fractal,0.5"; 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, static struct hists *perf_session__hists_findnew(struct perf_session *self,
u64 event_stream, u32 type, u64 event_stream, u32 type,
...@@ -167,7 +168,7 @@ static int process_sample_event(union perf_event *event, ...@@ -167,7 +168,7 @@ static int process_sample_event(union perf_event *event,
struct perf_event_attr *attr; struct perf_event_attr *attr;
if (perf_event__preprocess_sample(event, session, &al, sample, 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", fprintf(stderr, "problem processing %d event, skipping it.\n",
event->header.type); event->header.type);
return -1; return -1;
...@@ -520,6 +521,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) ...@@ -520,6 +521,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
*/ */
if (use_browser > 0) { if (use_browser > 0) {
symbol_conf.priv_size = sizeof(struct annotation); symbol_conf.priv_size = sizeof(struct annotation);
annotate_init = symbol__annotate_init;
/* /*
* For searching by name on the "Browse map details". * For searching by name on the "Browse map details".
* providing it only in verbose mode not to bloat too * providing it only in verbose mode not to bloat too
......
...@@ -876,8 +876,8 @@ static int __cmd_top(void) ...@@ -876,8 +876,8 @@ static int __cmd_top(void)
return -ENOMEM; return -ENOMEM;
if (top.target_tid != -1) if (top.target_tid != -1)
perf_event__synthesize_thread(top.target_tid, perf_event__process, perf_event__synthesize_thread_map(top.evlist->threads,
session); perf_event__process, session);
else else
perf_event__synthesize_threads(perf_event__process, session); perf_event__synthesize_threads(perf_event__process, session);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "string.h" #include "string.h"
#include "strlist.h" #include "strlist.h"
#include "thread.h" #include "thread.h"
#include "thread_map.h"
static const char *perf_event__names[] = { static const char *perf_event__names[] = {
[0] = "TOTAL", [0] = "TOTAL",
...@@ -265,11 +266,12 @@ static int __event__synthesize_thread(union perf_event *comm_event, ...@@ -265,11 +266,12 @@ static int __event__synthesize_thread(union perf_event *comm_event,
process, session); 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) struct perf_session *session)
{ {
union perf_event *comm_event, *mmap_event; 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); comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size);
if (comm_event == NULL) if (comm_event == NULL)
...@@ -279,8 +281,15 @@ int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, ...@@ -279,8 +281,15 @@ int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process,
if (mmap_event == NULL) if (mmap_event == NULL)
goto out_free_comm; goto out_free_comm;
err = __event__synthesize_thread(comm_event, mmap_event, pid, err = 0;
process, session); 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); free(mmap_event);
out_free_comm: out_free_comm:
free(comm_event); free(comm_event);
......
...@@ -135,6 +135,7 @@ union perf_event { ...@@ -135,6 +135,7 @@ union perf_event {
void perf_event__print_totals(void); void perf_event__print_totals(void);
struct perf_session; struct perf_session;
struct thread_map;
typedef int (*perf_event__handler_synth_t)(union perf_event *event, typedef int (*perf_event__handler_synth_t)(union perf_event *event,
struct perf_session *session); struct perf_session *session);
...@@ -142,7 +143,8 @@ typedef int (*perf_event__handler_t)(union perf_event *event, ...@@ -142,7 +143,8 @@ typedef int (*perf_event__handler_t)(union perf_event *event,
struct perf_sample *sample, struct perf_sample *sample,
struct perf_session *session); struct perf_session *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); struct perf_session *session);
int perf_event__synthesize_threads(perf_event__handler_t process, int perf_event__synthesize_threads(perf_event__handler_t process,
struct perf_session *session); struct perf_session *session);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment