diff --git a/[refs] b/[refs] index 4692d59f5172..a1a56dee4e02 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 646aaea615704010b5fd2c8c8891ff1a3a4b4f1a +refs/heads/master: 4af4c9550ccaaf0b53013ff730bc15068ffe6abc diff --git a/trunk/tools/perf/util/evsel.c b/trunk/tools/perf/util/evsel.c index ee0fe0dffa71..cca29ededb5b 100644 --- a/trunk/tools/perf/util/evsel.c +++ b/trunk/tools/perf/util/evsel.c @@ -35,7 +35,17 @@ struct perf_evsel *perf_evsel__new(struct perf_event_attr *attr, int idx) int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads) { + int cpu, thread; evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int)); + + if (evsel->fd) { + for (cpu = 0; cpu < ncpus; cpu++) { + for (thread = 0; thread < nthreads; thread++) { + FD(evsel, cpu, thread) = -1; + } + } + } + return evsel->fd != NULL ? 0 : -ENOMEM; }