Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223964
b: refs/heads/master
c: 4eed11d
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Jan 4, 2011
1 parent e0f72d7 commit 24b40e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86bd5e8603b00b06189328c6d7034d2dc434d6bb
refs/heads/master: 4eed11d5e24540dc133003b6e8f904cb747ac4bb
9 changes: 9 additions & 0 deletions trunk/tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
if (FD(evsel, cpu, thread) < 0)
return -EINVAL;

if (evsel->counts == NULL && perf_evsel__alloc_counts(evsel, cpu + 1) < 0)
return -ENOMEM;

if (readn(FD(evsel, cpu, thread), &count, nv * sizeof(u64)) < 0)
return -errno;

Expand Down Expand Up @@ -129,6 +132,9 @@ int perf_evsel__open_per_cpu(struct perf_evsel *evsel, struct cpu_map *cpus)
{
int cpu;

if (evsel->fd == NULL && perf_evsel__alloc_fd(evsel, cpus->nr, 1) < 0)
return -1;

for (cpu = 0; cpu < cpus->nr; cpu++) {
FD(evsel, cpu, 0) = sys_perf_event_open(&evsel->attr, -1,
cpus->map[cpu], -1, 0);
Expand All @@ -150,6 +156,9 @@ int perf_evsel__open_per_thread(struct perf_evsel *evsel, struct thread_map *thr
{
int thread;

if (evsel->fd == NULL && perf_evsel__alloc_fd(evsel, 1, threads->nr))
return -1;

for (thread = 0; thread < threads->nr; thread++) {
FD(evsel, 0, thread) = sys_perf_event_open(&evsel->attr,
threads->map[thread], -1, -1, 0);
Expand Down

0 comments on commit 24b40e5

Please sign in to comment.