public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: bitbucket@online.de, acme@redhat.com, peterz@infradead.org,
	mingo@elte.hu
Subject: [PATCH] perf tools: fix missing default initialization for tool->mmap2
Date: Tue, 8 Oct 2013 12:50:16 +0200	[thread overview]
Message-ID: <20131008105016.GA2446@quad> (raw)


This patch fixes a SEGFAULT bug with perf sched
related to the new MMAP2 record type. There was
a missing default initialization for the tool->mmap2
pointer in perf_tool__fill_defaults().

Reproducer:
 # perf sched record -- sleep 1
 # perf sched lat

Reported-by: Mike Galbraith <bitbucket@online.de>
Signed-off-by: Stephane Eranian <eranian@google.com>
--

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 211b325..8415c54 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -256,6 +256,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
 		tool->sample = process_event_sample_stub;
 	if (tool->mmap == NULL)
 		tool->mmap = process_event_stub;
+	if (tool->mmap2 == NULL)
+		tool->mmap2 = process_event_stub;
 	if (tool->comm == NULL)
 		tool->comm = process_event_stub;
 	if (tool->fork == NULL)

             reply	other threads:[~2013-10-08 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 10:50 Stephane Eranian [this message]
2013-10-08 11:59 ` [PATCH] perf tools: fix missing default initialization for tool->mmap2 Ingo Molnar
2013-10-08 12:02   ` Stephane Eranian
2013-10-08 12:28     ` Arnaldo Carvalho de Melo
2013-10-08 12:46       ` Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131008105016.GA2446@quad \
    --to=eranian@google.com \
    --cc=acme@redhat.com \
    --cc=bitbucket@online.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox