From: Steven Rostedt <rostedt@goodmis.org>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
John Stultz <john.stultz@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] tracing: timer: Add deferrable flag to timer_start
Date: Tue, 5 May 2015 23:11:05 -0400 [thread overview]
Message-ID: <20150505231105.64208924@grimm.local.home> (raw)
In-Reply-To: <1430880250-3003-1-git-send-email-Badhri@google.com>
On Tue, 5 May 2015 19:44:10 -0700
Badhri Jagan Sridharan <badhri@google.com> wrote:
> diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
> index 68c2c20..342d741 100644
> --- a/include/trace/events/timer.h
> +++ b/include/trace/events/timer.h
> @@ -43,15 +43,17 @@ DEFINE_EVENT(timer_class, timer_init,
> */
> TRACE_EVENT(timer_start,
>
> - TP_PROTO(struct timer_list *timer, unsigned long expires),
> + TP_PROTO(struct timer_list *timer,
> + unsigned long expires, char deferrable),
>
> - TP_ARGS(timer, expires),
> + TP_ARGS(timer, expires, deferrable),
>
> TP_STRUCT__entry(
> __field( void *, timer )
> __field( void *, function )
> __field( unsigned long, expires )
> __field( unsigned long, now )
> + __field( char, deferrable )
I wonder if we should use int instead of char. Although TIMER_DEFERRED
is defined as 0x1LU, and that tbase_get_deferrable() returns:
((unsigned int)(unsigned long)base & TIMER_DEFERRABLE);
It is still an int that is returned. If TIMER_DEFERRABLE becomes
something greater than 255, then that char wont be enough to hold it.
I'm being paranoid here, but you never know what changes may happen in
the future, and I rather be robust and safe. And trace events save in
4byte chunks anyway, so you wont be saving anything in the buffer by
making it a char.
-- Steve
> ),
>
> TP_fast_assign(
> @@ -59,11 +61,13 @@ TRACE_EVENT(timer_start,
> __entry->function = timer->function;
> __entry->expires = expires;
> __entry->now = jiffies;
> + __entry->deferrable = deferrable;
> ),
>
> - TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld]",
> + TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld] defer=%c",
> __entry->timer, __entry->function, __entry->expires,
> - (long)__entry->expires - __entry->now)
> + (long)__entry->expires - __entry->now,
> + __entry->deferrable > 0 ? 'y':'n')
> );
>
> /**
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 2ece3aa..e5588da 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -648,7 +648,8 @@ static inline void
> debug_activate(struct timer_list *timer, unsigned long expires)
> {
> debug_timer_activate(timer);
> - trace_timer_start(timer, expires);
> + trace_timer_start(timer, expires,
> + tbase_get_deferrable(timer->base));
> }
>
> static inline void debug_deactivate(struct timer_list *timer)
next prev parent reply other threads:[~2015-05-06 3:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-06 2:44 Badhri Jagan Sridharan
2015-05-06 3:11 ` Steven Rostedt [this message]
2015-05-07 23:20 Badhri Jagan Sridharan
2015-05-13 14:11 ` Steven Rostedt
2015-05-13 23:39 ` John Stultz
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=20150505231105.64208924@grimm.local.home \
--to=rostedt@goodmis.org \
--cc=badhri@google.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®