Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262739
b: refs/heads/master
c: 4152ab3
h: refs/heads/master
i:
  262737: cf21388
  262735: 875891d
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Jul 25, 2011
1 parent 14760f3 commit d0b8999
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f9bae351d299149a84f76cd34bf0150614e8c8e
refs/heads/master: 4152ab377b55e9d3e5700de00ef799519ead698d
19 changes: 2 additions & 17 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include <sched.h>
#include <sys/mman.h>

#define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))

enum write_mode_t {
WRITE_FORCE,
WRITE_APPEND
Expand Down Expand Up @@ -438,7 +436,6 @@ static void mmap_read_all(void)

static int __cmd_record(int argc, const char **argv)
{
int i;
struct stat st;
int flags;
int err;
Expand Down Expand Up @@ -682,7 +679,6 @@ static int __cmd_record(int argc, const char **argv)

for (;;) {
int hits = samples;
int thread;

mmap_read_all();

Expand All @@ -693,19 +689,8 @@ static int __cmd_record(int argc, const char **argv)
waking++;
}

if (done) {
for (i = 0; i < evsel_list->cpus->nr; i++) {
struct perf_evsel *pos;

list_for_each_entry(pos, &evsel_list->entries, node) {
for (thread = 0;
thread < evsel_list->threads->nr;
thread++)
ioctl(FD(pos, i, thread),
PERF_EVENT_IOC_DISABLE);
}
}
}
if (done)
perf_evlist__disable(evsel_list);
}

if (quiet || signr == SIGUSR1)
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 @@ -91,6 +91,19 @@ int perf_evlist__add_default(struct perf_evlist *evlist)
return 0;
}

void perf_evlist__disable(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_DISABLE);
}
}
}

int perf_evlist__alloc_pollfd(struct perf_evlist *evlist)
{
int nfds = evlist->cpus->nr * evlist->threads->nr * evlist->nr_entries;
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/util/evlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ int perf_evlist__alloc_mmap(struct perf_evlist *evlist);
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);

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

0 comments on commit d0b8999

Please sign in to comment.