Re: [PATCH v1 1/2] PM/runtime: introduce trace points for tracing rpm_* functions

From: Rafael J. Wysocki
Date: Tue Sep 27 2011 - 16:33:53 EST


On Tuesday, September 27, 2011, Steven Rostedt wrote:
> On Tue, 2011-09-27 at 22:29 +0200, Rafael J. Wysocki wrote:
> > On Tuesday, September 27, 2011, tom.leiming@xxxxxxxxx wrote:
> > > From: Ming Lei <ming.lei@xxxxxxxxxxxxx>
> > >
> > > This patch introduces 3 trace points to prepare for tracing
> > > rpm_idle/rpm_suspend/rpm_resume functions, so we can use these
> > > trace points to replace the current dev_dbg().
> > >
> > > Cc: Steven Rostedt rostedt@xxxxxxxxxxx
> > > Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>
> >
> > I get the following build warning from it:
> >
> > GEN /home/rafael/src/build/mainline/tosh/Makefile
> > CHK include/linux/version.h
> > Using /home/rafael/src/linux as source for kernel
> > CHK include/generated/utsrelease.h
> > CALL /home/rafael/src/linux/scripts/checksyscalls.sh
> > CHK include/generated/compile.h
> > CC drivers/base/power/runtime.o
> > CC kernel/trace/rpm-traces.o
> > In file included from /home/rafael/src/linux/include/trace/ftrace.h:296:0,
> > from /home/rafael/src/linux/include/trace/define_trace.h:96,
> > from /home/rafael/src/linux/include/trace/events/rpm.h:99,
> > from /home/rafael/src/linux/kernel/trace/rpm-traces.c:15:
> > /home/rafael/src/linux/include/trace/events/rpm.h: In function âftrace_raw_output_rpm_return_intâ:
> > /home/rafael/src/linux/include/trace/events/rpm.h:76:1: warning: format â%pâ expects type âvoid *â, but argument 3 has type âlong unsigned intâ
> >
> > Care to check?
> >
> > Rafael
>
> > > +TRACE_EVENT(rpm_return_int,
> > > + TP_PROTO(struct device *dev, unsigned long ip, int ret),
> > > + TP_ARGS(dev, ip, ret),
> > > +
> > > + TP_STRUCT__entry(
> > > + __string( name, dev_name(dev))
> > > + __field( unsigned long, ip )
> > > + __field( int, ret )
> > > + ),
> > > +
> > > + TP_fast_assign(
> > > + __assign_str(name, dev_name(dev));
> > > + __entry->ip = ip;
> > > + __entry->ret = ret;
> > > + ),
> > > +
> > > + TP_printk("%pS:%s ret=%d", __entry->ip, __get_str(name),
> > > + __entry->ret)
> > > +);
> > > +
>
>
> TP_printk("%pS:%s ret=%d", (void *)__entry->ip, __get_str(name),
> __entry->ret)
>
> try that.

Well, that certainly will work, but is it the right fix?

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/