Message ID | 20231110000012.3538610-2-namhyung@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp785590vqs; Thu, 9 Nov 2023 16:01:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/2Eh1hQD+nnchCEUnVAQBw81R2TK3UkwfYXTohvez/XQXHtLgyMENMslpX7R8YUIyG2U0 X-Received: by 2002:a05:6870:4204:b0:1e9:924a:7385 with SMTP id u4-20020a056870420400b001e9924a7385mr8093985oac.28.1699574490180; Thu, 09 Nov 2023 16:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699574490; cv=none; d=google.com; s=arc-20160816; b=CTqGF0RDfeLt1AJF1lQUCCDjW0499wgVFDU6uNV6+A9Ri8oPopsXE8X2cpoXNen+8L mU1VzxcXB9um43OhWJFuK9FVXq2QE7yC4hAT/DlIT5yS0xdLzEb40HTJotHOkqsFnZLV K4bXwpY7InUw8AryqJA58fzIkgeP9/J4PYeVTWUyf4cNez7p8QUrb63KqBfSqMtUPhkA t0U3/hHkd1Q0rq6IXfzu4SYL5jFfd+LDeGeut8ypXnLvxWvCIjC9taQbRQ0+9KD6Gi27 9jebhr1cSNuNLZRjf47hHSLsTMaqNWMKTlvTsisgDWp0Q3znRnf+hLHIX724Msq2m2lf eHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=s26PP4ZDsM0R9c6L05wqU22qp26lYxGgumYeBt3IcPk=; fh=K//si1Hi/RYC7s39rVvmvh0YbZGmBrdWWHQg3cPF7Xc=; b=FjubLPDMehKVm2W6yQvkES/x3DXeWaihMO5xRI1ZPIBqIt3tF/TnKAakpqGcEGtXuD PFqjh6SZpR3BmBl/gTbx989zlvXUe5KZyh1l8Ax0aQjTOYU7lpYCLqKt3v8w9eRDPeAM 8YZOJtwK0mrwfzxLaNfVso56Wp+yER/yTVWGAyuJBUhKJPOo13OIkUwgJjM7jaHR9fD7 ULwBII3dDfuLXVCHu31F0kQzMEhJWv5J0sBOEg64Pihe1nKxq88UwQHwRNB7lYlyW4VQ 5lIWqUayagVcoQDS8mqSXT/mbCoQ0xEm6cpq5gua1jsPcdZdcAJZaK+t0/+XBlHOXHqf nPQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QhzGPgQM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r20-20020a6560d4000000b005b8ee1c0c6bsi28924pgv.408.2023.11.09.16.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 16:01:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QhzGPgQM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 05EEA80A30C9; Thu, 9 Nov 2023 16:00:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345440AbjKJAAW (ORCPT <rfc822;lhua1029@gmail.com> + 30 others); Thu, 9 Nov 2023 19:00:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234801AbjKJAAV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 19:00:21 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4558E44A4; Thu, 9 Nov 2023 16:00:19 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5a9bf4fbd3fso1210418a12.1; Thu, 09 Nov 2023 16:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699574419; x=1700179219; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=s26PP4ZDsM0R9c6L05wqU22qp26lYxGgumYeBt3IcPk=; b=QhzGPgQMi46JFIGAL1E1foEvEniu8U/jJhiNMbehb60avWy5Zp5m3LVJZEuU1LlEAP aNyWvgBWZrgkfTLJcEGNy77G5kjxrd27AvpVdLLJtg3I7a92aOxVJJ39iN/UwGVoh9Jf Dw95Kjs0igsCCEErS0RhoX/T3N8ueeJHHt+D5HlKA7HEP7QxUl+7rZsWaXe4Dhd03lE9 WwcGgmPR7qQoDG6zADMlbFl8JtYhubm4gjM7e0CFmCNIEq+msc6Ir1+pUwRfZ8dPROcK ekA9w9E6Unv0iR+DKOo40E4fQmQvwLmge81GRehjgpJZ44E0/4NSecIO3uxdgFmkv07X /uFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699574419; x=1700179219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=s26PP4ZDsM0R9c6L05wqU22qp26lYxGgumYeBt3IcPk=; b=WiVCTUl2zL6tAVOXoFO7YRh9lyeTFXsbR0NUBMQPzC7KAnF1Q4ZavhRz4FrgW2cbcF ZiOJLgdVSa68hJuzyxBzRazuj3M+auxVWEYWOO+cb542btSPD5qbDylx8FqteQPnamV+ ml+7cVizO832OTk54pCRGl8M4sW7I6w/fjsEfm+09U0/KFLcAIv65ONE6v7o6JjbQOR3 5ogZZPKZEgWF4jkQiOvDblV1bQSTRMNTdXSDLe7+aGyEXNLznlR8YJ0COKelLTUSVg20 QWJ2jHy4Lr6P9g/hqxjp125rwSrj3G5Ws6IoTo7q+WhIZdTjf2Cp5sVwf/QuAG/ooVlQ oT3w== X-Gm-Message-State: AOJu0YzWL84Wi4/9OCGpEMgCojfqZHpDz6hNTuo+/kb9fz0OO54oxFp4 aBlPWL9ag8BUgyMSETYZllIU7ScP8Po= X-Received: by 2002:a17:90b:1bcc:b0:27d:7ebe:2e8 with SMTP id oa12-20020a17090b1bcc00b0027d7ebe02e8mr3543803pjb.9.1699574417184; Thu, 09 Nov 2023 16:00:17 -0800 (PST) Received: from bangji.corp.google.com ([2620:15c:2c0:5:d45c:ae16:d959:a5f1]) by smtp.gmail.com with ESMTPSA id k32-20020a17090a4ca300b002635db431a0sm371312pjh.45.2023.11.09.16.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 16:00:16 -0800 (PST) Sender: Namhyung Kim <namhyung@gmail.com> From: Namhyung Kim <namhyung@kernel.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@kernel.org>, Peter Zijlstra <peterz@infradead.org> Cc: Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Ingo Molnar <mingo@kernel.org>, LKML <linux-kernel@vger.kernel.org>, linux-perf-users@vger.kernel.org, Linus Torvalds <torvalds@linux-foundation.org>, Stephane Eranian <eranian@google.com>, Masami Hiramatsu <mhiramat@kernel.org>, Andi Kleen <ak@linux.intel.com>, linux-trace-devel@vger.kernel.org, linux-toolchains@vger.kernel.org Subject: [PATCH 01/52] perf annotate: Pass "-l" option to objdump conditionally Date: Thu, 9 Nov 2023 15:59:20 -0800 Message-ID: <20231110000012.3538610-2-namhyung@kernel.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog In-Reply-To: <20231110000012.3538610-1-namhyung@kernel.org> References: <20231110000012.3538610-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 16:00:34 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782133020950339034 X-GMAIL-MSGID: 1782133020950339034 |
Series |
perf tools: Introduce data type profiling (v2)
|
|
Commit Message
Namhyung Kim
Nov. 9, 2023, 11:59 p.m. UTC
The "-l" option is to print line numbers in the objdump output.
perf annotate TUI only can show the line numbers later but it
causes big slow downs for the kernel binary.
Similarly, showing source code also takes a long time and it
already has an option to control it.
$ time objdump ... -d -S -C vmlinux > /dev/null
real 0m3.474s
user 0m3.047s
sys 0m0.428s
$ time objdump ... -d -l -C vmlinux > /dev/null
real 0m1.796s
user 0m1.459s
sys 0m0.338s
$ time objdump ... -d -C vmlinux > /dev/null
real 0m0.051s
user 0m0.036s
sys 0m0.016s
As it's not needed for data type profiling, let's make it conditional
so that it can skip the unnecessary work.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/annotate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 9b68b8e3791c..118195c787b9 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2144,12 +2144,13 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) err = asprintf(&command, "%s %s%s --start-address=0x%016" PRIx64 " --stop-address=0x%016" PRIx64 - " -l -d %s %s %s %c%s%c %s%s -C \"$1\"", + " %s -d %s %s %s %c%s%c %s%s -C \"$1\"", opts->objdump_path ?: "objdump", opts->disassembler_style ? "-M " : "", opts->disassembler_style ?: "", map__rip_2objdump(map, sym->start), map__rip_2objdump(map, sym->end), + opts->show_linenr ? "-l" : "", opts->show_asm_raw ? "" : "--no-show-raw-insn", opts->annotate_src ? "-S" : "", opts->prefix ? "--prefix " : "",