[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50399556C9727B4D88A595C8584AAB37525215FC@GSjpTKYDCembx32.service.hitachi.net>
Date: Thu, 10 Sep 2015 12:58:59 +0000
From: 平松雅巳 / HIRAMATU,MASAMI
<masami.hiramatsu.pt@...achi.com>
To: "'Namhyung Kim'" <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>
CC: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Jiri Olsa <jolsa@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
Wang Nan <wangnan0@...wei.com>
Subject: RE: [PATCH 3/3] perf probe: Move init/exit_probe_symbol_maps() into
callers
--
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development Group
E-mail: masami.hiramatsu.pt@...achi.com
>-----Original Message-----
>From: Namhyung Kim [mailto:namhyung@...il.com] On Behalf Of Namhyung Kim
>Sent: Thursday, September 10, 2015 11:27 AM
>To: Arnaldo Carvalho de Melo
>Cc: Ingo Molnar; Peter Zijlstra; Jiri Olsa; LKML; Wang Nan; 平松雅巳 / HIRAMATU,MASAMI
>Subject: [PATCH 3/3] perf probe: Move init/exit_probe_symbol_maps() into callers
>
>The init/exit_probe_symbol_maps() was a part of
>convert_perf_probe_events() and cleanup_perf_probe_events(). But as
>these functions can be called multiple times, it'd be better moving
>init/exit functions out of them, so that it should be called only once.
Ah, OK, I see.
But I'd rather like exposing prototypes in this patch, since this is the true
user of it.
Thanks!
>
>Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
>Cc: Wang Nan <wangnan0@...wei.com>
>Signed-off-by: Namhyung Kim <namhyung@...nel.org>
>---
> tools/perf/builtin-probe.c | 5 +++++
> tools/perf/util/probe-event.c | 11 +++++------
> 2 files changed, 10 insertions(+), 6 deletions(-)
>
>diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
>index 2bec9c1ef2a3..94385ee89dc8 100644
>--- a/tools/perf/builtin-probe.c
>+++ b/tools/perf/builtin-probe.c
>@@ -317,6 +317,10 @@ static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs)
> int i, k;
> const char *event = NULL, *group = NULL;
>
>+ ret = init_probe_symbol_maps(pevs->uprobes);
>+ if (ret < 0)
>+ return ret;
>+
> ret = convert_perf_probe_events(pevs, npevs);
> if (ret < 0)
> goto out_cleanup;
>@@ -354,6 +358,7 @@ static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs)
>
> out_cleanup:
> cleanup_perf_probe_events(pevs, npevs);
>+ exit_probe_symbol_maps();
> return ret;
> }
>
>diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
>index 64e15cba7223..2b78e8f19b45 100644
>--- a/tools/perf/util/probe-event.c
>+++ b/tools/perf/util/probe-event.c
>@@ -2746,10 +2746,6 @@ int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs)
> {
> int i, ret;
>
>- ret = init_probe_symbol_maps(pevs->uprobes);
>- if (ret < 0)
>- return ret;
>-
> /* Loop 1: convert all events */
> for (i = 0; i < npevs; i++) {
> /* Init kprobe blacklist if needed */
>@@ -2794,20 +2790,23 @@ void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs)
> pevs[i].ntevs = 0;
> clear_perf_probe_event(&pevs[i]);
> }
>-
>- exit_probe_symbol_maps();
> }
>
> int add_perf_probe_events(struct perf_probe_event *pevs, int npevs)
> {
> int ret;
>
>+ ret = init_probe_symbol_maps(pevs->uprobes);
>+ if (ret < 0)
>+ return ret;
>+
> ret = convert_perf_probe_events(pevs, npevs);
> if (ret == 0)
> ret = apply_perf_probe_events(pevs, npevs);
>
> cleanup_perf_probe_events(pevs, npevs);
>
>+ exit_probe_symbol_maps();
> return ret;
> }
>
>--
>2.5.0
Powered by blists - more mailing lists