lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZUv1TgveArYdvTsl@kernel.org>
Date:   Wed, 8 Nov 2023 17:53:34 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     James Clark <james.clark@....com>
Cc:     linux-perf-users@...r.kernel.org, irogers@...gle.com,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Rix <trix@...hat.com>, Yonghong Song <yhs@...com>,
        Fangrui Song <maskray@...gle.com>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Yang Jihong <yangjihong1@...wei.com>,
        Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
        Ravi Bangoria <ravi.bangoria@....com>,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v2 2/2] perf test: Add support for setting objdump binary
 via perf config

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?

Anyway, applied both patches.

- Arnaldo
 
> Signed-off-by: James Clark <james.clark@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ