linux-kernel.vger.kernel.org archive mirror
 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

* Re: [PATCH] perf: fix coredump caused by introduce of probe module option
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Jovi Zhang @ 2011-08-08  3:01 UTC (permalink / raw)
  To: acme, acme; +Cc: linux-kernel

On Mon, Jul 25, 2011 at 10:08 PM,  <bookjovi@gmail.com> wrote:
> 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(-)
>

Hi acme,
   Can this patch go through your tree?
   (Get rid of "From" field, that's suck. :))

.jovi

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

* Re: [PATCH] perf: fix coredump caused by introduce of probe module option
  2011-08-08  3:01 ` Jovi Zhang
@ 2011-08-08 14:41   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-08-08 14:41 UTC (permalink / raw)
  To: Jovi Zhang; +Cc: linux-kernel

Em Mon, Aug 08, 2011 at 11:01:19AM +0800, Jovi Zhang escreveu:
> On Mon, Jul 25, 2011 at 10:08 PM,  <bookjovi@gmail.com> wrote:
> > 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(-)
> >
> 
> Hi acme,
>    Can this patch go through your tree?
>    (Get rid of "From" field, that's suck. :))

yeah, I'm applying it.

Thanks,

- Arnaldo

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

* [tip:perf/urgent] perf probe: Fix coredump introduced by probe module option
  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-10  8:25 ` tip-bot for Jovi Zhang
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Jovi Zhang @ 2011-08-10  8:25 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, bookjovi,
	tglx, mingo

Commit-ID:  ce27a443d17dccf613079a7147cf0d220bc4ec82
Gitweb:     http://git.kernel.org/tip/ce27a443d17dccf613079a7147cf0d220bc4ec82
Author:     Jovi Zhang <bookjovi@gmail.com>
AuthorDate: Mon, 25 Jul 2011 22:08:08 +0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 8 Aug 2011 09:35:41 -0300

perf probe: Fix coredump introduced by probe module option

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

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

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1311602888-2389-1-git-send-email-bookjovi@gmail.com
Signed-off-by: Jovi Zhang <bookjovi@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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;

^ 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).