public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mingo@redhat.com, hpa@zytor.com, mathieu.desnoyers@polymtl.ca,
	anton@samba.org, linux-kernel@vger.kernel.org,
	peterz@infradead.org, zhaolei@cn.fujitsu.com,
	xiaoguangrong@cn.fujitsu.com, fweisbec@gmail.com,
	tglx@linutronix.de, kosaki.motohiro@jp.fujitsu.com,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:timers/tracing] hrtimer: Add tracepoint for hrtimers
Date: Tue, 13 Oct 2009 09:08:53 +0200	[thread overview]
Message-ID: <20091013070853.GA13175@elte.hu> (raw)
In-Reply-To: <1255404309.7113.948.camel@gandalf.stny.rr.com>


* Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 2009-09-02 at 12:18 +0000, tip-bot for Xiao Guangrong wrote:
> 
> > +/**
> > + * hrtimer_start - called when the hrtimer is started
> > + * @timer: pointer to struct hrtimer
> > + */
> > +TRACE_EVENT(hrtimer_start,
> > +
> > +	TP_PROTO(struct hrtimer *timer),
> > +
> > +	TP_ARGS(timer),
> > +
> > +	TP_STRUCT__entry(
> > +		__field( void *,	timer		)
> > +		__field( void *,	function	)
> > +		__field( s64,		expires		)
> > +		__field( s64,		softexpires	)
> > +	),
> > +
> > +	TP_fast_assign(
> > +		__entry->timer		= timer;
> > +		__entry->function	= timer->function;
> > +		__entry->expires	= hrtimer_get_expires(timer).tv64;
> > +		__entry->softexpires	= hrtimer_get_softexpires(timer).tv64;
> > +	),
> > +
> > +	TP_printk("hrtimer %p, func %pf, expires %llu, softexpires %llu",
> > +		  __entry->timer, __entry->function,
> > +		  (unsigned long long)ktime_to_ns((ktime_t) {
> > +				  .tv64 = __entry->expires }),
> > +		  (unsigned long long)ktime_to_ns((ktime_t) {
> > +				  .tv64 = __entry->softexpires }))
> > +);
> > +
> 
> I was just fixing up the trace-cmd parser (which is also used for perf)
> and came across this code. That TP_printk shows up in the format file
> as:
> 
> print fmt: "hrtimer %p, func %pf, expires %llu, softexpires %llu", REC->timer, REC->function, (unsigned long long)(((ktime_t) { .tv64 = REC->expires }).tv64), (unsigned long long)(((ktime_t) { .tv64 = REC->softexpires }).tv64)
> 
> Now I'm trying to parse this with a tool so that we can have something
> that can read the binary output, and be able to easily figure it out by
> reading the format files. But trying to parse:
> 
> (unsigned long long)(((ktime_t) { .tv64 = REC->expires }).tv64)
> 
> Is not easy. It's basically implementing a C interpreter :-(

Btw., what i suggested quite some time ago was that we should bind 
tracepoints by emitting C source code stubs, which tools can then build 
and link in, using gcc.

	Ingo

  reply	other threads:[~2009-10-13  7:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-10  2:48 [PATCH v6 1/3] ftrace: add tracepoint for timer Xiao Guangrong
2009-08-10  2:51 ` [PATCH v6 2/3] ftrace: add tracepoint for hrtimer Xiao Guangrong
2009-09-02 12:18   ` [tip:timers/tracing] hrtimer: Add tracepoint for hrtimers tip-bot for Xiao Guangrong
2009-10-13  3:25     ` Steven Rostedt
2009-10-13  7:08       ` Ingo Molnar [this message]
2009-10-13 13:17         ` Steven Rostedt
2009-10-13 13:18           ` Steven Rostedt
2009-10-13 13:26           ` Ingo Molnar
2009-10-13 14:02             ` Steven Rostedt
2009-10-13 15:35               ` [RFC] Trace types registry Mathieu Desnoyers
2009-10-13 18:41               ` [tip:timers/tracing] hrtimer: Add tracepoint for hrtimers Ingo Molnar
2009-10-13 18:56                 ` Steven Rostedt
2009-10-13  7:48       ` Peter Zijlstra
2009-08-10  2:52 ` [PATCH v6 3/3] ftrace: add tracepoint for itimer Xiao Guangrong
2009-09-02 12:18   ` [tip:timers/tracing] itimers: Add tracepoints " tip-bot for Xiao Guangrong
2009-09-02 12:18 ` [tip:timers/tracing] timers: Add tracepoints for timer_list timers tip-bot for Xiao Guangrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091013070853.GA13175@elte.hu \
    --to=mingo@elte.hu \
    --cc=anton@samba.org \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=xiaoguangrong@cn.fujitsu.com \
    --cc=zhaolei@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox