[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1294415528.26623.226.camel@gandalf.stny.rr.com>
Date:	Fri, 07 Jan 2011 10:52:08 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Amit Kucheria <amit.kucheria@...aro.org>
Cc:	Vincent Guittot <vincent.guittot@...aro.org>,
	linux-kernel@...r.kernel.org, linux-hotplug@...r.kernel.org,
	fweisbec@...il.com
Subject: Re: [PATCH] tracing, perf : add cpu hotplug trace events
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
--
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