* [PATCH 4/4] time: rtc-lib: Add CONFIG_RTC_SHOW_TIME_RTC
@ 2017-07-19 19:50 Mark Salyzyn
2017-07-20 8:26 ` Pavel Machek
0 siblings, 1 reply; 3+ messages in thread
From: Mark Salyzyn @ 2017-07-19 19:50 UTC (permalink / raw)
To: linux-kernel
Cc: rjw, len.brown, pavel, linux-pm, a.zummo, alexandre.belloni,
linux-rtc, prarit, andy.shevchenko, Mark Salyzyn,
Paul E. McKenney
Add an option to report REALTIME in RTC time format for
rtc_show_time() function.
Feature activated by CONFIG_RTC_SHOW_TIME_RTC.
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
---
kernel/time/Kconfig | 17 +++++++++++++++++
kernel/time/rtc_show_time.c | 12 ++++++++++++
2 files changed, 29 insertions(+)
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 2dc891056635..3c2920b8825c 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -221,4 +221,21 @@ choice
continues, and the timestamps help re-orient post-analysis.
Print boottime <s>.<ns> timestamp in rtc_show_time
+ config RTC_SHOW_TIME_RTC
+ bool "realtime in wall clock format"
+ select RTC_SHOW_TIME
+ select RTC_LIB
+ help
+ Activate optional rtc_show_time(const char *msg) wall clock
+ time instrumentation.
+
+ The primary use of the instrumentation is to aid field
+ analysis of Battery and Power usage. The instrumentation
+ may also help triage and synchronize kernel logs and user
+ space activity logs at key displacements. For instance
+ CLOCK_MONOTONIC stops while suspended, while CLOCK_REALTIME
+ continues, and the timestamps help re-orient post-analysis.
+
+ Print realtime YYYY-MM-DD hh:mm:ss.<ns> timestamp in
+ rtc_show_time.
endchoice
diff --git a/kernel/time/rtc_show_time.c b/kernel/time/rtc_show_time.c
index 6c7b8ae6be0c..d861a30aef77 100644
--- a/kernel/time/rtc_show_time.c
+++ b/kernel/time/rtc_show_time.c
@@ -24,9 +24,21 @@ void rtc_show_time(const char *prefix_msg)
struct timespec64 ts;
getnstimeofday64(&ts);
+#if defined(CONFIG_RTC_SHOW_TIME_RTC)
+ {
+ struct rtc_time tm;
+
+ rtc_time64_to_tm(ts.tv_sec, &tm);
+ pr_info("%s %d-%02d-%02d %02d:%02d:%02d.%09lu UTC\n",
+ prefix_msg ? prefix_msg : "Time:",
+ tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec);
+ }
+#else
pr_info("%s %lu.%09lu UTC\n",
prefix_msg ? prefix_msg : "Time:", ts.tv_sec, ts.tv_nsec);
#endif
+#endif
}
EXPORT_SYMBOL(rtc_show_time);
--
2.14.0.rc0.284.gd933b75aa4-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 4/4] time: rtc-lib: Add CONFIG_RTC_SHOW_TIME_RTC
2017-07-19 19:50 [PATCH 4/4] time: rtc-lib: Add CONFIG_RTC_SHOW_TIME_RTC Mark Salyzyn
@ 2017-07-20 8:26 ` Pavel Machek
2017-07-20 17:52 ` Mark Salyzyn
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2017-07-20 8:26 UTC (permalink / raw)
To: Mark Salyzyn
Cc: linux-kernel, rjw, len.brown, linux-pm, a.zummo,
alexandre.belloni, linux-rtc, prarit, andy.shevchenko,
Paul E. McKenney
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
> +#if defined(CONFIG_RTC_SHOW_TIME_RTC)
> + {
> + struct rtc_time tm;
> +
> + rtc_time64_to_tm(ts.tv_sec, &tm);
> + pr_info("%s %d-%02d-%02d %02d:%02d:%02d.%09lu UTC\n",
> + prefix_msg ? prefix_msg : "Time:",
> + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
> + tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec);
> + }
> +#else
This was NAKed before. Are you even listening, or are you trying to
flood us with enough mail so that someone applies your patches by
mistake?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 4/4] time: rtc-lib: Add CONFIG_RTC_SHOW_TIME_RTC
2017-07-20 8:26 ` Pavel Machek
@ 2017-07-20 17:52 ` Mark Salyzyn
0 siblings, 0 replies; 3+ messages in thread
From: Mark Salyzyn @ 2017-07-20 17:52 UTC (permalink / raw)
To: Pavel Machek
Cc: linux-kernel, rjw, len.brown, linux-pm, a.zummo,
alexandre.belloni, linux-rtc, prarit, andy.shevchenko,
Paul E. McKenney
On 07/20/2017 01:26 AM, Pavel Machek wrote:
>> +#if defined(CONFIG_RTC_SHOW_TIME_RTC)
>> + {
>> + struct rtc_time tm;
>> +
>> + rtc_time64_to_tm(ts.tv_sec, &tm);
>> + pr_info("%s %d-%02d-%02d %02d:%02d:%02d.%09lu UTC\n",
>> + prefix_msg ? prefix_msg : "Time:",
>> + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
>> + tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec);
>> + }
>> +#else
>
> This was NAKed before. Are you even listening, or are you trying to
> flood us with enough mail so that someone applies your patches by
> mistake?
> Pavel
It was NAKed in the group, I put it aside in its own patch to keep from
throwing out the baby with the bathwater. Was hoping that a private
CONFIG_RTC_SHOW_TIME_RTC would be acceptable.
I guess not, topic is dead. A refresh is being tested that addresses
many of the other concerns.
-- Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-20 17:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19 19:50 [PATCH 4/4] time: rtc-lib: Add CONFIG_RTC_SHOW_TIME_RTC Mark Salyzyn
2017-07-20 8:26 ` Pavel Machek
2017-07-20 17:52 ` Mark Salyzyn
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.