Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp847823imm; Thu, 31 May 2018 10:23:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIIbZt2B2BdvXiY0llI7etnsxRKnwDNTMDHRmfJYLsHbYkmcnk3/a4tRXweXvntfMpH0WGx X-Received: by 2002:a63:7f4e:: with SMTP id p14-v6mr6158319pgn.27.1527787432525; Thu, 31 May 2018 10:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527787432; cv=none; d=google.com; s=arc-20160816; b=F6SKxDdUkzvPLafTRGcdKwNJ3mFYo50b2wK3reNAPcPNKl3DfqoAr3PD0V/UxqXfkc 3JSDOymrXzDJqyDNmJTvklwnCBBZJYzwO+FnkFy0qc/02p5OuAe54At4VLQS+ZHsv/oO XhTdeWU85Bh0OiSXsW6Jt9DvCqnH2HdfKPXqrJfoaUjK5KRnIHgrDr9pG7R6NA9AVUSC 7CAgCR0VTA9Qw+53wXu2A+B+CacuS85+D9jxEPh3NMPRCSEdMl52esbhAGkltgPl+EIW kiWcOj0PCkeE0g2TxKSzttr5k6Za9hrQMJ59TiARDI6NcDPmJFvTttnuwMkZidmatkUx D5Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=e0yt7L+OsANj/xV81DjK4oz8ZvWGpNp6foztDOiVOwI=; b=YZTzbukhpp0YkfFljHV22U+WAGts04Bp18iUkZRJ3fBmJL7niAflOHGF1xt+Mll7hi 96p0gEYKfJEntAs1ILmL71l6pMpIeraXpWqONvFwU7de4dCwecfHK6mm4R2sLW3uMx8/ PK31TbYeh1YzM4vL4lmwnyVH+qmgj4incCPlgZ8ark2Zd/eK5pGsZtm7p6LfRgCjqzy7 uE4jdIH/fz7XI/hyyPCfnFtiXj1ihuUUe5+1AsSFmA7pk8HgTJGws0zazq1O6W5rHxYM pkWyjN7bcGQNAfUbg9ioau3tLmY7wOa26boonkLlKVMbXrCYRBTt1bSG7i0pQbjot9Vh 64Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZHIo8iJr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4-v6si29987842pgc.190.2018.05.31.10.23.37; Thu, 31 May 2018 10:23:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZHIo8iJr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755877AbeEaRXF (ORCPT + 99 others); Thu, 31 May 2018 13:23:05 -0400 Received: from merlin.infradead.org ([205.233.59.134]:44994 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755556AbeEaRXE (ORCPT ); Thu, 31 May 2018 13:23:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=e0yt7L+OsANj/xV81DjK4oz8ZvWGpNp6foztDOiVOwI=; b=ZHIo8iJrIZjv+09U+ffn96QWSt vZpW1QhhjNuu7XsF+5vAi2PNv4pSgAlEZX1WjihXmwkSmsbZPWROWgzNwUA6ulnm+HkqWdcEWRpyu Q4FF7yScnERurndO6dFwU6kI25fXf7MxGe8qlFkI3OqkHEYA1NfF3Ed70x1X2uaxAVTEZFV6e6fsI 6nJycmrosYAcLzpFw4L2A8nELaxH36ykW2wlzabhaAvTiRhgUJPFoGc3NXGZSK/zx2bTDZzeJJyxP TrhU5jnfFcfB2+ENwRT3lU3lKKlGHXl4axCPBtqXjUPrajw3Z7je8cP8luZveTYySfC2w+NY9GSEo hotnNONg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fORHr-0007mh-K1; Thu, 31 May 2018 17:22:56 +0000 Subject: Re: [RFC 1/2] printk: Enable platform to provide a early boot clock To: Andy Shevchenko , Feng Tang Cc: Petr Mladek , Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" , Alan Cox , Peter Zijlstra , Linux Kernel Mailing List , alek.du@intel.com References: <1527672059-6225-1-git-send-email-feng.tang@intel.com> From: Randy Dunlap Message-ID: Date: Thu, 31 May 2018 10:22:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/31/2018 12:18 AM, Andy Shevchenko wrote: > On Wed, May 30, 2018 at 12:20 PM, Feng Tang wrote: >> Currently printk timestamp mostly come from the sched_clock which >> depends on the clock setup, so there are many kernel logs started >> with "[ 0.000000] " before the clock is calibrated. >> >> This patch will provide an debug option for specific platform to >> provide a early boot time clock, so that we can have time info in >> kernel log much earlier, which can show the time info for the early >> kernel boot, and make boottime tuning/optimization easier (boot time >> is critical for phone/tablet and embedded devices). >> >> Capable platform only need to setup the "boot_printk_clock_fn" >> which could return time in nano seconds. >> >> Together with a TSC patch on x86 system, we have easily captured >> some early boottime killer like unwind_init() which takes about >> 300ms in boot phase. > >> +static u64 printk_clock(void) >> +{ >> + /* If platform provides early boot printk clock, then use it */ >> + if (unlikely(system_state == SYSTEM_BOOTING && boot_printk_clock_fn)) >> + return boot_printk_clock_fn(); >> + else >> + return local_clock(); > > 'else' is redundant. So it is. Is this a style comment? This shouldn't matter to a smart compiler, should it? >> +} thanks, -- ~Randy