Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752228Ab3DYF6P (ORCPT ); Thu, 25 Apr 2013 01:58:15 -0400 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:45632 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929Ab3DYF6O (ORCPT ); Thu, 25 Apr 2013 01:58:14 -0400 X-AuditID: 9c93016f-b7b70ae0000038d5-b8-5178c5f4d5ba From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Namhyung Kim , LKML , Steven Rostedt , Frederic Weisbecker , David Ahern , Stephane Eranian Subject: Re: [PATCH 02/14] perf util: Use evsel->name to get tracepoint_paths References: <1366705872-12132-1-git-send-email-namhyung@kernel.org> <1366705872-12132-3-git-send-email-namhyung@kernel.org> <20130424124257.GE971@krava.brq.redhat.com> Date: Thu, 25 Apr 2013 14:58:09 +0900 In-Reply-To: <20130424124257.GE971@krava.brq.redhat.com> (Jiri Olsa's message of "Wed, 24 Apr 2013 14:42:57 +0200") Message-ID: <87k3nr9moe.fsf@sejong.aot.lge.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1788 Lines: 54 Hi Jiri, On Wed, 24 Apr 2013 14:42:57 +0200, Jiri Olsa wrote: > On Tue, Apr 23, 2013 at 05:31:00PM +0900, Namhyung Kim wrote: >> From: Namhyung Kim >> >> Most tracepoint events already have their system and event name in >> ->name field so that searching whole event tracing directory for each >> evsel to match given id is suboptimal. >> >> Cc: Jiri Olsa >> Cc: Frederic Weisbecker >> Signed-off-by: Namhyung Kim >> --- >> tools/perf/util/trace-event-info.c | 19 +++++++++++++++++++ >> 1 file changed, 19 insertions(+) >> >> diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c >> index ab18bf12d54a..dcfc1869c9af 100644 >> --- a/tools/perf/util/trace-event-info.c >> +++ b/tools/perf/util/trace-event-info.c >> @@ -414,12 +414,31 @@ get_tracepoints_path(struct list_head *pattrs) >> if (pos->attr.type != PERF_TYPE_TRACEPOINT) >> continue; >> ++nr_tracepoints; >> + >> + if (pos->name && strchr(pos->name, ':')) { >> + char *str = strchr(pos->name, ':'); >> + >> + ppath->next = zalloc(sizeof(path)); >> + if (!ppath->next) >> + goto error; >> + >> + ppath->next->system = strndup(pos->name, str - pos->name); >> + ppath->next->name = strdup(str+1); >> + >> + if (!ppath->next->system || !ppath->next->name) >> + goto error; >> + >> + goto next; >> + } > > good idea, could you please move this ^^^ into function ? > something like 'tracepoint_name_to_path' Will do! Thanks, Namhyung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/