Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1732179pxk; Sun, 13 Sep 2020 14:11:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynDLEw88FspLZief7bNdyQE+XWsRhTm2OE4L5oU7qQ5ASJc2jCpjrcRbjyriDwHQuVMek4 X-Received: by 2002:a17:906:1690:: with SMTP id s16mr11521332ejd.122.1600031508378; Sun, 13 Sep 2020 14:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600031508; cv=none; d=google.com; s=arc-20160816; b=heVCrwpDjzl7oDQxd2b446+qL2ogY/rdkilI7r3q62zdLBjS/4nFUtQpg35Fod1ADl exK8+5o76zCvZtIsjCjTHY1fONLaf6zL9NMUGqH/+Ndkqx9kKxnHdLnRBGW7+tef+84z sQMPueWg8LKR9r7bPalFAlcQ4YP0xgi+w8ZHa8GRnhQYOddcMi7X4PnynegUk9isfkiR vOLTW+bjG+gO7iB7hEQQIXmZ9eVe7rnXPscDsNRV9rvyyQnfNZYgLZTOIOQwRcthidCo oIYIpXhYFJaJEsDudnTtzDvx8mhJ8CZUBgQ+UcKUKQkPLEne7/oMiL/lz6hVSBu7IjEp ck/Q== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vN1G7vi1QdRRbu/UOVos625CuRAU5ZQvFbIMO77x0WA=; b=IwCG1hvP7OLyH9hb44yM1YbIKh/Lf1o9PpNbQwLF636cQsGhA1P7MZ9mWsOsav9sRp HQl72JeFiatpzJwQaxubVYmVpjeNrpVRxxHO81Z5hij6Z74RfWGSrc6dQSHjMUs05NyC zOPRzTg2LKHVrPe4eeB3ZlJMP701oT94aGlz3p5mO2tUReMKKzh70mCW7IfGYx4yUASt QEcf6SBiUqTp9CPD6gpK2J8QAkWDGfQIb1roFzanyw2PgQ6DnonzUvyPrY6SUvj+gvB6 GXvb9rtTUnZVXuOASvtpUmIjyr4RY3Z07v9EoKH9iZ1V4QeCo84OQUrgMMTYly+YOYYY 95SQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si6069766edu.27.2020.09.13.14.11.26; Sun, 13 Sep 2020 14:11:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725986AbgIMVHH convert rfc822-to-8bit (ORCPT + 99 others); Sun, 13 Sep 2020 17:07:07 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:36896 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725979AbgIMVHG (ORCPT ); Sun, 13 Sep 2020 17:07:06 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-118-z4vsygBsNESlJJ56zBzIlw-1; Sun, 13 Sep 2020 17:05:25 -0400 X-MC-Unique: z4vsygBsNESlJJ56zBzIlw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C9F3634914; Sun, 13 Sep 2020 21:05:23 +0000 (UTC) Received: from krava.redhat.com (ovpn-112-4.ams2.redhat.com [10.36.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2ABE410021AA; Sun, 13 Sep 2020 21:05:18 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Song Liu , "Frank Ch. Eigler" , Ian Rogers , Stephane Eranian , Alexey Budankov , Andi Kleen , Adrian Hunter Subject: [PATCH 26/26] perf tools: Add report --store option Date: Sun, 13 Sep 2020 23:03:13 +0200 Message-Id: <20200913210313.1985612-27-jolsa@kernel.org> In-Reply-To: <20200913210313.1985612-1-jolsa@kernel.org> References: <20200913210313.1985612-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jolsa@kernel.org X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding report --store option as a wrapper for 'buildid-list --store' to save some typing. Signed-off-by: Jiri Olsa --- tools/perf/Documentation/perf-report.txt | 3 +++ tools/perf/builtin-report.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index d068103690cc..698fe90d6e1d 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt @@ -548,6 +548,9 @@ include::itrace.txt[] Configure time quantum for time sort key. Default 100ms. Accepts s, us, ms, ns units. +--store:: + Store build id DSOs in .debug cache. See `--store` option n perf-buildid-list. + --total-cycles:: When --total-cycles is specified, it supports sorting for all blocks by 'Sampled Cycles%'. This is useful to concentrate on the globally hottest diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3dd37513eb94..3450e441d894 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -1098,6 +1098,18 @@ static int process_attr(struct perf_tool *tool __maybe_unused, return 0; } +static int build_id_store(const char *file) +{ + const char *argv[4]; + + argv[0] = "buildid-list"; + argv[1] = "-i"; + argv[2] = file; + argv[3] = "--store"; + + return cmd_buildid_list(4, argv); +} + int cmd_report(int argc, const char **argv) { struct perf_session *session; @@ -1107,6 +1119,7 @@ int cmd_report(int argc, const char **argv) int branch_mode = -1; int last_key = 0; bool branch_call_mode = false; + bool store = false; #define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent" static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n" CALLCHAIN_REPORT_HELP @@ -1301,6 +1314,7 @@ int cmd_report(int argc, const char **argv) OPTS_EVSWITCH(&report.evswitch), OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode, "Sort all blocks by 'Sampled Cycles%'"), + OPT_BOOLEAN(0, "store", &store, "Store build id dsos in .debug cache"), OPT_END() }; struct perf_data data = { @@ -1367,6 +1381,9 @@ int cmd_report(int argc, const char **argv) input_name = "perf.data"; } + if (store) + return build_id_store(input_name); + data.path = input_name; data.force = symbol_conf.force; -- 2.26.2