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=1796168171; b=ALon8lkym2uTqMZbeTpYDwvtqKQJ5teYU6uhrKuL30cFHHIYY6rCkKefoPc3m4Asyc5R mUkFrVZJMIq6V4JsnJQXw3GbRR/Y2VXDNCSrIpqyncfSGfWfAWSFz7l4otF/t8PIrc80R JtDkRAXdMd5FQqFcNsEsbBqMTyhuBfHi4pkUwvdNaUvNFSKwFeocFeTbj0jvmAa36bcRH ENX8380wMZwu9ycKAfm7QsG9FfZCtLyi80bP0zSD0beEPLNAy8gUdBEv2G7kmGxY55HLS 3QpDBgSsxEM2esZwxvBcM1zwOePVcLjO23fyy9RrZqICy0pCYroV3Qgv95UeX89zxsA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796168171; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=utF4cO5pI0CR6EL0r7McCw6mgZk3pkn6jZatKV12oX8=; b=Q6ar/EA9d4O6dUXkUeExdEpchhCnGg4CX752VfgvV8fhQtxoXk9ouH8VRWsLQvmLfGOp ZMEsf8O8wLM5OpY11cxv2b1t+iNHRanQmL8FaK5+dWzSMi9TB5EYqujY44VkPwpsQAD2e PbXU/bFl+yPzdQ2xPMuv9il1ZeBcAOe41iMp0n3DbEddMYBWammghARhAwM4ucUPGmEkB 4iNLwL6t0y2YReIckolwzSguc7oHbia3x9zG6E+dP4wAo8wzP0qDdLNhM2UHDeftFsBv9 ilZfxIj2RX7zz45gt0wGj8mscvWaLrN7qEdc4AmC1CBVW2gFM5eT8olfnm06SDnWc6g== 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=D2X0RUuc; 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 37FE9606A31A; Tue, 1 Dec 2026 23:36:11 +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=D2X0RUuc Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA02C1F000C1; Tue, 1 Dec 2026 23:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796168170; bh=utF4cO5pI0CR6EL0r7McCw6mgZk3pkn6jZatKV12oX8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=D2X0RUucQOir68olyvrXspbDsOGuxxXWHqXpIfq9o/21Ym0pavIpv7175Tf3iut9T kwvYdat59dX70E2Cb1TxDIoBl0dx//oC4XCBtn6qMXreb6gmvYqogpiwJ3nmIc4CPK OUjlaQdj6madPqsvEGCPoYiIO3YRBwjU66VPj6/W/CX+ca2+XhxGbqhdFYcPrCAEoZ N5CbnNJFPY/xDR0Ddh74erACQGk+iLcKoVqqtTGCL/dHRmsMs6YJBaclGy7c/WiR5t vA0J8+e3vCIzOR8LoAHrvWhAM7FGWxCUtHbXe6I8kKQodTY9ljtDY+Pav8MVEJDjU2 ON4HInmNzk0Ow== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH 09/16] perf tools: Add PERF_SAMPLE_HOST_IP parsing, synthesis, and record --host-ip 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-10-irogers@google.com> References: <20261201232116.1988791-1-irogers@google.com> <20261201232116.1988791-10-irogers@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 23:36:10 +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 build-id: redundant host_ip resolution work in build_id__mark_dso_hit() -- commit f48af508d6ae21b2cf368f9f3892365b8960eca5 Author: Ian Rogers perf tools: Add PERF_SAMPLE_HOST_IP parsing, synthesis, and record --host-ip This commit adds userspace support for PERF_SAMPLE_HOST_IP, including sample parsing, synthesis, build-id hit tracking, and a --host-ip option in perf record. > diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c > index 02233ef0eafff..cc5ce39ddacd4 100644 > --- a/tools/perf/util/build-id.c > +++ b/tools/perf/util/build-id.c > @@ -74,6 +74,33 @@ int build_id__mark_dso_hit(const struct perf_tool *too= l __maybe_unused, > =20 > addr_location__exit(&al); > =20 > + if (sample->host_ip) { > + struct machine *host_machine =3D machine__is_host(machine) ? > + machine : (machine->machines ? &machine->machines->host : NULL); > + > + if (host_machine) { > + struct thread *host_thread =3D machine__findnew_thread(host_machine, > + sample->pid, > + sample->tid); > + struct maps *host_maps =3D NULL; > + > + if (machine__kernel_ip(host_machine, sample->host_ip)) > + host_maps =3D machine__kernel_maps(host_machine); > + else if (host_thread) > + host_maps =3D thread__maps(host_thread); > + > + if (host_maps) { > + struct map *host_map =3D maps__find(host_maps, sample->host_ip); > + > + if (host_map) { > + dso__set_hit(map__dso(host_map)); > + map__put(host_map); > + } > + } > + thread__put(host_thread); > + } > + } [Severity: Low] Does calling machine__kernel_ip() on every non-zero sample->host_ip force an eager load of the host kernel symbol table even for pure user-space samples? machine__kernel_ip() calls machine__get_kernel_start(), which invokes map__load() on the host vmlinux map on the first sample, bypassing symbol_conf.lazy_load_kernel_maps in cmd_record(): tools/perf/util/machine.c:machine__get_kernel_start() { ... if (map) { err =3D map__load(map); /* * On x86_64, PTI entry trampolines are less than the * start of kernel text, but still above 2^63. So leave * kernel_start =3D 1ULL << 63 for x86_64. */ if (!err && !machine__is(machine, EM_X86_64)) machine->kernel_start =3D map__start(map); } ... } In addition, when host_machine =3D=3D machine and sample->host_ip =3D=3D sa= mple->ip, this repeats machine__findnew_thread() (even before checking whether host_thread is needed for a user-space address) and repeats the map lookup already done by thread__find_map() above. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201232116.1988= 791-1-irogers@google.com?part=3D9