diff options
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index c0f69e80b2cc..2d8806bac258 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -870,8 +870,6 @@ static unsigned int mmap_read_head(struct mmap_data *md) | |||
870 | return head; | 870 | return head; |
871 | } | 871 | } |
872 | 872 | ||
873 | struct timeval last_read, this_read; | ||
874 | |||
875 | static void mmap_read_counter(struct mmap_data *md) | 873 | static void mmap_read_counter(struct mmap_data *md) |
876 | { | 874 | { |
877 | unsigned int head = mmap_read_head(md); | 875 | unsigned int head = mmap_read_head(md); |
@@ -879,8 +877,6 @@ static void mmap_read_counter(struct mmap_data *md) | |||
879 | unsigned char *data = md->base + page_size; | 877 | unsigned char *data = md->base + page_size; |
880 | int diff; | 878 | int diff; |
881 | 879 | ||
882 | gettimeofday(&this_read, NULL); | ||
883 | |||
884 | /* | 880 | /* |
885 | * If we're further behind than half the buffer, there's a chance | 881 | * If we're further behind than half the buffer, there's a chance |
886 | * the writer will bite our tail and mess up the samples under us. | 882 | * 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 | */ | 887 | */ |
892 | diff = head - old; | 888 | diff = head - old; |
893 | if (diff > md->mask / 2 || diff < 0) { | 889 | if (diff > md->mask / 2 || diff < 0) { |
894 | struct timeval iv; | 890 | fprintf(stderr, "WARNING: failed to keep up with mmap data.\n"); |
895 | unsigned long msecs; | ||
896 | |||
897 | timersub(&this_read, &last_read, &iv); | ||
898 | msecs = iv.tv_sec*1000 + iv.tv_usec/1000; | ||
899 | |||
900 | fprintf(stderr, "WARNING: failed to keep up with mmap data." | ||
901 | " Last read %lu msecs ago.\n", msecs); | ||
902 | 891 | ||
903 | /* | 892 | /* |
904 | * head points to a known good entry, start there. | 893 | * head points to a known good entry, start there. |
@@ -906,8 +895,6 @@ static void mmap_read_counter(struct mmap_data *md) | |||
906 | old = head; | 895 | old = head; |
907 | } | 896 | } |
908 | 897 | ||
909 | last_read = this_read; | ||
910 | |||
911 | for (; old != head;) { | 898 | for (; old != head;) { |
912 | event_t *event = (event_t *)&data[old & md->mask]; | 899 | event_t *event = (event_t *)&data[old & md->mask]; |
913 | 900 | ||