Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169475
b: refs/heads/master
c: b209aa1
h: refs/heads/master
i:
  169473: e210188
  169471: 81ebf26
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Oct 7, 2009
1 parent d24211f commit bcd482d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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: 42e59d7d19dc4b49feab2a860fd9a8ca3248c833
refs/heads/master: b209aa1f83964d49a332a7b6b818ebede5cdc6ef
7 changes: 6 additions & 1 deletion trunk/tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ static int __cmd_trace(void)
int ret, rc = EXIT_FAILURE;
unsigned long offset = 0;
unsigned long head = 0;
unsigned long shift;
struct stat perf_stat;
event_t *event;
uint32_t size;
Expand Down Expand Up @@ -180,6 +181,10 @@ static int __cmd_trace(void)
return EXIT_FAILURE;
}

shift = page_size * (head / page_size);
offset += shift;
head -= shift;

remap:
buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ,
MAP_SHARED, input, offset);
Expand All @@ -192,9 +197,9 @@ static int __cmd_trace(void)
event = (event_t *)(buf + head);

if (head + event->header.size >= page_size * mmap_window) {
unsigned long shift = page_size * (head / page_size);
int res;

shift = page_size * (head / page_size);
res = munmap(buf, page_size * mmap_window);
assert(res == 0);

Expand Down

0 comments on commit bcd482d

Please sign in to comment.