diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-record.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 66b8ecd22cf..e6722698183 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -65,9 +65,6 @@ static bool multiplex = false; | |||
65 | static int multiplex_fd = -1; | 65 | static int multiplex_fd = -1; |
66 | 66 | ||
67 | static long samples = 0; | 67 | static long samples = 0; |
68 | static struct timeval last_read; | ||
69 | static struct timeval this_read; | ||
70 | |||
71 | static u64 bytes_written = 0; | 68 | static u64 bytes_written = 0; |
72 | 69 | ||
73 | static struct pollfd *event_array; | 70 | static struct pollfd *event_array; |
@@ -147,8 +144,6 @@ static void mmap_read(struct mmap_data *md) | |||
147 | void *buf; | 144 | void *buf; |
148 | int diff; | 145 | int diff; |
149 | 146 | ||
150 | gettimeofday(&this_read, NULL); | ||
151 | |||
152 | /* | 147 | /* |
153 | * If we're further behind than half the buffer, there's a chance | 148 | * If we're further behind than half the buffer, there's a chance |
154 | * the writer will bite our tail and mess up the samples under us. | 149 | * the writer will bite our tail and mess up the samples under us. |
@@ -159,23 +154,13 @@ static void mmap_read(struct mmap_data *md) | |||
159 | */ | 154 | */ |
160 | diff = head - old; | 155 | diff = head - old; |
161 | if (diff < 0) { | 156 | if (diff < 0) { |
162 | struct timeval iv; | 157 | fprintf(stderr, "WARNING: failed to keep up with mmap data\n"); |
163 | unsigned long msecs; | ||
164 | |||
165 | timersub(&this_read, &last_read, &iv); | ||
166 | msecs = iv.tv_sec*1000 + iv.tv_usec/1000; | ||
167 | |||
168 | fprintf(stderr, "WARNING: failed to keep up with mmap data." | ||
169 | " Last read %lu msecs ago.\n", msecs); | ||
170 | |||
171 | /* | 158 | /* |
172 | * head points to a known good entry, start there. | 159 | * head points to a known good entry, start there. |
173 | */ | 160 | */ |
174 | old = head; | 161 | old = head; |
175 | } | 162 | } |
176 | 163 | ||
177 | last_read = this_read; | ||
178 | |||
179 | if (old != head) | 164 | if (old != head) |
180 | samples++; | 165 | samples++; |
181 | 166 | ||