Commit f4f0b418 authored by Mike Galbraith's avatar Mike Galbraith Committed by Ingo Molnar

perf tools: Remove expensive old debug code from perf top

Calling gettimeofday() at high frequency is painful for handicapped
boxen. The spot calling gettimeofday() is old unneeded debug code,
so remove it.
Reported-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1255438640.7173.1.camel@marge.simson.net>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent cfed95a6
...@@ -870,8 +870,6 @@ static unsigned int mmap_read_head(struct mmap_data *md) ...@@ -870,8 +870,6 @@ static unsigned int mmap_read_head(struct mmap_data *md)
return head; return head;
} }
struct timeval last_read, this_read;
static void mmap_read_counter(struct mmap_data *md) static void mmap_read_counter(struct mmap_data *md)
{ {
unsigned int head = mmap_read_head(md); unsigned int head = mmap_read_head(md);
...@@ -879,8 +877,6 @@ static void mmap_read_counter(struct mmap_data *md) ...@@ -879,8 +877,6 @@ static void mmap_read_counter(struct mmap_data *md)
unsigned char *data = md->base + page_size; unsigned char *data = md->base + page_size;
int diff; int diff;
gettimeofday(&this_read, NULL);
/* /*
* If we're further behind than half the buffer, there's a chance * If we're further behind than half the buffer, there's a chance
* the writer will bite our tail and mess up the samples under us. * the writer will bite our tail and mess up the samples under us.
...@@ -891,14 +887,7 @@ static void mmap_read_counter(struct mmap_data *md) ...@@ -891,14 +887,7 @@ static void mmap_read_counter(struct mmap_data *md)
*/ */
diff = head - old; diff = head - old;
if (diff > md->mask / 2 || diff < 0) { if (diff > md->mask / 2 || diff < 0) {
struct timeval iv; fprintf(stderr, "WARNING: failed to keep up with mmap data.\n");
unsigned long msecs;
timersub(&this_read, &last_read, &iv);
msecs = iv.tv_sec*1000 + iv.tv_usec/1000;
fprintf(stderr, "WARNING: failed to keep up with mmap data."
" Last read %lu msecs ago.\n", msecs);
/* /*
* head points to a known good entry, start there. * head points to a known good entry, start there.
...@@ -906,8 +895,6 @@ static void mmap_read_counter(struct mmap_data *md) ...@@ -906,8 +895,6 @@ static void mmap_read_counter(struct mmap_data *md)
old = head; old = head;
} }
last_read = this_read;
for (; old != head;) { for (; old != head;) {
event_t *event = (event_t *)&data[old & md->mask]; event_t *event = (event_t *)&data[old & md->mask];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment