aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/evsel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ee0fe0dffa71..cca29ededb5b 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -35,7 +35,17 @@ struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx)
35 35
36int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads) 36int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads)
37{ 37{
38 int cpu, thread;
38 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int)); 39 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int));
40
41 if (evsel->fd) {
42 for (cpu = 0; cpu < ncpus; cpu++) {
43 for (thread = 0; thread < nthreads; thread++) {
44 FD(evsel, cpu, thread) = -1;
45 }
46 }
47 }
48
39 return evsel->fd != NULL ? 0 : -ENOMEM; 49 return evsel->fd != NULL ? 0 : -ENOMEM;
40} 50}
41 51