From mboxrd@z Thu Jan 1 00:00:00 1970 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 E042A41166D for ; Mon, 15 Jun 2026 16:50:21 +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=1781542224; cv=none; b=aSr/iJ0cckGd8a1JPL9GSxWI318IKI+AUUcOHQx/xAgfkuyzdLau9+/dy3CmdyOFI1uoZqmc0Dc/b7i7n4Fdb/k10vYTHtRvNaDTZ+1W26dEF79b7+Iq440NbfGGbf5gJRDMSZf4MxmlZSk+1BPql78zxYuLacXfgKE21IP+65I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781542224; c=relaxed/simple; bh=JSfVdaFgVT+16BkkuKzKlIjgGUMwUVUUeSc4uGtnw10=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cR1eallxqHpV1JoxAbsxczAJzKuFBTBtlw38Pk2SWZNMQP7qazoAvz7wi6wFe3xDMlh4KxFDsC8XCdBZmCShw60VpMS4q8IP2zA85gHgw0Cx70ITwgMnNBFluGkRybzbjt/t1GNHOE9/G8IEtP4S5r4+Ubxk4XDtViv814B6UBc= 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=PlS5eL4i; 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="PlS5eL4i" Received: by mail-dy1-f202.google.com with SMTP id 5a478bee46e88-304df51ff3eso7608949eec.0 for ; Mon, 15 Jun 2026 09:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781542221; x=1782147021; 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=lq0ALMVaEZfhSbzg5O+HM/S6tJqN1Cgs4e0hJ55fARY=; b=PlS5eL4i5T+HsBHhns/T1GHZmJrhZE+hXJuH6u8YP9EoK0+FWRzc+TNiqYoFkHTOz9 fuwAmIRwR+0aCQGc8teebwQNerp/2GapMPdmvQvba2woZI2mta15Yk0wtvIjxpuEQnzO EcbiEl9Xx62LN184CweDX7ATvA4D6XMyD0giRdlFXFmYkPIylf7mYH6KJ5LJAHJ3tcCM X2lKluZmKjul0kSmfioTg0/et+4/LfMnidUILBS1Hm2+qzlaQvViAiqx3Q6Az5Gpop9J OGyXhEfRJbJAlzJ+YTXyxrN4bFu++HmGyd5NZF9s8yEb6g6P+p/pk8W7DunAr2+FEhnT EV2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781542221; x=1782147021; 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=lq0ALMVaEZfhSbzg5O+HM/S6tJqN1Cgs4e0hJ55fARY=; b=Qv39Djr4p7P+jSL/AS5cC9dJNqjjF/7iv4CO0geZGHW5Go3L//PqGZRlx3QruXlfgJ oqYiajKK3AmQoF0G5wAbzHazc8/db3QxscE+yRI8J/3gCu0JHTGbj6wr9Lq2KkXWdxcd OCN5qW775PdkCrEniGYYaEhONtzOpMGMinfJlqWIepZcBNXEqt9hvvO+rpc3kIi4MQdB f5OPnK3+CXfvOeCe4/um5YQU4JhFzzsnkCkH4Gi7Ai90aAGOHrhITkHN8Y+Gcu458ond wk3FoDlxZtCq4V1HRpKmOgwGcqfu2kWyrPVlPpZ3OS2n/BEfHt2t/HBnw12w3mzkGYu7 5kOw== X-Forwarded-Encrypted: i=1; AFNElJ+r8zmJp9g8vxAG39nRgCxGnohtDlReLcqyMVCzUSwrpP/36fNAUu2MhkEgb/idQZRO4YVcR6rdHQFgINw=@vger.kernel.org X-Gm-Message-State: AOJu0Yzd99bnWdQN+wf5lNchuskKXcN1lb3P26aFMwDIHo9EQmVjRAhL ejXo+JkgJ1nj0nouG5p6ry9+nfW+QG0S9QzISiqn//ZH0+V8QUTeGsw6iQG1Lf3+kJLaSwCVd2o g0xUdsy5UFw== X-Received: from dydn14.prod.google.com ([2002:a05:7300:730e:b0:2f9:af7:5041]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:f10a:b0:307:91f5:92e2 with SMTP id 5a478bee46e88-3081ff4b659mr8193908eec.4.1781542220454; Mon, 15 Jun 2026 09:50:20 -0700 (PDT) Date: Mon, 15 Jun 2026 09:49:53 -0700 In-Reply-To: <20260615165010.2724690-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: <20260615061631.2382079-1-irogers@google.com> <20260615165010.2724690-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.1136.gdb2ca164c4-goog Message-ID: <20260615165010.2724690-4-irogers@google.com> Subject: [PATCH v19 03/20] perf evsel/evlist: Avoid unnecessary #includes From: Ian Rogers To: irogers@google.com, acme@kernel.org, namhyung@kernel.org Cc: adrian.hunter@intel.com, alice.mei.rogers@gmail.com, dapeng1.mi@linux.intel.com, james.clark@linaro.org, leo.yan@linux.dev, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, tmricht@linux.ibm.com Content-Type: text/plain; charset="UTF-8" Use forward declarations and remove unnecessary #includes in evsel.h. Sort the forward declarations in evsel.h and evlist.h. Move some PMU code into evsel.c. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim --- tools/perf/util/evlist.h | 15 +++++++++------ tools/perf/util/evsel.c | 5 +++++ tools/perf/util/evsel.h | 25 ++++++++++++------------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index e507f5f20ef6..e54761c670b6 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -2,29 +2,32 @@ #ifndef __PERF_EVLIST_H #define __PERF_EVLIST_H 1 +#include + #include #include -#include #include +#include +#include +#include + #include #include #include #include + #include "affinity.h" #include "events_stats.h" #include "evsel.h" #include "rblist.h" -#include -#include -#include -struct pollfd; -struct thread_map; struct perf_cpu_map; struct perf_stat_config; +struct pollfd; struct record_opts; struct strbuf; struct target; +struct thread_map; /* * State machine of bkw_mmap_state: diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 34c03f47a913..19e48b9260e9 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -370,6 +370,11 @@ void evsel__set_sample_id(struct evsel *evsel, evsel->core.attr.read_format |= PERF_FORMAT_ID; } +bool evsel__is_non_perf_event_open_pmu(const struct evsel *evsel) +{ + return evsel->pmu && evsel->pmu->type > PERF_PMU_TYPE_PE_END; +} + /** * evsel__is_function_event - Return whether given evsel is a function * trace event diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 8178858d168a..6b28cd754a18 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -2,28 +2,30 @@ #ifndef __PERF_EVSEL_H #define __PERF_EVSEL_H 1 -#include #include -#include + +#include #include #include +#include + #include #include + #include "symbol_conf.h" -#include "pmus.h" -#include "pmu.h" +struct bperf_follower_bpf; +struct bperf_leader_bpf; +struct bpf_counter_ops; struct bpf_object; struct cgroup; +struct hashmap; struct perf_counts; +struct perf_pmu; struct perf_stat_config; struct perf_stat_evsel; -union perf_event; -struct bpf_counter_ops; struct target; -struct hashmap; -struct bperf_leader_bpf; -struct bperf_follower_bpf; +union perf_event; typedef int (evsel__sb_cb_t)(union perf_event *event, void *data); @@ -356,10 +358,6 @@ void arch_evsel__apply_ratio_to_prev(struct evsel *evsel, struct perf_event_attr int evsel__set_filter(struct evsel *evsel, const char *filter); int evsel__append_tp_filter(struct evsel *evsel, const char *filter); int evsel__append_addr_filter(struct evsel *evsel, const char *filter); -static inline bool evsel__is_non_perf_event_open_pmu(const struct evsel *evsel) -{ - return evsel->pmu && evsel->pmu->type > PERF_PMU_TYPE_PE_END; -} int evsel__enable_cpu(struct evsel *evsel, int cpu_map_idx); int evsel__enable(struct evsel *evsel); @@ -478,6 +476,7 @@ static inline bool evsel__is_group_event(struct evsel *evsel) return evsel__is_group_leader(evsel) && evsel->core.nr_members > 1; } +bool evsel__is_non_perf_event_open_pmu(const struct evsel *evsel); bool evsel__is_function_event(struct evsel *evsel); static inline bool evsel__is_bpf_output(struct evsel *evsel) -- 2.54.0.1136.gdb2ca164c4-goog