From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (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 F26E137DE81 for ; Mon, 13 Apr 2026 04:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776053542; cv=none; b=QpWU2OWGu3bSuFO26xX0ukZMnwWSuxrPzw4LHJgAFI59wxCw7w+BePCWLMF+Nt3d+nx8ETIeLCalqbfGQ+LNjTsVGhByIfcup8xmHz2x1I/wFjlPogTplsgE0UWHTMKpEommWcmfeRCLdfNN7Ciq5D/BYYnr6ImU6EckBNNGUSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776053542; c=relaxed/simple; bh=iQzrrSkgD5q24jleWyjN1o5X5X3t72d6WQTerHN5aeA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Ztf/l27fjNYNsOg3v6rZqKl3esynfgfEr3kIXtxyw3YIDJkJHPE7uk/mrnAYD29/NAwsm9LU0Hy1G+YirE3/7EU3HChsb4ytbIqhkvCXvg4hVlyN/NY2i7iOqiMLcYw+pHyEIK46NusOqOe3DjyOXqyQQrMAoLLbLXmZSRZwey4= 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=A83WhHKF; arc=none smtp.client-ip=74.125.82.201 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="A83WhHKF" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2cc75e79b97so14278297eec.1 for ; Sun, 12 Apr 2026 21:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776053533; x=1776658333; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=jOx0vm5n0Y9FX3aCuWOTcby7VnTaMh5tBI/U2Q+kw/k=; b=A83WhHKFhXKUmSzyaO5BRkEfZYCZy+2f0dKiYgUowbzEyoZCAFEMmEaqFjaU/yWtEy G5OVdpAaPea/A85mYEcQ3XnZr7WBRjqOF8N3v9oDKpucbszeLeNdehVD4y0o8GgVE97S k1Rn/wChZwRg7ICcP3nGcFQDWh8D3Ys56YrCy9XAUTPezJVkfCjmwh6kpBn29d6wPtP9 jmOo/HF9sDKpQuZMKInZwdYTuxEG6L792+Rf3TZJ73rIRI7L7ttwSHXYfRZ8njP8yumD TRN/Uh89h56ajEi1EDZ5WAAiVn3mC2dHpYXJlM8D4wem/UvGYv1wuhKBGEEuXZQZBssy sg9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776053533; x=1776658333; h=cc: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=jOx0vm5n0Y9FX3aCuWOTcby7VnTaMh5tBI/U2Q+kw/k=; b=I+QLMAk01YzbeRasM5tWjAZNR82UEuPor9OSsACGrsMLqucM/BCGxDY0J6FIC+9Iqy 38Dmp23jXFyz5UESVdi2RJszuu+3nVqtr2s6OH4NgPy9VOCkoKWIgFBfyOT1RqHpadLw GidBnS6RbW06rDkynoZUDB1EDWGWosbuS3I8NfDLNv7L5QGSSSoqPw3dMuoQS8ii6YD0 WpvKhFlkZPlh9abxhWGdonmVrEXxmW6mE9y4snD+DFEOT36XyRaS36o6Ypr5PJnu578B +ZQ2PRMTP5RG6QG3KXSK0y71Kadilp497xvOvx3guMzNmyQjrixd0jsrgVEZCj1eC9Uo wbOA== X-Forwarded-Encrypted: i=1; AFNElJ/2d+fmNS9M62BtPC5sm04plXLsT/BmtykhRLDmZWQDlFMU414fg6bzVzsnnRwdzXqcsP9KpaFGzVLLXBFv1mUJ@vger.kernel.org X-Gm-Message-State: AOJu0Yywb3i+lzxCRZm4WzX3P003U/U/JqhWs+o1VNq4ocpwqHDferzy TGZ5eDqx5LdqX7n9024bW0HeETxQOyC61K0h8srgrLGWED+31QoScUgQqX3dAoelYbPIpnYxHaz FlD9lbwomFA== X-Received: from dycnm7.prod.google.com ([2002:a05:7300:d187:b0:2d8:fc66:cd7b]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:3247:b0:2c7:3a7:c7a7 with SMTP id 5a478bee46e88-2d5898aa87dmr5815087eec.25.1776053533011; Sun, 12 Apr 2026 21:12:13 -0700 (PDT) Date: Sun, 12 Apr 2026 21:11:17 -0700 In-Reply-To: <20260413041143.1736055-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260413012227.1089445-1-irogers@google.com> <20260413041143.1736055-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.1213.gd9a14994de-goog Message-ID: <20260413041143.1736055-8-irogers@google.com> Subject: [PATCH v12 07/33] perf lock: Only pass sample to handlers From: Ian Rogers To: namhyung@kernel.org Cc: irogers@google.com, acme@kernel.org, adrian.hunter@intel.com, ajones@ventanamicro.com, ak@linux.intel.com, alex@ghiti.fr, alexander.shishkin@linux.intel.com, anup@brainfault.org, aou@eecs.berkeley.edu, atrajeev@linux.ibm.com, blakejones@google.com, ctshao@google.com, dapeng1.mi@linux.intel.com, derek.foreman@collabora.com, dvyukov@google.com, howardchu95@gmail.com, hrishikesh123s@gmail.com, james.clark@linaro.org, jolsa@kernel.org, krzysztof.m.lopatowski@gmail.com, leo.yan@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux@treblig.org, mingo@redhat.com, nichen@iscas.ac.cn, palmer@dabbelt.com, peterz@infradead.org, pjw@kernel.org, ravi.bangoria@amd.com, swapnil.sapkal@amd.com, tanze@kylinos.cn, thomas.falcon@intel.com, tianyou.li@intel.com, yujie.liu@intel.com, zhouquan@iscas.ac.cn 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 e2b585e528ac..b6533483ba64 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) 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); /* 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); /* 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); /* it's used on CONFIG_LOCKDEP */ - int (*release_event)(struct evsel *evsel, - struct perf_sample *sample); + int (*release_event)(struct perf_sample *sample); /* 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); /* 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); }; 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); } -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 *evsel __maybe_unused, return 0; } -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 *evsel __maybe_unused, return 0; } -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 *evsel __maybe_unused, return 0; } -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, int max_stack) return callstack; } -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; } -static int report_lock_contention_end_event(struct evsel *evsel __maybe_unused, - 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_ops = { static struct trace_lock_handler *trace_handler; -static int evsel__process_lock_acquire(struct evsel *evsel, struct perf_sample *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; } -static int evsel__process_lock_acquired(struct evsel *evsel, struct perf_sample *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; } -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; } -static int evsel__process_lock_release(struct evsel *evsel, struct perf_sample *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; } -static int evsel__process_contention_begin(struct evsel *evsel, struct perf_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; } -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; } @@ -1424,8 +1412,7 @@ static int process_event_update(const struct perf_tool *tool, return 0; } -typedef int (*tracepoint_handler)(struct evsel *evsel, - struct perf_sample *sample); +typedef int (*tracepoint_handler)(struct perf_sample *sample); static int process_sample_event(const struct perf_tool *tool __maybe_unused, union perf_event *event, @@ -1445,7 +1432,7 @@ static int process_sample_event(const struct perf_tool *tool __maybe_unused, if (evsel->handler != NULL) { tracepoint_handler f = evsel->handler; - err = f(evsel, sample); + err = f(sample); } thread__put(thread); -- 2.53.0.1213.gd9a14994de-goog