From nobody Tue Feb 10 23:02:13 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 4C0E838A717 for ; Mon, 9 Feb 2026 17:41:03 +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=1770658863; cv=none; b=FTDK/9Ako0xnslSCrC0LiLn8TC7NOEtECM/HbTwxzi05QUWlDg3BK/hoNrgYHy83z9OvNrwhbQBU3wEKT062Xdsjb2V2JcsWSa0pAVZo0U7djDICvYEXU0KdPRJ2fda56yLKiPuzIgLELysXqNOVp+gFJ0BM34nVgAi/6H9Q35Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770658863; c=relaxed/simple; bh=k0B10vqe9jOWUjfsCOmgZh7z/iVPICHV8GRDiv5o4S0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=nnz/o5eKYN8aCsjuNpw6OIvvqODOYQZ01zonQrtGKpsJVMRZLl428VFc/WY+fIdyxhLTsLdDHGCl4odhocaqTeBvueDzzjOi+HeMxq4WyOnMIqLFtjk+l+XC50GMBwNa+TPSrKqyQ8wTtZ+KMa377RdR8eqe12oTRlVqovzH0sM= 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=aU6l2MyO; 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="aU6l2MyO" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-1270c88d3a8so1784534c88.1 for ; Mon, 09 Feb 2026 09:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770658862; x=1771263662; 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=VUNz5zmybJ28ef0hcd0dh3YV50k0x1YcrzfO9EhfvyU=; b=aU6l2MyO501BIrqlZGEVGTTC1SMW1eVl7/BQo1SP+uBbf1LuaKLNW5AHe4hcdaa85C jnTFI93gTj0HQH7mpg0sVf7v6mYwnCiSUuotYHfFGe4burbxliMVU4uFUpLDbN8HR0Mw 5GIVCNCwr6xLhQnDseKH16hbslGMnYy+CMNbgbltT5gafS2NQ5m+58rywwj8z6JX7NEt rQ6Wly1+2QRIC1N+q4ZrvMQeffsRYJ0t92npGKMYKbDQ+/g3l0OVbYsvf56Ywf5gAT7O q6UAFVAnsa1lzA8iEMx9BvGODyzpk8uO6OUydmCF1/m7ockyNjeczjP4vxNcGKfF+Sa6 Zv2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770658862; x=1771263662; 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=VUNz5zmybJ28ef0hcd0dh3YV50k0x1YcrzfO9EhfvyU=; b=K1vJ8IMjd9kzfF2rgS37ZQHp4ApVHIQ7S/3ZIkYckzyIELWI4cJeDxtnGRhiphyMUS Nf5y93r6EdbSkos6fE6b15zYOkubPp/cPH0gTKZs/NFbBuTMbvlFqymJpSBbJX2qtjQ1 kUmW9SQgXnSAOW+pT9zgUT0dlY00G8mvqoW3a3A4pNOFVbjx6DI3M+xgY8G+jAH7KEip 4ZftnOgNtdv4cc6Ub3Dgyy8Kl/bsg5Kij13/KvySFu5oJlhsZVdnFnM85no/RJijBcOp KRDIHXbgCtCQBQAna9GcaGLUzC4mAO7/y4H6fl04iNUdmQqb26kbLP3OerzRociROSYd fDbw== X-Forwarded-Encrypted: i=1; AJvYcCXA7wi56SCSX+nnWVeQeMUEFUCpLAYi7QDmrZ53zrwY306nZUMbNLQBeiiICyrEVb3wBWnc/dMYRnlntH8=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1A6SQ/33x06neurFONNbkmHcd+uPhJIh8pwopHZNAuqXKk2LJ fgNmWWCsmYx0E9/xbqbBJEUxqV5Q1nDZQIDAd7qM5JHv4NwLCeoHFQlLLFzzrKX5tUNYneRg4hp 4aQlQQiXHyQ== X-Received: from dlw12.prod.google.com ([2002:a05:7022:4c:b0:126:f7ed:3a69]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:f90:b0:122:154:7826 with SMTP id a92af1059eb24-12723425672mr105368c88.3.1770658862390; Mon, 09 Feb 2026 09:41:02 -0800 (PST) Date: Mon, 9 Feb 2026 09:40:16 -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-10-irogers@google.com> Subject: [PATCH v1 09/25] perf lock: Only pass sample to handlers 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 evsel is within the sample and so only the sample needs to be passed. Remove the parameter and fix call site. Signed-off-by: Ian Rogers --- tools/perf/builtin-lock.c | 65 ++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index a35e8ea4e2ef..78fb39d06e7c 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -473,28 +473,22 @@ static struct lock_stat *pop_from_result(void) =20 struct trace_lock_handler { /* it's used on CONFIG_LOCKDEP */ - int (*acquire_event)(struct evsel *evsel, - struct perf_sample *sample); + int (*acquire_event)(struct perf_sample *sample); =20 /* it's used on CONFIG_LOCKDEP && CONFIG_LOCK_STAT */ - int (*acquired_event)(struct evsel *evsel, - struct perf_sample *sample); + int (*acquired_event)(struct perf_sample *sample); =20 /* it's used on CONFIG_LOCKDEP && CONFIG_LOCK_STAT */ - int (*contended_event)(struct evsel *evsel, - struct perf_sample *sample); + int (*contended_event)(struct perf_sample *sample); =20 /* it's used on CONFIG_LOCKDEP */ - int (*release_event)(struct evsel *evsel, - struct perf_sample *sample); + int (*release_event)(struct perf_sample *sample); =20 /* it's used when CONFIG_LOCKDEP is off */ - int (*contention_begin_event)(struct evsel *evsel, - struct perf_sample *sample); + int (*contention_begin_event)(struct perf_sample *sample); =20 /* it's used when CONFIG_LOCKDEP is off */ - int (*contention_end_event)(struct evsel *evsel, - struct perf_sample *sample); + int (*contention_end_event)(struct perf_sample *sample); }; =20 static struct lock_seq_stat *get_seq(struct thread_stat *ts, u64 addr) @@ -563,8 +557,7 @@ static int get_key_by_aggr_mode(u64 *key, u64 addr, return get_key_by_aggr_mode_simple(key, addr, sample->tid); } =20 -static int report_lock_acquire_event(struct evsel *evsel __maybe_unused, - struct perf_sample *sample) +static int report_lock_acquire_event(struct perf_sample *sample) { struct lock_stat *ls; struct thread_stat *ts; @@ -638,8 +631,7 @@ static int report_lock_acquire_event(struct evsel *evse= l __maybe_unused, return 0; } =20 -static int report_lock_acquired_event(struct evsel *evsel __maybe_unused, - struct perf_sample *sample) +static int report_lock_acquired_event(struct perf_sample *sample) { struct lock_stat *ls; struct thread_stat *ts; @@ -704,8 +696,7 @@ static int report_lock_acquired_event(struct evsel *evs= el __maybe_unused, return 0; } =20 -static int report_lock_contended_event(struct evsel *evsel __maybe_unused, - struct perf_sample *sample) +static int report_lock_contended_event(struct perf_sample *sample) { struct lock_stat *ls; struct thread_stat *ts; @@ -762,8 +753,7 @@ static int report_lock_contended_event(struct evsel *ev= sel __maybe_unused, return 0; } =20 -static int report_lock_release_event(struct evsel *evsel __maybe_unused, - struct perf_sample *sample) +static int report_lock_release_event(struct perf_sample *sample) { struct lock_stat *ls; struct thread_stat *ts; @@ -963,8 +953,7 @@ static u64 *get_callstack(struct perf_sample *sample, i= nt max_stack) return callstack; } =20 -static int report_lock_contention_begin_event(struct evsel *evsel __maybe_= unused, - struct perf_sample *sample) +static int report_lock_contention_begin_event(struct perf_sample *sample) { struct lock_stat *ls; struct thread_stat *ts; @@ -1127,8 +1116,7 @@ static int report_lock_contention_begin_event(struct = evsel *evsel __maybe_unused return 0; } =20 -static int report_lock_contention_end_event(struct evsel *evsel __maybe_un= used, - struct perf_sample *sample) +static int report_lock_contention_end_event(struct perf_sample *sample) { struct lock_stat *ls; struct thread_stat *ts; @@ -1208,45 +1196,45 @@ static struct trace_lock_handler contention_lock_op= s =3D { =20 static struct trace_lock_handler *trace_handler; =20 -static int evsel__process_lock_acquire(struct evsel *evsel, struct perf_sa= mple *sample) +static int evsel__process_lock_acquire(struct perf_sample *sample) { if (trace_handler->acquire_event) - return trace_handler->acquire_event(evsel, sample); + return trace_handler->acquire_event(sample); return 0; } =20 -static int evsel__process_lock_acquired(struct evsel *evsel, struct perf_s= ample *sample) +static int evsel__process_lock_acquired(struct perf_sample *sample) { if (trace_handler->acquired_event) - return trace_handler->acquired_event(evsel, sample); + return trace_handler->acquired_event(sample); return 0; } =20 -static int evsel__process_lock_contended(struct evsel *evsel, struct perf_= sample *sample) +static int evsel__process_lock_contended(struct perf_sample *sample) { if (trace_handler->contended_event) - return trace_handler->contended_event(evsel, sample); + return trace_handler->contended_event(sample); return 0; } =20 -static int evsel__process_lock_release(struct evsel *evsel, struct perf_sa= mple *sample) +static int evsel__process_lock_release(struct perf_sample *sample) { if (trace_handler->release_event) - return trace_handler->release_event(evsel, sample); + return trace_handler->release_event(sample); return 0; } =20 -static int evsel__process_contention_begin(struct evsel *evsel, struct per= f_sample *sample) +static int evsel__process_contention_begin(struct perf_sample *sample) { if (trace_handler->contention_begin_event) - return trace_handler->contention_begin_event(evsel, sample); + return trace_handler->contention_begin_event(sample); return 0; } =20 -static int evsel__process_contention_end(struct evsel *evsel, struct perf_= sample *sample) +static int evsel__process_contention_end(struct perf_sample *sample) { if (trace_handler->contention_end_event) - return trace_handler->contention_end_event(evsel, sample); + return trace_handler->contention_end_event(sample); return 0; } =20 @@ -1424,8 +1412,7 @@ static int process_event_update(const struct perf_too= l *tool, return 0; } =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, @@ -1445,7 +1432,7 @@ static int process_sample_event(const struct perf_too= l *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