From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751882AbdIMSa5 (ORCPT ); Wed, 13 Sep 2017 14:30:57 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:43593 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751153AbdIMSay (ORCPT ); Wed, 13 Sep 2017 14:30:54 -0400 X-Google-Smtp-Source: ADKCNb6Uf3y/kHvjVbF4gWBZYkjwt0d75XnBeY0XC25/39bGXUTd6K2/8D7x/3Q/Sd5tm0SY5q+0uA== Subject: Re: [PATCH 3/3 v11] printk: Add monotonic, boottime, and realtime timestamps To: Prarit Bhargava , linux-kernel@vger.kernel.org Cc: Jonathan Corbet , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , John Stultz , Thomas Gleixner , Stephen Boyd , Andrew Morton , Greg Kroah-Hartman , "Paul E. McKenney" , Christoffer Dall , Deepa Dinamani , Ingo Molnar , Joel Fernandes , Kees Cook , Peter Zijlstra , Geert Uytterhoeven , "Luis R. Rodriguez" , Nicholas Piggin , "Jason A. Donenfeld" , Olof Johansson , Josh Poimboeuf , linux-doc@vger.kernel.org References: <1504613201-23868-1-git-send-email-prarit@redhat.com> <1504613201-23868-4-git-send-email-prarit@redhat.com> From: Mark Salyzyn Message-ID: <0747f21a-c245-e0c6-0f31-52be307d8544@android.com> Date: Wed, 13 Sep 2017 11:30:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <1504613201-23868-4-git-send-email-prarit@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/05/2017 05:06 AM, Prarit Bhargava wrote: > printk.time=1/CONFIG_PRINTK_TIME=1 adds a unmodified local hardware clock > timestamp to printk messages. The local hardware clock loses time each > day making it difficult to determine exactly when an issue has occurred in > the kernel log, and making it difficult to determine how kernel and > hardware issues relate to each other in real time. > > Make printk output different timestamps by adding options for no > timestamp, the local hardware clock, the monotonic clock, the boottime > clock, and the real clock. Allow a user to pick one of the clocks by > using the printk.time kernel parameter. Output the type of clock in > /sys/module/printk/parameters/time so userspace programs can interpret the > timestamp. > > v2: Use peterz's suggested Kconfig options. Merge patchset together. > Fix i386 !CONFIG_PRINTK builds. > > v3: Fixed x86_64_defconfig. Added printk_time_type enum and > printk_time_str for better output. Added BOOTTIME clock functionality. > > v4: Fix messages, add additional printk.time options, and fix configs. > > v5: Renaming of structures, and allow printk_time_set() to > evaluate substrings of entries (eg: allow 'r', 'real', 'realtime'). From > peterz, make fast functions return 0 until timekeeping is initialized > (removes timekeeping_active & ktime_get_boot|real_log_ts() suggested by > tglx and adds ktime_get_real_offset()). Switch to a function pointer > for printk_get_ts() and reference fast functions. Make timestamp_sources enum > match choice options for CONFIG_PRINTK_TIME (adds PRINTK_TIME_UNDEFINED). > > v6: Define PRINTK_TIME_UNDEFINED for !CONFIG_PRINTK builds. Separate > timekeeping changes into separate patch. Minor include file cleanup. > > v7: Add default case to printk_set_timestamp() and add PRINTK_TIME_DEBUG > for users that want to set timestamp to different values during runtime. > Add jstultz' Kconfig to avoid defconfig churn. > > v8: Add CONFIG_PRINTK_TIME_DEBUG to allow timestamp runtime switching. > Rename PRINTK_TIME_DISABLE to PRINTK_TIME_DISABLED. Rename > printk_set_timestamp() to printk_set_ts_func(). Separate > printk_set_ts_func() and printk_get_first_ts() portions. Rename param > functions. Adjust configs, enum, and timestamp_sources_str to be 0-4. > Add mention realtime clock is UTC in Documentation. > > v9: Fix typo. Add __ktime_get_real_fast_ns_unsafe(). > > v10: Remove time parameter restrictions. > Ack and unit tested on Backport to 4.9. (you are missing the v11 respin comment, NBD) -- Mark