* [PATCH] perf tools: fix missing default initialization for tool->mmap2 @ 2013-10-08 10:50 Stephane Eranian 2013-10-08 11:59 ` Ingo Molnar 0 siblings, 1 reply; 5+ messages in thread From: Stephane Eranian @ 2013-10-08 10:50 UTC (permalink / raw) To: linux-kernel; +Cc: bitbucket, acme, peterz, mingo 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) ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] perf tools: fix missing default initialization for tool->mmap2 2013-10-08 10:50 [PATCH] perf tools: fix missing default initialization for tool->mmap2 Stephane Eranian @ 2013-10-08 11:59 ` Ingo Molnar 2013-10-08 12:02 ` Stephane Eranian 0 siblings, 1 reply; 5+ messages in thread From: Ingo Molnar @ 2013-10-08 11:59 UTC (permalink / raw) To: Stephane Eranian; +Cc: linux-kernel, bitbucket, acme, peterz, mingo * Stephane Eranian <eranian@google.com> wrote: > > 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) I think it's already fixed in tip:perf/urgent: 6adb0b0ae26f perf tools: Add default handler for mmap2 events Thanks, Ingo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf tools: fix missing default initialization for tool->mmap2 2013-10-08 11:59 ` Ingo Molnar @ 2013-10-08 12:02 ` Stephane Eranian 2013-10-08 12:28 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 5+ messages in thread From: Stephane Eranian @ 2013-10-08 12:02 UTC (permalink / raw) To: Ingo Molnar Cc: LKML, Mike Galbraith, Arnaldo Carvalho de Melo, Peter Zijlstra, mingo@elte.hu On Tue, Oct 8, 2013 at 1:59 PM, Ingo Molnar <mingo@kernel.org> wrote: > > * Stephane Eranian <eranian@google.com> wrote: > >> >> 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) > > I think it's already fixed in tip:perf/urgent: > > 6adb0b0ae26f perf tools: Add default handler for mmap2 events > Ok, it's good then. Thanks for checking. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf tools: fix missing default initialization for tool->mmap2 2013-10-08 12:02 ` Stephane Eranian @ 2013-10-08 12:28 ` Arnaldo Carvalho de Melo 2013-10-08 12:46 ` Stephane Eranian 0 siblings, 1 reply; 5+ messages in thread From: Arnaldo Carvalho de Melo @ 2013-10-08 12:28 UTC (permalink / raw) To: Stephane Eranian Cc: Ingo Molnar, LKML, Mike Galbraith, Peter Zijlstra, mingo@elte.hu Em Tue, Oct 08, 2013 at 02:02:06PM +0200, Stephane Eranian escreveu: > On Tue, Oct 8, 2013 at 1:59 PM, Ingo Molnar <mingo@kernel.org> wrote: > >> --- 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) > > I think it's already fixed in tip:perf/urgent: > > 6adb0b0ae26f perf tools: Add default handler for mmap2 events > Ok, it's good then. > Thanks for checking. Yeah, since 'perf sched' doesn't use mmap records, just relying on the stub default handler is enough. - Arnaldo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf tools: fix missing default initialization for tool->mmap2 2013-10-08 12:28 ` Arnaldo Carvalho de Melo @ 2013-10-08 12:46 ` Stephane Eranian 0 siblings, 0 replies; 5+ messages in thread From: Stephane Eranian @ 2013-10-08 12:46 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Ingo Molnar, LKML, Mike Galbraith, Peter Zijlstra, mingo@elte.hu On Tue, Oct 8, 2013 at 2:28 PM, Arnaldo Carvalho de Melo <acme@redhat.com> wrote: > Em Tue, Oct 08, 2013 at 02:02:06PM +0200, Stephane Eranian escreveu: >> On Tue, Oct 8, 2013 at 1:59 PM, Ingo Molnar <mingo@kernel.org> wrote: >> >> --- 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) > >> > I think it's already fixed in tip:perf/urgent: > >> > 6adb0b0ae26f perf tools: Add default handler for mmap2 events > >> Ok, it's good then. >> Thanks for checking. > > Yeah, since 'perf sched' doesn't use mmap records, just relying on the > stub default handler is enough. > Yeah, exactly. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-08 12:46 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-10-08 10:50 [PATCH] perf tools: fix missing default initialization for tool->mmap2 Stephane Eranian 2013-10-08 11:59 ` 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox