perf tools: fix missing default initialization for tool->mmap2
PATCH 1/1 perf tools: fix missing default initialization for tool->mmap2
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
--
tools/perf/util/session.c +2 -0
@@ -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 )
Quoted 19 lines · Stephane Eranian
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->mmap2pointer inperf_tool__fill_defaults().Reproducer:
# perf sched record -- sleep 1 # perf sched latReported-by Mike Galbraith <[email protected]>Signed-off-by Stephane Eranian <[email protected]>--
tools/perf/util/session.c +0
-0
tools/perf/util/session.c void perf_tool__fill_defaults(struct perf_tool *tool) · line 263
Quoted 8 lines
tools/perf/util/session.c +2
-0@@ -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
Quoted 33 lines · Ingo Molnar
Quoted 19 lines · Stephane Eranian
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->mmap2pointer inperf_tool__fill_defaults().Reproducer:
# perf sched record -- sleep 1 # perf sched latReported-by Mike Galbraith <[email protected]>Signed-off-by Stephane Eranian <[email protected]>--
tools/perf/util/session.c +0
-0tools/perf/util/session.c void perf_tool__fill_defaults(struct perf_tool *tool) · line 263
Quoted 8 lines
tools/perf/util/session.c +2
-0@@ -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:
Quoted 2 lines
6adb0b0ae26fperf tools: Add default handler for mmap2 events
Ok, it's good then.
Thanks for checking.
Em Tue, Oct 08, 2013 at 02:02:06PM +0200, Stephane Eranian escreveu:
Quoted 15 lines · Ingo Molnar
Quoted 13 lines
tools/perf/util/session.c void perf_tool__fill_defaults(struct perf_tool *tool) · line 263
Quoted 11 lines
tools/perf/util/session.c +2
-0@@ -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:
Quoted 4 lines
Quoted 1 line
6adb0b0ae26fperf tools: Add default handler for mmap2 eventsOk, 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
Quoted 16 lines · Arnaldo Carvalho de Melo
Em Tue, Oct 08, 2013 at 02:02:06PM +0200, Stephane Eranian escreveu:
Quoted 14 lines · Ingo Molnar
Quoted 13 lines
tools/perf/util/session.c void perf_tool__fill_defaults(struct perf_tool *tool) · line 263
Quoted 11 lines
tools/perf/util/session.c +2
-0@@ -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:
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
6adb0b0ae26fperf tools: Add default handler for mmap2 eventsOk, 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.