From mboxrd@z Thu Jan 1 00:00:00 1970 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 757623043CE for ; Wed, 20 May 2026 19:06:06 +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=1779303968; cv=none; b=JLaqF6s5pdPMhaNVM/34VVL9Nh+O9g7g7g6styVcKERjpqd5XwfxDLT8+97p1Em3pgXCf2XX2zJHEsIVnK6AvyqR9j5jJPWR+QIYxnzQ4brTq9h+zY1sjhOcRbkJ/tycRCfpD6eYt61spL4kzOib3Kad/wo7AWNXFc7/fFj5MVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779303968; c=relaxed/simple; bh=S2e9RZWnJAjOM4rZRaq5ZVrCHlUyK8omjHSzaihuZj0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=KCzKByXmVCM9X69hQoK2pbIo/HEiJIwR3ZdLwwTisDtCIf5lqvOGqbAVygaxWK87oKpF9ru8Ki6p8ZgGrT6IXQ05POAfLaVEp+3NbmX0l9JOsaXN0AH1Dmr6bvlwOrPOKQ39VAjTf1ue/bRul8Xd64gM4Kul2MBlQZH3ciJjt9k= 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=vQtMnYCM; 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="vQtMnYCM" Received: by mail-dl1-f73.google.com with SMTP id a92af1059eb24-1353a6f29deso2297944c88.1 for ; Wed, 20 May 2026 12:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779303965; x=1779908765; 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=KtZTnSUx4EyEfsBoIiFYlWWQdtWvpt94k7BNBsYS7+E=; b=vQtMnYCMQ6WB5tQ6LMd8fXv8gaSAyMnQcTv1vWWEblxn63OI/lrVU73MtICft/INRe b4TqMr1q7AY7cQ3t2tuUTE3sqgzM3vxmJcqgp6ZX9zyzaBZ8Ppw6CK3VKkyAxYFuQGcH pBXpxCI0skfdbgM/Ls3K35DhC8M0kcrUUTzq6NSDAa6MK/Ks4IiFNmOKWkv0NH6TEhku e3AWYCTcAs4mwLW2d7wvrkk0fiR8LO7NeO6We1JswngIgt+WqPAyI1sBgHyNlFulC+qC SDQEIFZoYosBtiBtkCLHW/ftDSEFeqob2fjoILJA3187ahkVH3Y96JPOv6oFx5++BoAt rR/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779303965; x=1779908765; 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=KtZTnSUx4EyEfsBoIiFYlWWQdtWvpt94k7BNBsYS7+E=; b=dJi2JabWkLPBFi+PWnkTMbKSTfL5e8vRMkRxhzhvvd+7khCIFC33SHR2gmgV+fm4B7 8jot2MGcVbgAu00Nx0qPK3XL2e3h7N5dFVfwFyazaxYmW4yTfLi4xbTRcrlbzo75p03C 4haXpbL5fbKwa+eO4rdfIqmgUKUZEgb/t/1YVv667ybiPqTh0I6jEt+hyF0DFKV7DS5N kN7AdG8xM+lIr267pZSULPk6/O3+5YswgO4btE282kf7t47dKedT3Nu1++c07DAYl8yt g1zW4fKScIYX92wXd/8Lb8QNC8bOrfvaImJ5meBtC2J9edblX1AxP3Id2QKYDVZNSOjY BQ7A== X-Forwarded-Encrypted: i=1; AFNElJ8QjzttQoVOVGRcGWEff0Ytlpe1CMalQMdZarubTuoDfaudIdCgF7LO5MtOV4JQtXjvotKUrhQpi+h1MX0=@vger.kernel.org X-Gm-Message-State: AOJu0YwufvQ1XC4E2XLN4xO62B9/wKcHx5xRYj0C15gLjy2Ow5prwAOu /j45CZoIEeRXzKDzgqDMk1ncMxUZaev7tHURE3bn+mB1v3tM3A4KjSHGqX9Bi0m6cJL4a0vS11s OWk8nuXRw2A== X-Received: from dlbsj5.prod.google.com ([2002:a05:7022:f905:b0:135:f8d1:1804]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:f313:b0:135:d931:bed8 with SMTP id a92af1059eb24-135d931bf98mr2246701c88.25.1779303965159; Wed, 20 May 2026 12:06:05 -0700 (PDT) Date: Wed, 20 May 2026 12:05:17 -0700 In-Reply-To: <20260520190538.142018-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: <20260512223001.2952848-1-irogers@google.com> <20260520190538.142018-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.746.g67dd491aae-goog Message-ID: <20260520190538.142018-12-irogers@google.com> Subject: [PATCH v14 11/32] perf annotate: Don't pass evsel to add_sample From: Ian Rogers To: irogers@google.com, acme@kernel.org, namhyung@kernel.org Cc: 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" As struct perf_sample now directly contains its own resolved evsel pointer, passing the evsel separately is redundant and clutters the interface. Remove the redundant evsel parameter from annotate-specific handlers and structures, ensuring the tool always directly accesses the evsel bound to the sample. This simplifies the API signatures and eliminates the risk of passing an inconsistent evsel. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim --- tools/perf/builtin-annotate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 6f8be9ead43b..719b36d4eed5 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -232,11 +232,11 @@ static bool has_annotation(struct perf_annotate *ann) return ui__has_annotation() || ann->use_stdio2; } -static int evsel__add_sample(struct evsel *evsel, struct perf_sample *sample, - struct addr_location *al, struct perf_annotate *ann, - struct machine *machine) +static int add_sample(struct perf_sample *sample, + struct addr_location *al, struct perf_annotate *ann, + struct machine *machine) { - struct hists *hists = evsel__hists(evsel); + struct hists *hists = evsel__hists(sample->evsel); struct hist_entry *he; int ret; @@ -298,7 +298,7 @@ static int process_sample_event(const struct perf_tool *tool, goto out_put; if (!al.filtered && - evsel__add_sample(sample->evsel, sample, &al, ann, machine)) { + add_sample(sample, &al, ann, machine)) { pr_warning("problem incrementing symbol count, " "skipping event\n"); ret = -1; -- 2.54.0.746.g67dd491aae-goog