Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1664622imm; Thu, 14 Jun 2018 01:37:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwbHL4lYB06Q3Dhvb1KO2kW2dndrxTx1GXQTHw9iRJ3y1bAi5mEN2qzuFXWR9xIzPQZdyr X-Received: by 2002:a17:902:6f0f:: with SMTP id w15-v6mr1942035plk.216.1528965479859; Thu, 14 Jun 2018 01:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528965479; cv=none; d=google.com; s=arc-20160816; b=Efym/gS8ngyJpwdRXEzUgOfXecRUS4tn/8eZPwuWMmR2eVahNkZY994laJp9D/eeYi kEtKbeENnP2EPbI/6U6hhwBSQy+Qp3ds1q84X3ZxzCSfolEPXx/kw3mvJqe4x+nXo3LO F5zYcPcuds2+UAH6czRoVZpCbQ1BLJHwbkQgTrGhvmVMjcXimnAhYuPjhw6ivIN+xWka Ev9AiWDkznV6LXUU1pTMGwrokVAo45wuo+0UuEdlvjj3Hb6zwekcS1liVMDQaepwZZlL dKu3yprlOC+tO5E5+dR2OsLauty5vzSSlEus58ymovi7U2evPxGxJSFB6Ayr5nFhR9k4 KAQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=1swLrSy1szLplTOEuLKpwUCQYd7GT1J/X1mhKTKScO8=; b=I0AGI+dYPAJAByWJ1/y6AJ19lxT1cJkFZS3Uq+YWb1oa8j5uC3FwzW/Zh56fwEyH3p gVY1mLehxa5VCUyNdVpXYr8a+DZMrTA7CIU3L58GGlZAXvzPJ+R2nrmq4sIIT+E+RSRz 1L9/4keXrwpJT77NHFal8cvNa5Vu0XOyFwkMTHKhC32JtTClT2XIfgNwX0LQ2DYUBPnX FVExiZYpNGhAh8v07I7+PkkKQD+e1vPsPtzDciZXxv1kg8Y0G1DAZRGZwmsCNb/ks7Kg iC3p2HOQmf8kl3qMYvgOZFCtt/rVV0obMIu3qG8bq8TjxDNEUZV//oBnvaMHoIECCIvJ 1YLw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24-v6si3969003pgn.194.2018.06.14.01.37.45; Thu, 14 Jun 2018 01:37:59 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754928AbeFNIgz (ORCPT + 99 others); Thu, 14 Jun 2018 04:36:55 -0400 Received: from mga06.intel.com ([134.134.136.31]:25568 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754540AbeFNIgw (ORCPT ); Thu, 14 Jun 2018 04:36:52 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jun 2018 01:36:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,222,1526367600"; d="scan'208";a="49819201" Received: from shbuild888.sh.intel.com (HELO localhost) ([10.239.146.239]) by orsmga006.jf.intel.com with ESMTP; 14 Jun 2018 01:36:49 -0700 Date: Thu, 14 Jun 2018 16:38:51 +0800 From: Feng Tang To: Petr Mladek , Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" , Alan Cox , Peter Zijlstra , linux-kernel@vger.kernel.org Cc: alek.du@intel.com, feng.tang@intel.com Subject: Re: [RFC 1/2] printk: Enable platform to provide a early boot clock Message-ID: <20180614083851.m6euwwl3xkdtjakd@shbuild888> References: <1527672059-6225-1-git-send-email-feng.tang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527672059-6225-1-git-send-email-feng.tang@intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 05:20:58PM +0800, 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. Hi Petr and all, As the 2/2 tsc related patch is still under review/discussion, can we consider taking this first? As this may benefit other archs. For example, Intel Curie platform has an always-on 32KHz osc clock, which is accurate but low frequency, and it could be used as early printk timestamp until the high-resolution timer is initialized and used as sched_clock. Don't know if ARM or other platforms have similar use case. Thanks, Feng