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=1796390541; b=Wx0cGS2YvLAFzyouQlcUmmi1P6TW5Wq5YYWz08oQgDGGxDYXkgyHxxASb4HknzgPSW9c s67fAXzQdi7XwKGJxED5bmmWOgN+OE+h0YcKbayfzpdPvmCbzvDyZMc187BNxRm9CEse2 CbBQytRTXeq2x3fkj9dVpkkMLL3kyl8wVygGxltsOE2UGai+0Gk/1zIXplTLDNb7sqJkL TSFwWrIgPyiUfIF6ApjJNziCgWqB0PkiPMu2jV2nDhWrne8MKcnotq+b+9g08w37D/+OJ DqCXktv8f/X0V0t8jIOBKqy8FHepDOAOdwsYwC52KucoF79PnOLA0rlHWazZ2DvHItA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796390541; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=UUXy4Fuu/ih0GVjeDRJ/qvr7DQkiERSkVI/Y7Md2r9s=; b=DJVgt6gmth3KQZY0tLasOdZVx6TIcGPh68BnF93gpI1gpXGDk/fQU1UPQtqvdfddv9sK 2tlHTADxEE9h74LLlKvrdaCOgtTqdsMh8xaogF+eZOdCTNOaSzGuGQ7AUQ/OyRNZeO+zk oXe0D56Pdee1R9wDta/TnpYG1rXLU2Z4zShDebG8aIZoFMKkbuJWKt8TOOcRxEeJ/9f12 CSrnjOodjtn3HMp+RGTbxl4kI3zsguX2MhiJq7GfzcLlg+5Lw6qqp8K8KyqasJzZqD4HB J4qUH94MxO7CqNMtD90eB8NUEnzp5sS4ErIxDUqda2HzdRaJgRvC0IA7/06bY+7bPrg== 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=Bmkf9pFI; 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 45F6F606A32F for ; Fri, 4 Dec 2026 13:22:20 +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=Bmkf9pFI Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAFCA1F00A2E; Fri, 4 Dec 2026 13:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796390540; bh=UUXy4Fuu/ih0GVjeDRJ/qvr7DQkiERSkVI/Y7Md2r9s=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Bmkf9pFISzmGo9K3OxuZGFBB3FkAWIgWlJkCzuGp4T3KABBEtYOIV4WcqYmZRF+x1 s2oIyEFKCVrL6zdOUDks1qGlNhNH5cRb+pWBcD0JBQGl3Fc9g62tQm6xlVV9C7Bfjj WDYi5aL8va2CcTQPK5zMqahGL+uHWjuQwAaX9DWBcgKQ2uHtI86lg4hmGfl2AsFDru WWn3twsgStVhXC/Kw0qdTGryx7gj27wW7GRlzOqtldRXewcLs1LWr2Z9HUeL3Unp4F r0EBooHIzC2uu3zPoUiz66Gnx2rM+kz0dFjyUX8kTvIwTLDEytZr+7x+6q49AsLPzg VfX4FlagIzQ9Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 6/7] perf test: Cover multi-record thread map synthesis Reply-To: sashiko-reviews@lists.linux.dev To: "Leo Yan" Cc: linux-perf-users@vger.kernel.org In-Reply-To: <20261204-perf_fix_large_threads-v2-6-a6c077f3037d@arm.com> References: <20261204-perf_fix_large_threads-v2-0-a6c077f3037d@arm.com> <20261204-perf_fix_large_threads-v2-6-a6c077f3037d@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 13:22:20 +0000 X-Mailing-List: linux-perf-users@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 2 potential issues to consider: - [Low] perf test: missing explicit stdio.h and stdbool.h includes in thread-map.c - [Low] perf test: duplicated max_nr calculation and hardcoded limits in thread-map.c -- commit e2b0a1a73dca6e5c1f8eb5380921925d2faf9ba2 Author: Leo Yan perf test: Cover multi-record thread map synthesis This commit extends the thread-map synthesis test with empty maps and sizes around the one-record and two-record limits, reassembling each map to verify record headers, process IDs, and command names. > diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c > index 877868107455e..ced1a357233d6 100644 > --- a/tools/perf/tests/thread-map.c > +++ b/tools/perf/tests/thread-map.c > @@ -1,6 +1,9 @@ > // SPDX-License-Identifier: GPL-2.0 > #include > #include > +#include > +#include > +#include > #include > #include > #include [Severity: Low] Should and also be included explicitly here? process_thread_map_chunk() uses bool and test_thread_map_chunks() calls snprintf(), so relying on transitive includes risks build failures if internal perf headers change or when building against musl. [ ... ] > +static int process_thread_map_chunk(const struct perf_tool *tool, > + union perf_event *event, > + struct perf_sample *sample __maybe_unused, > + struct machine *machine __maybe_unused) > +{ > + struct thread_map_synthesize *data =3D container_of(tool, struct thread= _map_synthesize, tool); > + struct perf_record_thread_map *map =3D &event->thread_map; > + const int max_nr =3D (UINT16_MAX - sizeof(*map)) / sizeof(map->entries[= 0]); [ ... ] > +static int check_thread_map_chunks(struct thread_map_synthesize *data) > +{ > + const int max_nr =3D (UINT16_MAX - sizeof(struct perf_record_thread_map= )) / > + sizeof(struct perf_record_thread_map_entry); [ ... ] > static int test__thread_map_synthesize(struct test_suite *test __maybe_u= nused, int subtest __maybe_unused) > { > struct perf_thread_map *threads; > + static const int sizes[] =3D { 0, 1, 2729, 2730, 3000, 5458, 5459 }; [Severity: Low] Could max_nr be consolidated into a single file-scope constant or macro? process_thread_map_chunk() and check_thread_map_chunks() duplicate the per-record entry limit calculation, and sizes[] hardcodes 2729, 2730, 5458, and 5459 instead of expressing them in terms of max_nr. A shared constant would remove the duplication and make the one-record and two-record boundary sizes self-documenting. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-perf_fix_l= arge_threads-v2-0-a6c077f3037d@arm.com?part=3D6