From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: James Clark <james.clark@arm.com>
Cc: linux-perf-users@vger.kernel.org, irogers@google.com,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Tom Rix <trix@redhat.com>, Yonghong Song <yhs@fb.com>,
Fangrui Song <maskray@google.com>,
Kan Liang <kan.liang@linux.intel.com>,
Yang Jihong <yangjihong1@huawei.com>,
Athira Rajeev <atrajeev@linux.vnet.ibm.com>,
Ravi Bangoria <ravi.bangoria@amd.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v2 2/2] perf test: Add support for setting objdump binary via perf config
Date: Thu, 9 Nov 2023 13:14:33 -0300 [thread overview]
Message-ID: <ZU0FaXoGf/HcLBlb@kernel.org> (raw)
In-Reply-To: <2e0fb2d4-1410-6a7e-902d-8249a9ea523a@arm.com>
Em Thu, Nov 09, 2023 at 10:26:34AM +0000, James Clark escreveu:
>
>
> On 08/11/2023 20:53, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Nov 06, 2023 at 03:10:49PM +0000, James Clark escreveu:
> >> Add a perf config variable that does the same thing as "perf test
> >> --objdump <x>".
> >>
> >> Also update the man page.
> >
> > That is ok, if one wants to change objdump just for testing, as a
> > followup improvement it may be interesting to allow that for the other
> > tools that have --objdump as well as to add this as a global option,
> > that affects all tools, no?
>
> For the tools they already all share annotate.objdump in the config. Do
> you mean that the tests could share the same config instead?
Probably.
> Maybe I could have used annotate.objdump for the tests, but it was used
> in a slightly different way, and I thought it would be easier for people
> to find if it started with "test."
Well, we can have both, with "test." overriding "annotate."?
Anyway, I applied this patch locally, now trying to fix some unrelated
problem that is making 'perf test' fail so that I can push
perf-tools-next publicly.
- Arnaldo
> >
> > Anyway, applied both patches.
> >
> > - Arnaldo
> >
> >> Signed-off-by: James Clark <james.clark@arm.com>
> >> ---
> >> 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-<NAME>.*::
> >> 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 <sys/wait.h>
> >> #include <sys/stat.h>
> >> #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
> >>
> >
--
- Arnaldo
next prev parent reply other threads:[~2023-11-09 16:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 15:10 [PATCH v2 0/2] perf test: Add option to change objdump binary James Clark
2023-11-06 15:10 ` [PATCH v2 1/2] " James Clark
2023-11-06 15:10 ` [PATCH v2 2/2] perf test: Add support for setting objdump binary via perf config James Clark
2023-11-08 20:53 ` Arnaldo Carvalho de Melo
2023-11-08 21:10 ` Arnaldo Carvalho de Melo
2023-11-09 10:26 ` James Clark
2023-11-09 16:14 ` Arnaldo Carvalho de Melo [this message]
2023-11-10 13:57 ` James Clark
2023-11-10 14:48 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZU0FaXoGf/HcLBlb@kernel.org \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=james.clark@arm.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=maskray@google.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=trix@redhat.com \
--cc=yangjihong1@huawei.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).