Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264095
b: refs/heads/master
c: 764e16a
h: refs/heads/master
i:
  264093: 62c5494
  264091: 2cdb27d
  264087: f0e28c7
  264079: 0482e22
  264063: 5d7ea9b
v: v3
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed Sep 23, 2011
1 parent b54bd3f commit 06b85ca
Show file tree
Hide file tree
Showing 4 changed files with 18 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: 694bf407b06113f5e0f71764756f11903126fec0
refs/heads/master: 764e16a30a77a9c8346fbae6615e7c818ce9d00f
3 changes: 3 additions & 0 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static void config_attr(struct perf_evsel *evsel, struct perf_evlist *evlist)
struct perf_event_attr *attr = &evsel->attr;
int track = !evsel->idx; /* only the first counter needs these */

attr->disabled = 1;
attr->inherit = !no_inherit;
attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
PERF_FORMAT_TOTAL_TIME_RUNNING |
Expand Down Expand Up @@ -671,6 +672,8 @@ static int __cmd_record(int argc, const char **argv)
}
}

perf_evlist__enable(evsel_list);

/*
* Let the child rip
*/
Expand Down
13 changes: 13 additions & 0 deletions trunk/tools/perf/util/evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ void perf_evlist__disable(struct perf_evlist *evlist)
}
}

void perf_evlist__enable(struct perf_evlist *evlist)
{
int cpu, thread;
struct perf_evsel *pos;

for (cpu = 0; cpu < evlist->cpus->nr; cpu++) {
list_for_each_entry(pos, &evlist->entries, node) {
for (thread = 0; thread < evlist->threads->nr; thread++)
ioctl(FD(pos, cpu, thread), PERF_EVENT_IOC_ENABLE);
}
}
}

int perf_evlist__alloc_pollfd(struct perf_evlist *evlist)
{
int nfds = evlist->cpus->nr * evlist->threads->nr * evlist->nr_entries;
Expand Down
1 change: 1 addition & 0 deletions trunk/tools/perf/util/evlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ int perf_evlist__mmap(struct perf_evlist *evlist, int pages, bool overwrite);
void perf_evlist__munmap(struct perf_evlist *evlist);

void perf_evlist__disable(struct perf_evlist *evlist);
void perf_evlist__enable(struct perf_evlist *evlist);

static inline void perf_evlist__set_maps(struct perf_evlist *evlist,
struct cpu_map *cpus,
Expand Down

0 comments on commit 06b85ca

Please sign in to comment.