Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751665AbdDHCRH (ORCPT ); Fri, 7 Apr 2017 22:17:07 -0400 Received: from mail-io0-f173.google.com ([209.85.223.173]:34467 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbdDHCQ4 (ORCPT ); Fri, 7 Apr 2017 22:16:56 -0400 MIME-Version: 1.0 In-Reply-To: <20170407213011.36e29f42@gandalf.local.home> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-3-git-send-email-deepa.kernel@gmail.com> <20170407213011.36e29f42@gandalf.local.home> From: Deepa Dinamani Date: Fri, 7 Apr 2017 19:16:54 -0700 Message-ID: Subject: Re: [PATCH 02/12] trace: Make trace_hwlat timestamp y2038 safe To: Steven Rostedt Cc: Linux Kernel Mailing List , Andrew Morton , Thomas Gleixner , Alexander Viro , Greg KH , andreas.dilger@intel.com, Arnd Bergmann , "J. Bruce Fields" , Chris Mason , "David S. Miller" , David Sterba , Evgeniy Dushistov , Eric Paris , Jaegeuk Kim , Josef Bacik , Jeff Layton , John Stultz , James Simmons , Ingo Molnar , oleg.drokin@intel.com, Paul Moore , yuchao0@huawei.com, ceph-devel , devel@driverdev.osuosl.org, linux-audit@redhat.com, linux-btrfs , linux-cifs@vger.kernel.org, "Linux F2FS DEV, Mailing List" , Linux FS-devel Mailing List , linux-mtd , LSM List , lustre-devel@lists.lustre.org, Linux Network Devel Mailing List , samba-technical@lists.samba.org, y2038 Mailman List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1000 Lines: 31 >> - 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