Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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 */
+3 −3
Original line number Diff line number Diff line
@@ -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
+3 −1
Original line number Diff line number Diff line
@@ -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,
@@ -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;
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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);

+14 −5
Original line number Diff line number Diff line
@@ -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",
@@ -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)
@@ -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