From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759301Ab3EOO7c (ORCPT ); Wed, 15 May 2013 10:59:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55861 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758979Ab3EOO7b (ORCPT ); Wed, 15 May 2013 10:59:31 -0400 Date: Wed, 15 May 2013 16:59:10 +0200 From: Jiri Olsa To: Namhyung Kim 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/15] perf util: Use evsel->name to get tracepoint_paths Message-ID: <20130515145910.GA2194@krava.brq.redhat.com> References: <1368526439-31966-1-git-send-email-namhyung@kernel.org> <1368526439-31966-3-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1368526439-31966-3-git-send-email-namhyung@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 14, 2013 at 07:13:46PM +0900, Namhyung Kim wrote: > From: Namhyung Kim SNIP > }; > > extern struct tracepoint_path *tracepoint_id_to_path(u64 config); > +extern struct tracepoint_path *tracepoint_name_to_path(const char *name); > extern bool have_tracepoints(struct list_head *evlist); > > const char *event_type(int type); > diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c > index ab18bf12d54a..bfcaeac7ef9d 100644 > --- a/tools/perf/util/trace-event-info.c > +++ b/tools/perf/util/trace-event-info.c > @@ -414,12 +414,23 @@ get_tracepoints_path(struct list_head *pattrs) > if (pos->attr.type != PERF_TYPE_TRACEPOINT) > continue; > ++nr_tracepoints; > + > + if (pos->name) { > + ppath->next = tracepoint_name_to_path(pos->name); yep, looks like big time saver ;) > + if (!ppath->next) > + goto error; hum, the tracepoint_name_to_path fails also because of the malformed tracepoint name.. then the error message is misleading.. but not quite sure this could happen jirka > + > + goto next; > + } > + > ppath->next = tracepoint_id_to_path(pos->attr.config); > if (!ppath->next) { > +error: > pr_debug("No memory to alloc tracepoints list\n"); > put_tracepoints_path(&path); > return NULL; > } > +next: > ppath = ppath->next; > } > > -- > 1.7.11.7 >