lkml.org 
[lkml]   [2013]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 02/14] perf util: Use evsel->name to get tracepoint_paths
Date
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 <namhyung.kim@lge.com>
>>
>> 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 <jolsa@redhat.com>
>> Cc: Frederic Weisbecker <fweisbec@gmail.com>
>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>> ---
>> 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


\
 
 \ /
  Last update: 2013-04-25 08:21    [W:0.192 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site