Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB224C4363D for ; Thu, 24 Sep 2020 10:37:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C3152396E for ; Thu, 24 Sep 2020 10:37:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="iMyHKi8R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbgIXKha (ORCPT ); Thu, 24 Sep 2020 06:37:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:43480 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbgIXKh3 (ORCPT ); Thu, 24 Sep 2020 06:37:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1600943847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OvK7t9Loa7SNSd60wI7vWX6CBAYZcCl23YU7tpkB1ho=; b=iMyHKi8RgrsVu9diQmSB2XaPM5ssIH2ncGBdfVB5wZdjpXpk6orNWQDHqrT1Kc1urbGPNN 1TVnhgYnBtiDuCvjiUEVoHF475+C84DhtT6q8FUPoulteNRdzr2ZlrfytRQhyDy7FZLIMm ZmoaH2aPJNEVB6mFcoB2jKr94UkKgy0= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 87D57AC7D; Thu, 24 Sep 2020 10:38:05 +0000 (UTC) Date: Thu, 24 Sep 2020 12:37:26 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Thomas Gleixner , Prarit Bhargava , Mark Salyzyn , Chunyan Zhang , Orson Zhai , Changki Kim , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] printk: Store all three timestamps Message-ID: <20200924103726.GM6442@alley> References: <20200923135617.27149-1-pmladek@suse.com> <20200923135617.27149-2-pmladek@suse.com> <878sd0m4c3.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878sd0m4c3.fsf@jogness.linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2020-09-24 02:06:12, John Ogness wrote: > On 2020-09-23, Petr Mladek wrote: > > diff --git a/kernel/printk/printk_ringbuffer.h b/kernel/printk/printk_ringbuffer.h > > index 0adaa685d1ca..09082c8472d3 100644 > > --- a/kernel/printk/printk_ringbuffer.h > > +++ b/kernel/printk/printk_ringbuffer.h > > @@ -14,7 +15,7 @@ > > */ > > struct printk_info { > > u64 seq; /* sequence number */ > > - u64 ts_nsec; /* timestamp in nanoseconds */ > > + struct ktime_timestamps ts; /* timestamps */ > > Until now struct printk_info has contained generic types. If we add > struct ktime_timestamps, we may start storing more than we need. For > example, if more (possibly internal) fields are added to struct > ktime_timestamps that printk doesn't care about. We may prefer to > generically and explicitly store the information we care about: > > u64 ts_mono; > u64 ts_boot; > u64 ts_real; > > Or create our own struct printk_ts to copy the fields of interest to. I would like to have a structure if we have more timestamps. Honestly, printk-specific structure sounds like an overhead to me. How big is the chance that struct ktime_timestamps ts would get modified? It has been created for printk after all. That said, I could live with printk-specific structure. We might even need it if we need to store also local_clock(). Best Regards, Petr