evlist__for_each_entry(evlist, pos) {
try_again:
- if (evsel__open(pos, pos->core.cpus, pos->threads) < 0) {
+ if (evsel__open(pos, pos->core.cpus, pos->core.threads) < 0) {
if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) {
if (verbose > 0)
ui__warning("%s\n", msg);
static void __process_stat(struct evsel *counter, u64 tstamp)
{
- int nthreads = thread_map__nr(counter->threads);
+ int nthreads = thread_map__nr(counter->core.threads);
int ncpus = perf_evsel__nr_cpus(counter);
int cpu, thread;
static int header_printed;
printf("%3d %8d %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %s\n",
counter->core.cpus->map[cpu],
- thread_map__pid(counter->threads, thread),
+ thread_map__pid(counter->core.threads, thread),
counts->val,
counts->ena,
counts->run,
#include <linux/perf_event.h>
struct perf_cpu_map;
+struct perf_thread_map;
struct perf_evsel {
struct list_head node;
struct perf_event_attr attr;
struct perf_cpu_map *cpus;
struct perf_cpu_map *own_cpus;
+ struct perf_thread_map *threads;
};
#endif /* __LIBPERF_INTERNAL_EVSEL_H */
evsel->core.cpus = perf_cpu_map__get(evsel->core.own_cpus);
}
- perf_thread_map__put(evsel->threads);
- evsel->threads = perf_thread_map__get(evlist->threads);
+ perf_thread_map__put(evsel->core.threads);
+ evsel->core.threads = perf_thread_map__get(evlist->threads);
}
static void perf_evlist__propagate_maps(struct evlist *evlist)
perf_evlist__update_id_pos(evlist);
evlist__for_each_entry(evlist, evsel) {
- err = evsel__open(evsel, evsel->core.cpus, evsel->threads);
+ err = evsel__open(evsel, evsel->core.cpus, evsel->core.threads);
if (err < 0)
goto out_err;
}
cgroup__put(evsel->cgrp);
perf_cpu_map__put(evsel->core.cpus);
perf_cpu_map__put(evsel->core.own_cpus);
- perf_thread_map__put(evsel->threads);
+ perf_thread_map__put(evsel->core.threads);
zfree(&evsel->group_name);
zfree(&evsel->name);
perf_evsel__object.fini(evsel);
int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist)
{
struct perf_cpu_map *cpus = evsel->core.cpus;
- struct perf_thread_map *threads = evsel->threads;
+ struct perf_thread_map *threads = evsel->core.threads;
if (perf_evsel__alloc_id(evsel, cpus->nr, threads->nr))
return -ENOMEM;
u64 db_id;
struct cgroup *cgrp;
void *handler;
- struct perf_thread_map *threads;
unsigned int sample_size;
int id_pos;
int is_pos;
static void python_process_stat(struct perf_stat_config *config,
struct evsel *counter, u64 tstamp)
{
- struct perf_thread_map *threads = counter->threads;
+ struct perf_thread_map *threads = counter->core.threads;
struct perf_cpu_map *cpus = counter->core.cpus;
int cpu, thread;
case AGGR_THREAD:
fprintf(config->output, "%*s-%*d%s",
config->csv_output ? 0 : 16,
- perf_thread_map__comm(evsel->threads, id),
+ perf_thread_map__comm(evsel->core.threads, id),
config->csv_output ? 0 : -8,
- thread_map__pid(evsel->threads, id),
+ thread_map__pid(evsel->core.threads, id),
config->csv_sep);
break;
case AGGR_GLOBAL:
struct evsel *counter, char *prefix)
{
FILE *output = config->output;
- int nthreads = thread_map__nr(counter->threads);
+ int nthreads = thread_map__nr(counter->core.threads);
int ncpus = cpu_map__nr(counter->core.cpus);
int thread, sorted_threads, id;
struct perf_aggr_thread_value *buf;
static int perf_evsel__alloc_stats(struct evsel *evsel, bool alloc_raw)
{
int ncpus = perf_evsel__nr_cpus(evsel);
- int nthreads = thread_map__nr(evsel->threads);
+ int nthreads = thread_map__nr(evsel->core.threads);
if (perf_evsel__alloc_stat_priv(evsel) < 0 ||
perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 ||
static int process_counter_maps(struct perf_stat_config *config,
struct evsel *counter)
{
- int nthreads = thread_map__nr(counter->threads);
+ int nthreads = thread_map__nr(counter->core.threads);
int ncpus = perf_evsel__nr_cpus(counter);
int cpu, thread;
if (target__has_cpu(target) && !target__has_per_thread(target))
return perf_evsel__open_per_cpu(evsel, evsel__cpus(evsel));
- return perf_evsel__open_per_thread(evsel, evsel->threads);
+ return perf_evsel__open_per_thread(evsel, evsel->core.threads);
}
int perf_stat_synthesize_config(struct perf_stat_config *config,