All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: fix coredump caused by introduce of probe module option
@ 2011-07-25 14:08 bookjovi
  2011-08-08  3:01 ` Jovi Zhang
  2011-08-10  8:25 ` [tip:perf/urgent] perf probe: Fix coredump introduced by " tip-bot for Jovi Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: bookjovi @ 2011-07-25 14:08 UTC (permalink / raw)
  To: bookjovi, acme, mingo, a.p.zijlstra, paulus; +Cc: linux-kernel, root

From: root <root@localhost.localdomain>

perf will coredump if user don't give "-m" option in probe command,
this patch fix it.

[root@localhost perf]# ./perf probe --add='PROBE'
Segmentation fault (core dumped)

Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
---
 tools/perf/util/probe-event.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index b82d54f..1c7bfa5 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1820,11 +1820,15 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
 		ret = -ENOMEM;
 		goto error;
 	}
-	tev->point.module = strdup(module);
-	if (tev->point.module == NULL) {
-		ret = -ENOMEM;
-		goto error;
+
+	if (module) {
+		tev->point.module = strdup(module);
+		if (tev->point.module == NULL) {
+			ret = -ENOMEM;
+			goto error;
+		}
 	}
+
 	tev->point.offset = pev->point.offset;
 	tev->point.retprobe = pev->point.retprobe;
 	tev->nargs = pev->nargs;
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-10  8:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25 14:08 [PATCH] perf: fix coredump caused by introduce of probe module option bookjovi
2011-08-08  3:01 ` Jovi Zhang
2011-08-08 14:41   ` Arnaldo Carvalho de Melo
2011-08-10  8:25 ` [tip:perf/urgent] perf probe: Fix coredump introduced by " tip-bot for Jovi Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.