Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755184AbdGXVkz convert rfc822-to-8bit (ORCPT ); Mon, 24 Jul 2017 17:40:55 -0400 Received: from mga02.intel.com ([134.134.136.20]:41658 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753618AbdGXVkr (ORCPT ); Mon, 24 Jul 2017 17:40:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,408,1496127600"; d="scan'208";a="882327764" From: "Brandt, Todd E" To: Steven Rostedt , "Huang, Ying" CC: "Liu, Mengyang" , "linux-kernel@vger.kernel.org" Subject: RE: Is it possible to use ftrace to measure secondary CPU bootup time Thread-Topic: Is it possible to use ftrace to measure secondary CPU bootup time Thread-Index: AQHTBEAmOCFy4KwF4keglYddnc2du6JjKBAAgABZ8LA= Date: Mon, 24 Jul 2017 21:40:24 +0000 Message-ID: <11E08D716F0541429B7042699DD5C1A1A45814E1@FMSMSX103.amr.corp.intel.com> References: <874lu2fkv4.fsf@yhuang-dev.intel.com>,<20170724051702.5a0a4ec8@vmware.local.home> In-Reply-To: <20170724051702.5a0a4ec8@vmware.local.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.3.86.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1308 Lines: 29 > > On Mon, 24 Jul 2017 13:46:07 +0800 > "Huang\, Ying" wrote: > > > Hi, Steven, > > > > We are working on parallelizing secondary CPU bootup. So we need to > > measure the bootup time of secondary CPU, that is, measure time spent in > > smp_init() and its callees. But we found that ftrace now doesn't > > support measure time spent in smp_init() because it is called too early > > (before core_initcall()?). So, do you think it is possible to use > > ftrace to measure secondary CPU bootup time? > > One could trace with function tracing that early, but that wont give > you the timings you are looking for. The best it probably could do is > to look at the function timestamps of what is called after smp_init. > That is, trace smp_init() and sched_init_smp() and take the difference. > > Function graph tracing (which is what you are probably looking for) is > much more heavy weight than function tracing. It requires some setup > that isn't ready that early. Although, I'm sure I can work to get it > there, but it's not trivial. Function graph tracing is indeed the target, as its the basis of the bootgraph tool. However, kprobes would work just as well. What's the difference in effort between enabling kprobes for early boot vs function graph trace? > > -- Steve