From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796168414; b=AKZqKJo/06oFp1JphPlXEYh6fM2iz9Depls5/RV7pmuOif0q0ytokQyrNXoG6VMvcUpT Wl4xO6YduIObh6fSvfCye7ljWJTG2sO2+Cw2/QRBcZEdFzQaVx8GM632fjAzOTynO3H4P +Y7jGM+RAUNz3uUTTYRGtCuHkeofFwmL9+DOhmnpL3RHXsD67EUsOdeSJa2OQ/L9+Sj5V 3W2/EjqAw5DH3/vxRz1vyUcOEwh9i/QE7MH2vnIdymYeDDqaouAyVTGgpGqRFskLtOiro MoL9Yj/lzaOg+0njSrmSe8qydZbdIoq9PWcnNPkxhaiVmrJV+61x2/gFgOGYd8JXRjQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796168414; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=KIYO7jLm6F9VHm0D1y8I/D+axqok7eSZaGpgbah36dU=; b=RBDlHH5cLPCKohv2v2pcm+rJNQEmGNYrdm0dX8cMmDgGnrD9QA1tGEYlP4zBJFpXcH+D InWhA2xAzx7ES01l3LdoLELTihP3PBIpDhSpDkrtCZLngtCrgeZs1jMlssV1aw5Xs4nfT tqh2pSC60MRQr8l+nfTrXHkKHK+3EqT5J0HQcZgjUov0Cn1GBR9P+0hoqSAgPnqEizI/S UHdvzK4ZzmGjNvtXPAD0KL9Zokgrxk/svOmw+t7IXydBDyJuE6gEbvlK8ddwXVc6LSJOQ Z03TPRrqd5/YOhLDJ0BZ1UnQr7IqN0f5FLMtmZSQcW4vuMeJE4gn8tpR04/qBHnltLQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nnVd0Mpm; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5CCE606A325; Tue, 1 Dec 2026 23:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nnVd0Mpm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62DCD1F00898; Tue, 1 Dec 2026 23:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796168414; bh=KIYO7jLm6F9VHm0D1y8I/D+axqok7eSZaGpgbah36dU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=nnVd0MpmqhVgW7Iu0v9L672ZfYgLGsmsl7Lt9oduNZwMuLjXcCsZm77L/8BgWJwVz r+4n+tjj0miGNDZujie4km9mZdT6xR4VAxDXX6bkzl76/bgF9k5XkS6KcO1iqMYJdN qi4UM9K9XGZsm3TgB5xkKpN/dh66XmCH5/EioI+072gh5og8kDXjihqTVIvHZ+Izfo +lKwqVLF6gpZSp8uqGoIfUVWJlZkOulHJbzP9ITBVl9o7KbY0jy0EmZwVY62uop18w 89TKOXP9s9bFn1hFA03fnajEJJZeJTdJJSeZGz+NLilKzDi0WkoVneh2T3NPnTXWZW oLJ6LLbJPI5JQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH 16/16] perf test: Add PERF_SAMPLE_HOST_IP symbolization, sorting, and ASLR tests Reply-To: sashiko-reviews@lists.linux.dev To: "Ian Rogers" Cc: linux-perf-users@vger.kernel.org, kvm@vger.kernel.org, bpf@vger.kernel.org In-Reply-To: <20261201232116.1988791-17-irogers@google.com> References: <20261201232116.1988791-1-irogers@google.com> <20261201232116.1988791-17-irogers@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 23:40:14 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] perf test: missing reset_output_field() on setup_sorting() error path -- commit 27b0696436e8693a733c90ea5666e742b5cfaa44 Author: Ian Rogers perf test: Add PERF_SAMPLE_HOST_IP symbolization, sorting, and ASLR tests This commit adds a C test suite for PERF_SAMPLE_HOST_IP covering guest-to-h= ost symbolization fallback, histogram sorting and formatting for host sort keys, and ASLR anonymization of sampled host_ip values. > diff --git a/tools/perf/tests/host-ip-sym.c b/tools/perf/tests/host-ip-sy= m.c > new file mode 100644 > index 0000000000000..b2acf08446e94 > --- /dev/null > +++ b/tools/perf/tests/host-ip-sym.c > @@ -0,0 +1,691 @@ [ ... ] > +static int test__host_ip_hist_sort(struct test_suite *test __maybe_unuse= d, > + int subtest __maybe_unused) > +{ [ ... ] > + field_order =3D NULL; > + sort_order =3D "host_dso,host_sym,host_ip"; > + if (setup_sorting(/*evlist=3D*/NULL, machines.host.env) < 0) > + goto out_machines; > + perf_hpp__init(); [ ... ] > + /* > + * Verify collapsing a sample with host_ip =3D=3D 0 into an existing > + * comm-sorted entry preserves valid host_ms.map/sym references. > + */ > + delete_all_hist_entries(hists); > + reset_output_field(); > + sort_order =3D "comm"; > + if (setup_sorting(/*evlist=3D*/NULL, machines.host.env) < 0) > + goto out_machines; > + perf_hpp__init(); > + > + if (add_guest_hist_sample(evsel, guest_machine, TEST_GUEST_IP, TEST_HOS= T_IP1) || > + add_guest_hist_sample(evsel, guest_machine, TEST_GUEST_IP + 4, 0)) > + goto out_hists; > + > + hists__collapse_resort(hists, NULL); > + evsel__output_resort(evsel, NULL); > + node =3D rb_first_cached(&hists->entries); > + if (!node) > + goto out_hists; > + he =3D rb_entry(node, struct hist_entry, rb_node); > + if (he->stat.period !=3D 200 || !he->host_ms.map || !he->host_ms.sym || > + strcmp(he->host_ms.sym->name, "dax_guest_hot_fn") !=3D 0) { > + pr_debug("Collapsing sample with host_ip=3D0 corrupted host_ms\n"); > + goto out_hists; > + } > + > + ret =3D TEST_OK; > +out_hists: > + delete_all_hist_entries(hists); > + reset_output_field(); > + sort_order =3D NULL; > +out_machines: [Severity: Low] Should both setup_sorting() failure paths jump to out_hists (or a label that calls reset_output_field() and clears sort_order) instead of out_machines? If setup_sorting() fails part-way through, jumping to out_machines leaks any perf_hpp_fmt and hpp_sort_entry objects already linked onto perf_hpp_list a= nd leaves global sort_order and dimension state dirty for subsequent tests in the same process. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201232116.1988= 791-1-irogers@google.com?part=3D16