Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1661706
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt |
| Date | 2017-06-08 23:30 +0200 |
| Message-ID | <tQdaa-14l-11@gated-at.bofh.it> (permalink) |
| References | (4 earlier) <tQ7eq-5TV-11@gated-at.bofh.it> <tQ9SV-7ln-9@gated-at.bofh.it> <tQaFj-7QA-3@gated-at.bofh.it> <tQaFj-7QA-1@gated-at.bofh.it> <tQcxs-CA-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jun 8, 2017 at 11:42 PM, Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
> On Thu, Jun 08 2017, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>> On Thu, Jun 8, 2017 at 9:41 PM, Alexandre Belloni
>> <alexandre.belloni@free-electrons.com> wrote:
>>> On 08/06/2017 at 20:57:05 +0300, Andy Shevchenko wrote:
>>>> On Thu, Jun 8, 2017 at 6:05 PM, Alexandre Belloni
>>>> <alexandre.belloni@free-electrons.com> wrote:
>> Yeah, but the problem is to pass the reference. All dances around will
>> uglify the code.
>> (Obviously we can't pass timespec64/time64_t or anything longer than
>> 32 bits as is in %p extension)
> I like that this gets rid of some mm/dd/yy and other more or less random
> format and ends up standardizing yyyy-mm-dd HH:MM:SS. However, I do
> think %pt should take either ktime_t or timespec64 (obviously by
> reference),
I will try to look in this direction.
> with fx these options
>
> [ir] ISO (yyyy-mm-dd HH:MM:SS) or raw (seconds since epoch)
> [n] append nanoseconds (.%09ld).
We still need to be able to print time *and/or* year groups
separately. There are users which provide that via procfs or sysfs
(ABI).
> Please don't give people the option of eliding either the time or the
> date; I've spent too much time dealing with syslog files that don't
> include the year in the timestamps.
I understand that, but see above.
> Getting a timespec64* or ktime_t* from <something else> is not that
> bad. There's the compound literal option
Will look at it later, thanks for it.
>
> #define rtc_tm2timespec64p(tm) \
> (&(struct timespec64){ .tv_sec = rtc_tm_to_time64(tm), .tv_nsec = 0 })
>
> printk("%pt", rtc_tm2timespec64p(tm))
>
> or the two-extra-lines per call-site
>
> struct timespec64 ts;
> rtc_tm2time64(tm, &ts)
> printk("%pt", &ts)
--
With Best Regards,
Andy Shevchenko
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-06-08 15:50 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Arnd Bergmann <arnd@arndb.de> - 2017-06-08 16:50 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 17:00 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-06-08 17:10 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 20:00 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 20:50 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2017-06-08 22:50 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 23:30 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Arnd Bergmann <arnd@arndb.de> - 2017-06-08 23:50 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-06-08 20:50 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Arnd Bergmann <arnd@arndb.de> - 2017-06-08 17:40 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Joe Perches <joe@perches.com> - 2017-06-08 17:50 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-08 20:10 +0200
Re: [PATCH v1 04/25] lib/vsprintf: Print time and date in human readable format via %pt Joe Perches <joe@perches.com> - 2017-06-09 01:10 +0200
csiph-web