From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Date: Fri, 07 Jan 2011 15:52:08 +0000 Subject: Re: [PATCH] tracing, perf : add cpu hotplug trace events Message-Id: <1294415528.26623.226.camel@gandalf.stny.rr.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Amit Kucheria Cc: Vincent Guittot , linux-kernel@vger.kernel.org, linux-hotplug@vger.kernel.org, fweisbec@gmail.com On Fri, 2011-01-07 at 14:51 +0530, Amit Kucheria wrote: > > + > > +TRACE_EVENT(hotplug_start, > > + > > + TP_PROTO(unsigned int type, unsigned int step, unsigned int cpuid), > > + > > + TP_ARGS(type, step, cpuid), > > + > > + TP_STRUCT__entry( > > + __field(u32, type) > > + __field(u32, step) > > + __field(u32, cpuid) > > + ), > > + > > + TP_fast_assign( > > + __entry->type = type; > > + __entry->step = step; > > + __entry->cpuid = cpuid; > > + ), > > + > > + TP_printk("type=%lu step=%lu cpuid=%lu", (unsigned long)__entry->type, > > + (unsigned long)__entry->step, (unsigned long)__entry->cpuid) > > +); > > + > > +TRACE_EVENT(hotplug_end, > > + > > + TP_PROTO(unsigned int type, unsigned int step, unsigned int cpuid), > > + > > + TP_ARGS(type, step, cpuid), > > + > > + TP_STRUCT__entry( > > + __field(u32, type) > > + __field(u32, step) > > + __field(u32, cpuid) > > + ), > > + > > + TP_fast_assign( > > + __entry->type = type; > > + __entry->step = step; > > + __entry->cpuid = cpuid; > > + ), > > + > > + TP_printk("type=%lu step=%lu cpuid=%lu", (unsigned long)__entry->type, > > + (unsigned long)__entry->step, (unsigned long)__entry->cpuid) > > +); > > + > > Please use classes when having tracepoints that have the same fields. This will save a bit of kernel memory. Something like: DECLARE_EVENT_CLASS(hotplug_template, TP_PROTO(unsigned int type, unsigned int step, unsigned int cpuid), TP_ARGS(type, step, cpuid), TP_STRUCT__entry( __field(u32, type) __field(u32, step) __field(u32, cpuid) ), TP_fast_assign( __entry->type = type; __entry->step = step; __entry->cpuid = cpuid; ), TP_printk("type=%lu step=%lu cpuid=%lu", (unsigned long)__entry->type, (unsigned long)__entry->step, (unsigned long)__entry->cpuid) ); DEFINE_EVENT(hotplug_template, hotplug_start, TP_PROTO(unsigned int type, unsigned int step, unsigned int cpuid), TP_ARGS(type, step, cpuid); DEFINE_EVENT(hotplug_template, hotplug_end, TP_PROTO(unsigned int type, unsigned int step, unsigned int cpuid), TP_ARGS(type, step, cpuid); -- Steve