From nobody Tue Feb 10 23:01:57 2026 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14DDB3A9609 for ; Mon, 9 Feb 2026 17:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770658898; cv=none; b=QOBnKF0xJHjOc8iBpXmCnJyiFuYTOIIqaitqUvuEasnOhEY9UCSacxpYXwTC9k9v6ExMgn9IhQOY2W7bWO2byQoIeT1UArz8/1zultSqE+PNKXrB0tXMZqgjXhoBeT4M1o2LaLUpE5Z7W6UHGZw6UI0IUSQh4NcUm4Ye1b4q8yc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770658898; c=relaxed/simple; bh=eiHGa554VoouQjkLP84Hc3Tz1Qjrz7ST6/1UQlFUX9A=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=u/quUDccZbwlbhqObsO98drit0K3kQhL9wKMcntWomrbQ8vuXqwRrH9i5wYjIitV2aRy2VvQsIfOQo+d62k01OZvvWqLmnKf7sjvkR4u+ns7r540oyuo8mMPeBIkUmIcrxNTZDqWsalJGuUlus2TaSZxfdMAtcd6XA+pcKAGBF4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FuyQlK19; arc=none smtp.client-ip=74.125.82.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FuyQlK19" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-124a38e8980so3816949c88.0 for ; Mon, 09 Feb 2026 09:41:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770658897; x=1771263697; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=ZdotLyD11lWL4GWl2pBkwF07IbBlZLJhbJnZyLiuGdE=; b=FuyQlK19L1R+DEg+ld617cUU3qdL/dAkqw61N0+fs6SVC7mvFSSaXeynbOyoDHx1pq YGN6nkDbXUMhQR7fAaQtAGcUVjQlz4DkzEAXXxrjl4yYRSzTVA41oLZjQsfzsTy8uIR5 MejOPF7MgFpF1Ro5kt/BYXUtBg3uqol/XUCaYXYBstySqsFX025u+TcgoJPKyaiWjo0O T294phMXqnXLrvTgj49jzrHKLp2n+c5iq3pb9lCOJmG3bI/tgzJROLrHm/jJRlVkXU6Y LbS+e50JD+6a1A9xVMLW8GMe5jlQ8Uyb4jAxG1QBMuz4+Bn+zKDOtP16oFzYqr4coRN5 omFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770658897; x=1771263697; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZdotLyD11lWL4GWl2pBkwF07IbBlZLJhbJnZyLiuGdE=; b=Kj9Hn2ObRrJeZ+4KZeDk5YBShJFgvu6D+JlVM+IjYFA3eeiyaRL2XgKWcwt08gL+ZH jCA6JSDOq/QQ1Ei7Xrp33S4lnk31D0gB6WBW18yu3zcpB7wApHkLCx53HN8NClWZQyF3 aASQn+7K9p81Im5oy5pOnJBlLfL2zQKyCHSRLRBv7rsBNDkPXJdPYaf9SJwRGoIPthH5 orFKJ0QZjGNqZUuz0HwX+G35tO9AN2cRF9BXWXFCFDKWmK30gYoqow/tvIVW3kdlb/b8 BCL7leXemfjXnHKiV/+6DcnT8ixlOt7ghpbwY0exod4F3XDnkh4g6QAC64yn4Su4P9jc n6sw== X-Forwarded-Encrypted: i=1; AJvYcCVeAeNAnxN2Pf8SzCpSRtCpzAv6Ft+TJ2FS/0MlEBX7RUA5xwZ2hRP1Af3VhuvVrTbvHHtinKCjfhbKhgw=@vger.kernel.org X-Gm-Message-State: AOJu0YwpG1Fu1q1h5Marjk57qBuu1oYuAEpRD1v+S9ZlkdozQ/VWcf5X fGcaJWi/9dIHRuA5tDneSW2U/MtlW0KLqwZncTCwwQYPqjmhtp75T6EA3yijMe0IrEqop2T6KRj B5QmdX/Emrg== X-Received: from dlw6.prod.google.com ([2002:a05:7022:46:b0:127:e77:9377]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:a86:b0:123:330b:398 with SMTP id a92af1059eb24-12703f51b55mr5057729c88.19.1770658896959; Mon, 09 Feb 2026 09:41:36 -0800 (PST) Date: Mon, 9 Feb 2026 09:40:32 -0800 In-Reply-To: <20260209174032.4142096-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260209174032.4142096-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.239.g8d8fc8a987-goog Message-ID: <20260209174032.4142096-26-irogers@google.com> Subject: [PATCH v1 25/25] perf evsel: Don't pass evsel with sample From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Leo Yan , Tianyou Li , Athira Rajeev , Derek Foreman , Thomas Falcon , Howard Chu , Dmitry Vyukov , Andi Kleen , tanze , Hrishikesh Suresh , Quan Zhou , Andrew Jones , Anup Patel , Dapeng Mi , "Dr. David Alan Gilbert" , "=?UTF-8?q?Krzysztof=20=C5=81opatowski?=" , Chun-Tse Shao , Ravi Bangoria , Swapnil Sapkal , Chen Ni , Blake Jones , Yujie Liu , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Arrange for the sample to contain the evsel and so it is unnecessary to pass the evsel as well. This is done for uniformity, although parsing of the sample is arguably a special case. Signed-off-by: Ian Rogers --- tools/perf/util/evsel.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 041766d39ec3..21602d121260 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2997,10 +2997,10 @@ int evsel__open_per_thread(struct evsel *evsel, str= uct perf_thread_map *threads) return ret; } =20 -static int perf_evsel__parse_id_sample(const struct evsel *evsel, - const union perf_event *event, +static int perf_evsel__parse_id_sample(const union perf_event *event, struct perf_sample *sample) { + const struct evsel *evsel =3D sample->evsel; u64 type =3D evsel->core.attr.sample_type; const __u64 *array =3D event->sample.array; bool swapped =3D evsel->needs_swap; @@ -3239,14 +3239,14 @@ int evsel__parse_sample(struct evsel *evsel, union = perf_event *event, data->deferred_cookie =3D event->callchain_deferred.cookie; =20 if (evsel->core.attr.sample_id_all) - perf_evsel__parse_id_sample(evsel, event, data); + perf_evsel__parse_id_sample(event, data); =20 return 0; } =20 if (event->header.type !=3D PERF_RECORD_SAMPLE) { if (evsel->core.attr.sample_id_all) - perf_evsel__parse_id_sample(evsel, event, data); + perf_evsel__parse_id_sample(event, data); return 0; } =20 @@ -3606,12 +3606,13 @@ int evsel__parse_sample_timestamp(struct evsel *evs= el, union perf_event *event, =20 if (event->header.type !=3D PERF_RECORD_SAMPLE) { struct perf_sample data =3D { + .evsel =3D evsel, .time =3D -1ULL, }; =20 if (!evsel->core.attr.sample_id_all) return -1; - if (perf_evsel__parse_id_sample(evsel, event, &data)) + if (perf_evsel__parse_id_sample(event, &data)) return -1; =20 *timestamp =3D data.time; --=20 2.53.0.239.g8d8fc8a987-goog