[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50399556C9727B4D88A595C8584AAB37524EC9D0@GSjpTKYDCembx32.service.hitachi.net>
Date: Wed, 26 Aug 2015 12:21:40 +0000
From: 平松雅巳 / HIRAMATU,MASAMI
<masami.hiramatsu.pt@...achi.com>
To: "'Wang Nan'" <wangnan0@...wei.com>,
"acme@...nel.org" <acme@...nel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>
CC: "mingo@...hat.com" <mingo@...hat.com>,
"namhyung@...nel.org" <namhyung@...nel.org>,
"pi3orama@....com" <pi3orama@....com>,
"lizefan@...wei.com" <lizefan@...wei.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
sysp-manager <cti.systems-productivity-manager.ts@...achi.com>
Subject: RE: [PATCH v3 4/6] perf probe: Fix error reported when offset
without function
> From: Wang Nan [mailto:wangnan0@...wei.com]
>
> This patch fixes a bug that, when offset is provided but function is
> lost, parse_perf_probe_point() will give a "" string as function name,
> so the checking code at the end of parse_perf_probe_point() become useless.
> For example:
>
> # perf probe +0x1234
> Failed to find symbol in kernel
> Error: Failed to add events.
>
> After this patch:
>
> # perf probe +0x1234
> Semantic error :Offset requires an entry function.
> Error: Command Parse Error.
OK, seems sane now :)
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Thanks!
>
> Signed-off-by: Wang Nan <wangnan0@...wei.com>
> Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> ---
> tools/perf/util/probe-event.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 926bcec..eaacb58 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -1194,9 +1194,13 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
> *ptr++ = '\0';
> }
>
> - tmp = strdup(arg);
> - if (tmp == NULL)
> - return -ENOMEM;
> + if (arg[0] == '\0')
> + tmp = NULL;
> + else {
> + tmp = strdup(arg);
> + if (tmp == NULL)
> + return -ENOMEM;
> + }
>
> if (file_spec)
> pp->file = tmp;
> --
> 1.8.3.4
Powered by blists - more mailing lists