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: <aDd06eK7fKFsFsVS@google.com>
Date: Wed, 28 May 2025 13:41:13 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Kan Liang <kan.liang@...ux.intel.com>,
	Athira Rajeev <atrajeev@...ux.ibm.com>,
	Kajol Jain <kjain@...ux.ibm.com>, Li Huafei <lihuafei1@...wei.com>,
	"Steinar H. Gunderson" <sesse@...gle.com>,
	James Clark <james.clark@...aro.org>,
	Stephen Brennan <stephen.s.brennan@...cle.com>,
	Andi Kleen <ak@...ux.intel.com>, Dmitry Vyukov <dvyukov@...gle.com>,
	Zhongqiu Han <quic_zhonhan@...cinc.com>,
	Yicong Yang <yangyicong@...ilicon.com>,
	Krzysztof Łopatowski <krzysztof.m.lopatowski@...il.com>,
	"Dr. David Alan Gilbert" <linux@...blig.org>,
	Zixian Cai <fzczx123@...il.com>,
	Steve Clevenger <scclevenger@...amperecomputing.com>,
	Thomas Falcon <thomas.falcon@...el.com>,
	Martin Liska <martin.liska@....com>,
	Martin Liška <m.liska@...link.cz>,
	Song Liu <song@...nel.org>, linux-perf-users@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 5/9] perf build-id: Mark DSO in sample callchains

On Mon, Apr 28, 2025 at 02:34:04PM -0700, Ian Rogers wrote:
> Previously only the sample IP's map DSO would be marked hit for the
> purposes of populating the build ID cache. Walk the call chain to mark
> all IPs and DSOs.

I think this is correct, but I'm afraid it'd also increase the processing
time.  Do you happen to have any numbers?

Thanks,
Namhyung

> 
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>  tools/perf/util/build-id.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> index aa35dceace90..3386fa8e1e7e 100644
> --- a/tools/perf/util/build-id.c
> +++ b/tools/perf/util/build-id.c
> @@ -42,10 +42,20 @@
>  
>  static bool no_buildid_cache;
>  
> +static int mark_dso_hit_callback(struct callchain_cursor_node *node, void *data __maybe_unused)
> +{
> +	struct map *map = node->ms.map;
> +
> +	if (map)
> +		dso__set_hit(map__dso(map));
> +
> +	return 0;
> +}
> +
>  int build_id__mark_dso_hit(const struct perf_tool *tool __maybe_unused,
>  			   union perf_event *event,
>  			   struct perf_sample *sample,
> -			   struct evsel *evsel __maybe_unused,
> +			   struct evsel *evsel,
>  			   struct machine *machine)
>  {
>  	struct addr_location al;
> @@ -63,6 +73,11 @@ int build_id__mark_dso_hit(const struct perf_tool *tool __maybe_unused,
>  		dso__set_hit(map__dso(al.map));
>  
>  	addr_location__exit(&al);
> +
> +	sample__for_each_callchain_node(thread, evsel, sample, PERF_MAX_STACK_DEPTH,
> +					/*symbols=*/false, mark_dso_hit_callback, /*data=*/NULL);
> +
> +
>  	thread__put(thread);
>  	return 0;
>  }
> -- 
> 2.49.0.901.g37484f566f-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ