From nobody Wed Feb 11 04:49:02 2026 Received: from mail-dl1-f73.google.com (mail-dl1-f73.google.com [74.125.82.73]) (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 49D2338F223 for ; Mon, 9 Feb 2026 17:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770658880; cv=none; b=SrcrVtxj2uxUKqbvXwy7Cueu15TsOgirh54Lfm4MfyQEVSoWEjwLslFzac1HtXqqzBYK9ACTYZBhOVEmULY+m4BV29K6smwB6aB/wJrBbKr3W7ZhwfStd0qqEQs9Ss3ObxvqYUpVUrB63IWaxfisUZHvfb2w29jfovIPSeWbbDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770658880; c=relaxed/simple; bh=MzCMUvXhmBryqIwMYn7rRj8P3JAKVugjSx7E9EUBNEw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=qgcgZoY1DTlwYD3QG8O6FC+iAluUv5OzFgOFPw0qh/MmOzFfEUYJaei6LLplfuOKuMyg5GR6synDt+Fs3CifSh0D+/JSS9LhesiobKQoEY8P1RXVdeCz27GxK6xF66yGQZbiMEFO1mAP2pYGBJ4GaOWHhvGRUcBZKcx2PwgGm/g= 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=VrGdh+KO; arc=none smtp.client-ip=74.125.82.73 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="VrGdh+KO" Received: by mail-dl1-f73.google.com with SMTP id a92af1059eb24-1270dcd11c1so2746021c88.0 for ; Mon, 09 Feb 2026 09:41:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770658879; x=1771263679; 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=4NKgpa+d3dNYoS1EWG0BNepes/WG+gnWoeIPZ97YIX4=; b=VrGdh+KO6rSccmXUxRIQn+rntpMdhkrCZCEgQ1o9NFaMMvj94CpkW6uZgTTS6EZgOA 3wKcQnFKrEMk3LBnmh7WxznevzyNc1fsvDkQip03XDrthK4bwo/RGrwvCn4U0IcQ7/04 uWgE/6Xz+7bJjLvwwh9RjjvYbTY7tMkUsS/9QHSBeYdtEvLT2U75DFJgteEQLviUl2oh eRDREGKMEP1lC7wr0fDiT7AsnnmDrRG2OmSWwj9Ot6njlRlGrWleyo+f9Ube6soxkwqa trqrVigr+zxAkYFumc4o9zpGJ0DYYdJGVGgCa7DEJmskUHBwteVDDLmV8vd47kp05FHr 8/cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770658879; x=1771263679; 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=4NKgpa+d3dNYoS1EWG0BNepes/WG+gnWoeIPZ97YIX4=; b=E1JPxhlJi1AoTZdUlN838xkJFybjItGAlLrTVazNk8fY0Dzg3SSeoNC4RX1+3jYNnb z5Eio8GWx+4QBTdS11HrAVeXdyUmKQCyv779ReUfqyHMvynGl0eGEYef1/i+T2gE/hGT z68boDAzq13PjV+JwgeJ8/AiMbzTaVZe13DE2Ic08ycxic6VhyCdEvidTlVkM5GvlrPI pqkrmtQ2g5OZWTNlnaEtcFPxzVsl141aJ1ZKWvdutkMmA7m1AQ0MnDIEfsxaHp47OqVJ PKMa5aQfbfiohkEB3b1ks0QjYOjWlDEteQ8tnIRpuWvlVr4EuenXt6lUIL3Dq/WLSC7T 5WaA== X-Forwarded-Encrypted: i=1; AJvYcCU05UpmmfBmLuVkZ9CV5SYBRDpcK67DMMbM5wex3ghyLwbn59xtCgScpcN09+N7+LTzt7KFMt6V+0PSlMY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyx/aUqYdu7os/NgJSNbPCJyMXfnrlO1jBmXxJvaXR4Uny6LBlQ vhFqzUie1Y+A9rqcFBOL296Nlu/qCDKnS0RtPbP7q+qMEmSU4Y/QtLUxoi6YtH6bNrMMzZ95e0s cG1Vm5Fb/MA== X-Received: from dlbou24.prod.google.com ([2002:a05:7022:1118:b0:11d:cde5:d78e]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:419c:b0:119:e56b:98bf with SMTP id a92af1059eb24-12704059fc5mr5538242c88.38.1770658879285; Mon, 09 Feb 2026 09:41:19 -0800 (PST) Date: Mon, 9 Feb 2026 09:40:24 -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-18-irogers@google.com> Subject: [PATCH v1 17/25] perf kmem: 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" The sample contains the evsel and so it is unnecessary to pass the evsel as well. Signed-off-by: Ian Rogers --- tools/perf/builtin-kmem.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 19b12209fc08..ea2437971e8b 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -171,7 +171,7 @@ static int insert_caller_stat(unsigned long call_site, return 0; } =20 -static int evsel__process_alloc_event(struct evsel *evsel, struct perf_sam= ple *sample) +static int evsel__process_alloc_event(struct perf_sample *sample) { unsigned long ptr =3D perf_sample__intval(sample, "ptr"), call_site =3D perf_sample__intval(sample, "call_site"); @@ -198,7 +198,7 @@ static int evsel__process_alloc_event(struct evsel *evs= el, struct perf_sample *s * If the tracepoint contains the field "node" the tool stats the * cross allocation. */ - if (evsel__field(evsel, "node")) { + if (evsel__field(sample->evsel, "node")) { int node1, node2; =20 node1 =3D cpu__get_node((struct perf_cpu){.cpu =3D sample->cpu}); @@ -243,7 +243,7 @@ static struct alloc_stat *search_alloc_stat(unsigned lo= ng ptr, return NULL; } =20 -static int evsel__process_free_event(struct evsel *evsel __maybe_unused, s= truct perf_sample *sample) +static int evsel__process_free_event(struct perf_sample *sample) { unsigned long ptr =3D perf_sample__intval(sample, "ptr"); struct alloc_stat *s_alloc, *s_caller; @@ -751,8 +751,7 @@ static char *compact_gfp_string(unsigned long gfp_flags) return NULL; } =20 -static int parse_gfp_flags(struct evsel *evsel, struct perf_sample *sample, - unsigned int gfp_flags) +static int parse_gfp_flags(struct perf_sample *sample, unsigned int gfp_fl= ags) { struct tep_record record =3D { .cpu =3D sample->cpu, @@ -773,7 +772,7 @@ static int parse_gfp_flags(struct evsel *evsel, struct = perf_sample *sample, } =20 trace_seq_init(&seq); - tp_format =3D evsel__tp_format(evsel); + tp_format =3D evsel__tp_format(sample->evsel); if (tp_format) tep_print_event(tp_format->tep, &seq, &record, "%s", TEP_PRINT_INFO); =20 @@ -805,7 +804,7 @@ static int parse_gfp_flags(struct evsel *evsel, struct = perf_sample *sample, return 0; } =20 -static int evsel__process_page_alloc_event(struct evsel *evsel, struct per= f_sample *sample) +static int evsel__process_page_alloc_event(struct perf_sample *sample) { u64 page; unsigned int order =3D perf_sample__intval(sample, "order"); @@ -836,7 +835,7 @@ static int evsel__process_page_alloc_event(struct evsel= *evsel, struct perf_samp return 0; } =20 - if (parse_gfp_flags(evsel, sample, gfp_flags) < 0) + if (parse_gfp_flags(sample, gfp_flags) < 0) return -1; =20 callsite =3D find_callsite(sample); @@ -877,8 +876,7 @@ static int evsel__process_page_alloc_event(struct evsel= *evsel, struct perf_samp return 0; } =20 -static int evsel__process_page_free_event(struct evsel *evsel __maybe_unus= ed, - struct perf_sample *sample) +static int evsel__process_page_free_event(struct perf_sample *sample) { u64 page; unsigned int order =3D perf_sample__intval(sample, "order"); @@ -955,8 +953,7 @@ static bool perf_kmem__skip_sample(struct perf_sample *= sample) return false; } =20 -typedef int (*tracepoint_handler)(struct evsel *evsel, - struct perf_sample *sample); +typedef int (*tracepoint_handler)(struct perf_sample *sample); =20 static int process_sample_event(const struct perf_tool *tool __maybe_unuse= d, union perf_event *event, @@ -981,7 +978,7 @@ static int process_sample_event(const struct perf_tool = *tool __maybe_unused, =20 if (evsel->handler !=3D NULL) { tracepoint_handler f =3D evsel->handler; - err =3D f(evsel, sample); + err =3D f(sample); } =20 thread__put(thread); --=20 2.53.0.239.g8d8fc8a987-goog