From nobody Mon Apr 6 23:07:16 2026 Received: from mail-dy1-f202.google.com (mail-dy1-f202.google.com [74.125.82.202]) (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 2B5A437EFF5 for ; Tue, 17 Mar 2026 17:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773770215; cv=none; b=LpZTYgUP9lH36i0BLqbjqHVAvKVyuZ97SeHcyWxxx/v+NInB7tzC47OI6KdVt5fXQ68qrwnHOKw5ub2Zb9n7KTBUZLLSsQ2cLwZkCa1RHBD+2YRSRGp6TMoM1ti696EInKWceHmLdMfa0Yakszc8BQfehYjSSyEpakBcbWz8S9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773770215; c=relaxed/simple; bh=YnHls8NIVjy5Ei7a4hKc1qV28zK+UaZo7VK2CAN8c3w=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=LuFxnzjv0uRd4yRExxsHl4bTVzeInFwYcvv/xsE+Sa9OenIyQYXfL3smcYIj/OfJbznFTUF1AaHQfE8CPoW+2OT8NbXpbsmKJKTIXbwB2u4TKjaGZ6s5HffFI3qKnZZF6RpMB/PEku0HZ+8Lvr1jpQFUUbJ7k4+AqYisKwHfwWA= 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=ougIvL7E; arc=none smtp.client-ip=74.125.82.202 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="ougIvL7E" Received: by mail-dy1-f202.google.com with SMTP id 5a478bee46e88-2bead0a9123so2072885eec.1 for ; Tue, 17 Mar 2026 10:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773770213; x=1774375013; 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=4sR/GkKKCK4vlTKAx1HdQnSDfMDIglmN+8LdctHHquI=; b=ougIvL7E76jUUfEYd6e7fJILp0+C/OSnnajGRqFkDULtrsMdv9Ye9fa+d3tFzPax6k rDSSFnkeL3ENi42CMnc63O/unAJkXTl7yOODBg32tgWWqDmYxm/RUt2GCVR52NPFEs6E 7BDRCoku1sj+PS2QzqWHRl+IGOR8/gQebwRrRDHyPkPnllfPGwZVio9D/MWCVXsVqSSa w00Bo/2fdBiVx+7qJrAxL9+Wo1n5Vd/zWN83fZzig5mtMHPqTeJK4T+fU4RVFFSV7crQ yObJg3n/HIPZFUaVnBNQAJoW6xIGaMxasU/L8Ib70KlVI3W9y7ulo5QsHHC5whqF0AbA OswA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773770213; x=1774375013; 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=4sR/GkKKCK4vlTKAx1HdQnSDfMDIglmN+8LdctHHquI=; b=ALIL0GoZH7XPi5U6G5NvDIWuQNcKTj4TGbF9WOd/s6tiPbEIKbfj8ZGI+KxpjwV69h zKwJmSlTYq4iGHEFsqSRVZVs/E/t4oG5HFpRcXC0gq3iDLXHXiWVvb2jrzXpzXEKBf2x gq8hB27c5KVKwz3+NWl2Tcu5mxiS+1ZrotVu9WSNUX1+E1A1MwYR6BxA6OJwfAFUQUE9 sMmcCZ6J1zL3zW94OAHVteBmcAYJRQjrsnx2MQYQ52XmcKPBecQZbL08uy4+OU+9EgEo Qz5Buh9hrOxSuMg8yJVmG5fVNLCQuk8E788PVkwggubc+8wxbUgGf/ygICs17Y3qmauB Lsmw== X-Forwarded-Encrypted: i=1; AJvYcCUHzp2sJR5YkqRs87KZGCA/RupUhtAkAqb83mNNSHB8XGm4axKn6zOfoDZp+FefmVyNedhnuqh4SCFglJg=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2QKORqx8qvi6I5ya/zosCT1zSVTPqMUF7jVgLV2CZPT4WraO+ +PbDzl3NgjiZqaihg0JmYPbNc7137nf7YPsjQ2BVm+vxnfg/SCW71jBMNREuZ1t53Z2OlzULTI2 YuIBTrhv3kw== X-Received: from dycmh3.prod.google.com ([2002:a05:693c:2583:b0:2be:2e48:5d13]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:dc87:b0:2bd:dd33:7996 with SMTP id 5a478bee46e88-2c0e503eb8amr177097eec.19.1773770213078; Tue, 17 Mar 2026 10:56:53 -0700 (PDT) Date: Tue, 17 Mar 2026 10:56:40 -0700 In-Reply-To: <20260317175642.161647-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: <20260317175642.161647-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.851.ga537e3e6e9-goog Message-ID: <20260317175642.161647-4-irogers@google.com> Subject: [PATCH v6 3/5] perf evsel: Constify option arguments to config functions From: Ian Rogers To: tmricht@linux.ibm.com Cc: irogers@google.com, acme@kernel.org, agordeev@linux.ibm.com, gor@linux.ibm.com, hca@linux.ibm.com, japo@linux.ibm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-s390@vger.kernel.org, namhyung@kernel.org, sumanthk@linux.ibm.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The options are used to configure the evsel but are not themselves configured. Make the arguments const to better capture this. Signed-off-by: Ian Rogers --- tools/perf/util/evsel.c | 20 ++++++++++---------- tools/perf/util/evsel.h | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index bd14d9bbc91f..54c8922a8e47 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1015,8 +1015,8 @@ uint16_t evsel__e_machine(struct evsel *evsel, uint32= _t *e_flags) return perf_session__e_machine(session, e_flags); } =20 -static void __evsel__config_callchain(struct evsel *evsel, struct record_o= pts *opts, - struct callchain_param *param) +static void __evsel__config_callchain(struct evsel *evsel, const struct re= cord_opts *opts, + const struct callchain_param *param) { bool function =3D evsel__is_function_event(evsel); struct perf_event_attr *attr =3D &evsel->core.attr; @@ -1080,14 +1080,14 @@ static void __evsel__config_callchain(struct evsel = *evsel, struct record_opts *o attr->defer_callchain =3D 1; } =20 -void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, - struct callchain_param *param) +void evsel__config_callchain(struct evsel *evsel, const struct record_opts= *opts, + const struct callchain_param *param) { if (param->enabled) return __evsel__config_callchain(evsel, opts, param); } =20 -static void evsel__reset_callgraph(struct evsel *evsel, struct callchain_p= aram *param) +static void evsel__reset_callgraph(struct evsel *evsel, const struct callc= hain_param *param) { struct perf_event_attr *attr =3D &evsel->core.attr; =20 @@ -1106,7 +1106,7 @@ static void evsel__reset_callgraph(struct evsel *evse= l, struct callchain_param * =20 static void evsel__apply_ratio_to_prev(struct evsel *evsel, struct perf_event_attr *attr, - struct record_opts *opts, + const struct record_opts *opts, const char *buf) { struct perf_event_attr *prev_attr =3D NULL; @@ -1170,7 +1170,7 @@ static void evsel__apply_ratio_to_prev(struct evsel *= evsel, } =20 static void evsel__apply_config_terms(struct evsel *evsel, - struct record_opts *opts, bool track) + const struct record_opts *opts, bool track) { struct evsel_config_term *term; struct list_head *config_terms =3D &evsel->config_terms; @@ -1445,7 +1445,7 @@ void __weak arch_evsel__apply_ratio_to_prev(struct ev= sel *evsel __maybe_unused, { } =20 -static void evsel__set_default_freq_period(struct record_opts *opts, +static void evsel__set_default_freq_period(const struct record_opts *opts, struct perf_event_attr *attr) { if (opts->freq) { @@ -1490,8 +1490,8 @@ bool evsel__is_offcpu_event(struct evsel *evsel) * enable/disable events specifically, as there's no * initial traced exec call. */ -void evsel__config(struct evsel *evsel, struct record_opts *opts, - struct callchain_param *callchain) +void evsel__config(struct evsel *evsel, const struct record_opts *opts, + const struct callchain_param *callchain) { struct evsel *leader =3D evsel__leader(evsel); struct perf_event_attr *attr =3D &evsel->core.attr; diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 97f57fab28ce..339b5c08a33d 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -287,10 +287,10 @@ void evsel__set_priv_destructor(void (*destructor)(vo= id *priv)); =20 struct callchain_param; =20 -void evsel__config(struct evsel *evsel, struct record_opts *opts, - struct callchain_param *callchain); -void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, - struct callchain_param *callchain); +void evsel__config(struct evsel *evsel, const struct record_opts *opts, + const struct callchain_param *callchain); +void evsel__config_callchain(struct evsel *evsel, const struct record_opts= *opts, + const struct callchain_param *callchain); =20 int __evsel__sample_size(u64 sample_type); void evsel__calc_id_pos(struct evsel *evsel); --=20 2.53.0.851.ga537e3e6e9-goog