public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: rostedt@goodmis.org
Cc: mingo@redhat.com, hpa@zytor.com, mathieu.desnoyers@polymtl.ca,
	anton@samba.org, linux-kernel@vger.kernel.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:48:02 +0200	[thread overview]
Message-ID: <1255420082.8392.44.camel@twins> (raw)
In-Reply-To: <1255404309.7113.948.camel@gandalf.stny.rr.com>

On Mon, 2009-10-12 at 23:25 -0400, Steven Rostedt wrote:
> > +     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 :-(
> 
> Is there anyway we can change that TRACE_EVENT to give us a better,
> trace printk output?

LOL

Either convince tglx that ktime_t really ought to die for good (yeah, I
know arm), or specialize the whole printout for 32 vs 64 ktime_t.

union ktime {
        s64     tv64;
#if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR)
        struct {
# ifdef __BIG_ENDIAN
        s32     sec, nsec;
# else
        s32     nsec, sec;
# endif
        } tv;
#endif
};



  parent reply	other threads:[~2009-10-13  7:49 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
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 [this message]
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=1255420082.8392.44.camel@twins \
    --to=peterz@infradead.org \
    --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=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