Re: [PATCH] tracing, perf : add cpu hotplug trace events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux