Thread (36 messages) 36 messages, 8 authors, 2017-06-04

Re: [PATCH 02/12] trace: Make trace_hwlat timestamp y2038 safe

From: Deepa Dinamani <hidden>
Date: 2017-04-08 02:16:56
Also in: ceph-devel, linux-btrfs, linux-cifs, linux-f2fs-devel, linux-fsdevel, linux-security-module, lkml

quoted
-     trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%ld.%09ld",
+     trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%lld.%09ld",
                       field->seqnum,
                       field->duration,
                       field->outer_duration,
-                      field->timestamp.tv_sec,
+                      (long long)field->timestamp.tv_sec,
Refresh my memory. We need the cast because on 64 bit boxes
timestamp.tv_sec is just a long?
This is only required until we change the definition of timespec64.
Right now it is defined as

#if __BITS_PER_LONG == 64
# define timespec64 timespec
#else
struct timespec64 {
    time64_t tv_sec;
    long tv_nsec;
};
#endif

And timespec.tv_sec is just long int on 64 bit machines.
This is why we need the cast now.

We will probably change this and only define __kernel_timespec instead
of timespec, leaving only one definition of timespec64.
At that time, we will not need this.

-Deepa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help