evlist__for_each_entry(evlist, pos) {
try_again:
- if (evsel__open(pos, pos->cpus, pos->threads) < 0) {
+ if (evsel__open(pos, pos->core.cpus, pos->threads) < 0) {
if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) {
if (verbose > 0)
ui__warning("%s\n", msg);
counts = perf_counts(counter->counts, cpu, thread);
printf("%3d %8d %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %s\n",
- counter->cpus->map[cpu],
+ counter->core.cpus->map[cpu],
thread_map__pid(counter->threads, thread),
counts->val,
counts->ena,
#include <linux/types.h>
#include <linux/perf_event.h>
+struct perf_cpu_map;
+
struct perf_evsel {
- struct list_head node;
- struct perf_event_attr attr;
+ struct list_head node;
+ struct perf_event_attr attr;
+ struct perf_cpu_map *cpus;
};
#endif /* __LIBPERF_INTERNAL_EVSEL_H */
* keep it, if there's no target cpu list defined.
*/
if (!evsel->own_cpus || evlist->has_user_cpus) {
- perf_cpu_map__put(evsel->cpus);
- evsel->cpus = perf_cpu_map__get(evlist->cpus);
- } else if (evsel->cpus != evsel->own_cpus) {
- perf_cpu_map__put(evsel->cpus);
- evsel->cpus = perf_cpu_map__get(evsel->own_cpus);
+ perf_cpu_map__put(evsel->core.cpus);
+ evsel->core.cpus = perf_cpu_map__get(evlist->cpus);
+ } else if (evsel->core.cpus != evsel->own_cpus) {
+ perf_cpu_map__put(evsel->core.cpus);
+ evsel->core.cpus = perf_cpu_map__get(evsel->own_cpus);
}
perf_thread_map__put(evsel->threads);
if (evsel->system_wide && thread)
continue;
- cpu = cpu_map__idx(evsel->cpus, evlist_cpu);
+ cpu = cpu_map__idx(evsel->core.cpus, evlist_cpu);
if (cpu == -1)
continue;
perf_evlist__update_id_pos(evlist);
evlist__for_each_entry(evlist, evsel) {
- err = evsel__open(evsel, evsel->cpus, evsel->threads);
+ err = evsel__open(evsel, evsel->core.cpus, evsel->threads);
if (err < 0)
goto out_err;
}
perf_evsel__free_id(evsel);
perf_evsel__free_config_terms(evsel);
cgroup__put(evsel->cgrp);
- perf_cpu_map__put(evsel->cpus);
+ perf_cpu_map__put(evsel->core.cpus);
perf_cpu_map__put(evsel->own_cpus);
perf_thread_map__put(evsel->threads);
zfree(&evsel->group_name);
int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist)
{
- struct perf_cpu_map *cpus = evsel->cpus;
+ struct perf_cpu_map *cpus = evsel->core.cpus;
struct perf_thread_map *threads = evsel->threads;
if (perf_evsel__alloc_id(evsel, cpus->nr, threads->nr))
u64 db_id;
struct cgroup *cgrp;
void *handler;
- struct perf_cpu_map *cpus;
struct perf_cpu_map *own_cpus;
struct perf_thread_map *threads;
unsigned int sample_size;
static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel)
{
- return evsel->cpus;
+ return evsel->core.cpus;
}
static inline int perf_evsel__nr_cpus(struct evsel *evsel)
return NULL;
(*idx)++;
- evsel->cpus = perf_cpu_map__get(cpus);
+ evsel->core.cpus = perf_cpu_map__get(cpus);
evsel->own_cpus = perf_cpu_map__get(cpus);
evsel->system_wide = pmu ? pmu->is_uncore : false;
evsel->auto_merge_stats = auto_merge_stats;
struct evsel *counter, u64 tstamp)
{
struct perf_thread_map *threads = counter->threads;
- struct perf_cpu_map *cpus = counter->cpus;
+ struct perf_cpu_map *cpus = counter->core.cpus;
int cpu, thread;
if (config->aggr_mode == AGGR_GLOBAL) {
{
FILE *output = config->output;
int nthreads = thread_map__nr(counter->threads);
- int ncpus = cpu_map__nr(counter->cpus);
+ int ncpus = cpu_map__nr(counter->core.cpus);
int thread, sorted_threads, id;
struct perf_aggr_thread_value *buf;