Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234344
b: refs/heads/master
c: 115d2d8
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Jan 22, 2011
1 parent c614a5e commit 1aa71cd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 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: 744bd8aa3c8b43447f689a27872fa95e700b8a4f
refs/heads/master: 115d2d8963a426670ac3ce983fc4c4e001703943
13 changes: 1 addition & 12 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ static const char *cpu_list;

static struct perf_mmap mmap_array[MAX_NR_CPUS];

static void mmap_write_tail(struct perf_mmap *md, unsigned long tail)
{
struct perf_event_mmap_page *pc = md->base;

/*
* ensure all reads are done before we write the tail out.
*/
/* mb(); */
pc->data_tail = tail;
}

static void advance_output(size_t size)
{
bytes_written += size;
Expand Down Expand Up @@ -165,7 +154,7 @@ static void mmap_read(struct perf_mmap *md)
write_output(buf, size);

md->prev = old;
mmap_write_tail(md, old);
perf_mmap__write_tail(md, old);
}

static volatile int done = 0;
Expand Down
12 changes: 12 additions & 0 deletions trunk/tools/perf/perf.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm)
return head;
}

static inline void perf_mmap__write_tail(struct perf_mmap *md,
unsigned long tail)
{
struct perf_event_mmap_page *pc = md->base;

/*
* ensure all reads are done before we write the tail out.
*/
/* mb(); */
pc->data_tail = tail;
}

/*
* prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all
* counters in the current task.
Expand Down

0 comments on commit 1aa71cd

Please sign in to comment.