Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2188370rdf; Mon, 6 Nov 2023 07:11:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwdsdWQsZgq32l0ws+hx4+G2VRPTNHuR7o7PIgHRyYkIaGGTdSVFCO25IlF0rwU9gGYnhE X-Received: by 2002:a17:903:24f:b0:1cc:78a5:50a2 with SMTP id j15-20020a170903024f00b001cc78a550a2mr19327137plh.39.1699283507070; Mon, 06 Nov 2023 07:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699283507; cv=none; d=google.com; s=arc-20160816; b=wiRbC7/5pV8mkRC8pm2mK1qgveW6idqrxsiNMiKJ8y/u6HIuY7dclkMS9kqZE9eWyR 1miPJBhj0BCmhf3kfsM5oPQrTXDbE+jV9a1v+SF2IZlUBFUh5kIkXFTOyxwJhdnIYV+F f8w1dTXDZdOWIY4VSmAZpF/vseNfjRb3Ls05Imf+rEcYChtSTdEBFcyFRhgRKR+5ERxN 28lHmpx1A4pvcI6o2ES1fuEMX9vJe8JU/RUvRomBVBPSpGqxUfHGNRZs3h1QxGZY1coD FT3yZKW/2RyJ+7iMw/OihgXgqUJsyBTLpUZ274kGMsdwniZc4BvA69eKsGijqJH+gPM7 1pbg== 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; bh=qyJLEjq79CaaCisM3/o9QRDT8BSieBoMFXSxLopdoUk=; fh=9w9BUwgS5xSQm8w3MVsJsPSULleJKYkho10/4+UPlFU=; b=OiqUhScm+nU53ynCPC4tMWF9Kvg1Pr5N7rs6p8suAEoIQZysEdfuwVmAvzNAXPshGw 7oNovAex8wQSQqv1dwwrc/h8fnrWjhYzPP36weTYg96rNOXmtL1rxyGUEdHoqUn8ey8/ vMwt0m01fDMbd0pPUcYiiiSNgWHNp1CJKqxr/xF0/1xZ1rLbAsyDMfYcFZe3XpY5CMoT cMpkNJm66PxCOZWjgCDr5dbaXZObe5x42CIW2Mets7qRMaVgcx8RPxkSloF+wCCY7rTo DYWTtWKsjdaxiCpSKbsQS/EzkCBPv2rQonvt2GVPp3NSJZ5rjzBmVRjjjpx6iF0Xb6JY d1Wg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id lb4-20020a170902fa4400b001ca335f7147si8061407plb.57.2023.11.06.07.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 07:11:47 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 254BB80267E4; Mon, 6 Nov 2023 07:11:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232115AbjKFPLd (ORCPT + 99 others); Mon, 6 Nov 2023 10:11:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232047AbjKFPLb (ORCPT ); Mon, 6 Nov 2023 10:11:31 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 385161B2; Mon, 6 Nov 2023 07:11:28 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C6C0DA7; Mon, 6 Nov 2023 07:12:12 -0800 (PST) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 393BD3F6C4; Mon, 6 Nov 2023 07:11:25 -0800 (PST) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Tom Rix , Yonghong Song , Fangrui Song , Kan Liang , Yang Jihong , Athira Rajeev , Ravi Bangoria , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v2 2/2] perf test: Add support for setting objdump binary via perf config Date: Mon, 6 Nov 2023 15:10:49 +0000 Message-Id: <20231106151051.129440-3-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231106151051.129440-1-james.clark@arm.com> References: <20231106151051.129440-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: 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]); Mon, 06 Nov 2023 07:11:37 -0800 (PST) Add a perf config variable that does the same thing as "perf test --objdump ". Also update the man page. Signed-off-by: James Clark --- tools/perf/Documentation/perf-config.txt | 4 ++++ tools/perf/tests/builtin-test.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt index 0b4e79dbd3f6..16398babd1ef 100644 --- a/tools/perf/Documentation/perf-config.txt +++ b/tools/perf/Documentation/perf-config.txt @@ -722,6 +722,10 @@ session-.*:: Defines new record session for daemon. The value is record's command line without the 'record' keyword. +test.*:: + + test.objdump:: + objdump binary to use for disassembly and annotations. SEE ALSO -------- diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index a8d17dd50588..113e92119e1d 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -14,6 +14,7 @@ #include #include #include "builtin.h" +#include "config.h" #include "hist.h" #include "intlist.h" #include "tests.h" @@ -514,6 +515,15 @@ static int run_workload(const char *work, int argc, const char **argv) return -1; } +static int perf_test__config(const char *var, const char *value, + void *data __maybe_unused) +{ + if (!strcmp(var, "test.objdump")) + test_objdump_path = value; + + return 0; +} + int cmd_test(int argc, const char **argv) { const char *test_usage[] = { @@ -541,6 +551,8 @@ int cmd_test(int argc, const char **argv) if (ret < 0) return ret; + perf_config(perf_test__config, NULL); + /* Unbuffered output */ setvbuf(stdout, NULL, _IONBF, 0); -- 2.34.1