- To: Steven Rostedt <rostedt@xxxxxxxxxxx>
- Subject: Re: [PATCHv3 5/5] cpuidle: coupled: add trace events
- From: Colin Cross <ccross@xxxxxxxxxxx>
- Date: Thu, 3 May 2012 14:13:27 -0700
- Cc: Kevin Hilman <khilman@xxxxxx>, Len Brown <len.brown@xxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Kay Sievers <kay.sievers@xxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, Amit Kucheria <amit.kucheria@xxxxxxxxxx>, linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx, Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>, Arnd Bergmann <arnd.bergmann@xxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
- Delivered-to: linux-pm@xxxxxxxxxxxxxxxxxxxxxxxx
- In-reply-to: <1336078827.14207.109.camel@gandalf.stny.rr.com>
- References: <1335816551-27756-1-git-send-email-ccross@android.com> <1335816551-27756-6-git-send-email-ccross@android.com> <1336078827.14207.109.camel@gandalf.stny.rr.com>
On Thu, May 3, 2012 at 2:00 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Mon, 2012-04-30 at 13:09 -0700, Colin Cross wrote:
>
>> diff --git a/include/trace/events/cpuidle.h b/include/trace/events/cpuidle.h
>> new file mode 100644
>> index 0000000..9b2cbbb
>> --- /dev/null
>> +++ b/include/trace/events/cpuidle.h
>> @@ -0,0 +1,243 @@
>> +#undef TRACE_SYSTEM
>> +#define TRACE_SYSTEM cpuidle
>> +
>> +#if !defined(_TRACE_CPUIDLE_H) || defined(TRACE_HEADER_MULTI_READ)
>> +#define _TRACE_CPUIDLE_H
>> +
>> +#include <linux/atomic.h>
>> +#include <linux/tracepoint.h>
>> +
>> +extern atomic_t cpuidle_trace_seq;
>> +
>> +TRACE_EVENT(coupled_enter,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_exit,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_spin,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_unspin,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_safe_enter,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_safe_exit,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_idle_enter,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_idle_exit,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_abort,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_detected_abort,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_poke,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>> +
>> +TRACE_EVENT(coupled_poked,
>> +
>> + TP_PROTO(unsigned int cpu),
>> +
>> + TP_ARGS(cpu),
>> +
>> + TP_STRUCT__entry(
>> + __field(unsigned int, cpu)
>> + __field(unsigned int, seq)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->cpu = cpu;
>> + __entry->seq = atomic_inc_return(&cpuidle_trace_seq);
>> + ),
>> +
>> + TP_printk("%u %u", __entry->seq, __entry->cpu)
>> +);
>
> Egad! Please use DECLARE_EVENT_CLASS() and DEFINE_EVENT() when adding
> events that are basically the same. Every TRACE_EVENT() can bloat the
> kernel by 5k, using the DEFINE_EVENT()s keeps each event around just a
> few hundred bytes.
>
> See include/trace/events/ext4.h for examples.
Thanks, I'll take a look. There is no mention in Documentation/ or
samples/ of DECLARE_EVENT_CLASS() or DEFINE_EVENT(), nor any mention
of the cost of TRACE_EVENT().
Looking at the new power tracing code, I will also rework these events
to be more similar to the existing ones.
I suggest skipping this patch for 3.5, and I'll post an updated one for 3.6.
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/linux-pm
[Netdev]
[Ethernet Bridging]
[Linux Wireless]
[CPU Freq]
[Kernel Newbies]
[Fedora Kernel]
[Security]
[Linux for Hams]
[Netfilter]
[Bugtraq]
[Photo]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux RAID]
[Linux Admin]
[Samba]
[Video 4 Linux]
[Linux Resources]
[Free Dating]
[Archives]