All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <abelloni@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Baolin Wang <baolin.wang@linaro.org>,
	a.zummo@towertech.it, mingo@redhat.com,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	arnd@arndb.de, broonie@kernel.org
Subject: Re: [PATCH v3] rtc: Add tracepoints for RTC system
Date: Thu, 14 Dec 2017 19:34:34 +0100	[thread overview]
Message-ID: <20171214183434.GE2559@piout.net> (raw)
In-Reply-To: <20171214124912.3171dafd@gandalf.local.home>

Hi Steve,

(Writing from my @kernel.org email to ensure you receive it)

On 14/12/2017 at 12:49:12 -0500, Steven Rostedt wrote:
> On Thu, 14 Dec 2017 13:31:43 +0800
> Baolin Wang <baolin.wang@linaro.org> wrote:
> 
> 
> > @@ -53,6 +56,8 @@ int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm)
> >  
> >  	err = __rtc_read_time(rtc, tm);
> >  	mutex_unlock(&rtc->ops_lock);
> > +
> > +	trace_rtc_read_time(rtc_tm_to_time64(tm), err);
> 
> There's a possibility that gcc may put the call to rt_tm_to_time64()
> outside the tracepoint area that gets nop'd out. Could you just pass in
> the tm to the tracepoint, and have the call to rtc_tm_to_time64() done
> within the TP_fast_assign? This would guarantee that we don't incur
> overhead when tracing is off.
> 

Actually, I've asked for that as rtc_time64_to_tm is really heavier than
rtc_tm_to_time64 and both set_time and set_alarm will soon have a call
to rtc_tm_to_time64 anyway. read_time and read_alarm will probably end
up having one in the long term too.

> > diff --git a/include/trace/events/rtc.h b/include/trace/events/rtc.h
> > new file mode 100644
> > index 0000000..621333f
> > --- /dev/null
> > +++ b/include/trace/events/rtc.h
> > @@ -0,0 +1,206 @@
> > +#undef TRACE_SYSTEM
> > +#define TRACE_SYSTEM rtc
> > +
> > +#if !defined(_TRACE_RTC_H) || defined(TRACE_HEADER_MULTI_READ)
> > +#define _TRACE_RTC_H
> > +
> > +#include <linux/rtc.h>
> > +#include <linux/tracepoint.h>
> > +
> > +DECLARE_EVENT_CLASS(rtc_time_alarm_class,
> > +
> > +	TP_PROTO(time64_t secs, int err),
> > +
> > +	TP_ARGS(secs, err),
> > +
> > +	TP_STRUCT__entry(
> > +		__field(time64_t, secs)
> > +		__field(int, err)
> > +	),
> > +
> > +	TP_fast_assign(
> > +		__entry->secs = secs;
> > +		__entry->err = err;
> > +	),
> > +
> > +	TP_printk("UTC (%lld) (%d)",
> > +		  __entry->secs, __entry->err

Can't TP_printk do the rtc_time64_to_tm conversion to pretty print the
date? Or do we have to implement it in vsprintf?

-- 
Alexandre Belloni

  reply	other threads:[~2017-12-14 18:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  5:31 [PATCH v3] rtc: Add tracepoints for RTC system Baolin Wang
2017-12-14 17:49 ` Steven Rostedt
2017-12-14 18:34   ` Alexandre Belloni [this message]
2018-02-13 20:31 ` Alexandre Belloni

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=20171214183434.GE2559@piout.net \
    --to=abelloni@kernel.org \
    --cc=a.zummo@towertech.it \
    --cc=arnd@arndb.de \
    --cc=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.