Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1609907
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe |
| Date | 2017-03-27 17:00 +0200 |
| Message-ID | <tpEhH-17e-15@gated-at.bofh.it> (permalink) |
| References | <tpnqx-5w1-5@gated-at.bofh.it> <tpz8l-5M6-9@gated-at.bofh.it> <tpzBp-66r-31@gated-at.bofh.it> <tpDYl-XG-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Mar 27, 2017 at 4:28 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 27 Mar 2017 11:55:52 +0200
> Arnd Bergmann <arnd@arndb.de> wrote:
>
>> On Mon, Mar 27, 2017 at 11:25 AM, kbuild test robot <lkp@intel.com> wrote:
>> > Hi Deepa,
>> >
>> > [auto build test WARNING on tip/perf/core]
>> > [also build test WARNING on v4.11-rc4 next-20170327]
>> > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>> >
>> > url: https://github.com/0day-ci/linux/commits/Deepa-Dinamani/trace-Make-trace_hwlat-timestamp-y2038-safe/20170327-150010
>> > config: x86_64-randconfig-n0-03271517 (attached as .config)
>> > compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
>> > reproduce:
>> > # save the attached .config to linux build tree
>> > make ARCH=x86_64
>> >
>> > All warnings (new ones prefixed by >>):
>> >
>> > kernel/trace/trace_output.c: In function 'trace_hwlat_print':
>> >>> kernel/trace/trace_output.c:1168:5: warning: format '%lld' expects argument of type 'long long int', but argument 6 has type '__kernel_time_t' [-Wformat=]
>> > field->timestamp.tv_nsec);
>>
>> This happens on 64-bit architectures because 'struct timespec64' is defined to
>> be equal to 'struct timespec', which has a 'long' tv_sec rather than
>> 'long long'.
>>
>> A cast to 's64' is probably the best workaround.
>>
>> > kernel/trace/trace_output.c: In function 'trace_hwlat_raw':
>> > kernel/trace/trace_output.c:1202:5: warning: format '%lld' expects argument of type 'long long int', but argument 5 has type '__kernel_time_t' [-Wformat=]
>> > field->seqnum);
>>
>> Same here.
>>
>
> Actually, I believe that "%zd" will work. It's made to work with size_t
> which is long long on 32 and long on 64.
size_t is always 'long', not 'long long'. We have %pad for dma_addr_t
which may be 'long' or 'long long', but it is configuration dependent
which one it is on 32-bit.
We could probably introduce a %pts format string for timespec64
and have that pretty-printed.
Arnd
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] trace: Make trace_hwlat timestamp y2038 safe Deepa Dinamani <deepa.kernel@gmail.com> - 2017-03-26 23:00 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe kbuild test robot <lkp@intel.com> - 2017-03-27 11:30 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Arnd Bergmann <arnd@arndb.de> - 2017-03-27 12:00 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Steven Rostedt <rostedt@goodmis.org> - 2017-03-27 16:40 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Arnd Bergmann <arnd@arndb.de> - 2017-03-27 17:00 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Arnd Bergmann <arnd@arndb.de> - 2017-03-27 17:40 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Steven Rostedt <rostedt@goodmis.org> - 2017-03-27 18:20 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Steven Rostedt <rostedt@goodmis.org> - 2017-03-27 17:40 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Deepa Dinamani <deepa.kernel@gmail.com> - 2017-03-27 23:10 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe Arnd Bergmann <arnd@arndb.de> - 2017-03-28 09:30 +0200
Re: [PATCH] trace: Make trace_hwlat timestamp y2038 safe kbuild test robot <lkp@intel.com> - 2017-03-27 12:10 +0200
csiph-web