[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87oba9y62a.fsf@sejong.aot.lge.com>
Date: Thu, 11 Jul 2013 15:16:45 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Jiri Olsa <jolsa@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
David Ahern <dsahern@...il.com>,
Thomas Renninger <trenn@...e.de>
Subject: Re: [PATCH 1/4] perf tools: Remove event types framework only user
Hi Jiri,
On Tue, 9 Jul 2013 18:48:56 +0200, Jiri Olsa wrote:
> The only user of the event types data is 'perf timechart'
> command and uses this info to identify proper tracepoints
> based on its name.
>
> Switching this code to use traceevent library API to obtain
> IDs for needed tracepoints. This should also make the samples
> processing faster as we no longer compare strings but numbers.
A better way I think is using tracepoint handlers. You don't need to
compare anything this way since an evsel can know its handler.
Please see perf_session__set_tracepoints_handlers() and builtin-
{kmem,lock,sched}.c.
[SNIP]
>
> -/*
> - * trace_flag_type is an enumeration that holds different
> - * states when a trace occurs. These are:
> - * IRQS_OFF - interrupts were disabled
> - * IRQS_NOSUPPORT - arch does not support irqs_disabled_flags
> - * NEED_RESCED - reschedule is requested
> - * HARDIRQ - inside an interrupt handler
> - * SOFTIRQ - inside a softirq handler
> - */
> -enum trace_flag_type {
> - TRACE_FLAG_IRQS_OFF = 0x01,
> - TRACE_FLAG_IRQS_NOSUPPORT = 0x02,
> - TRACE_FLAG_NEED_RESCHED = 0x04,
> - TRACE_FLAG_HARDIRQ = 0x08,
> - TRACE_FLAG_SOFTIRQ = 0x10,
> -};
Why did you remove this part? Isn't it used by elsewhere? Anyway, it
seems unrelated to this change.
[SNIP]
> +static int get_id(const char *sys, const char *name, u32 *id)
> +{
> + struct event_format *format;
> +
> + format = event_format__new(sys, name);
No. You need to access to tracepoints in the perf session data, not
ones in the current system. The perf_session__set_tracepoints_handlers()
deals with it correctly.
Thanks,
Namhyung
> + if (!format)
> + return -1;
> +
> + *id = format->id;
> + pevent_free_format(format);
> + return 0;
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists