diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-12-30 21:03:03 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-30 21:03:03 -0500 |
commit | 9c3489c441867fae0bcebdd5fa008ce182bc90d4 (patch) | |
tree | f183586292f01e90f1f50fbff5c4de63dba6c521 | |
parent | cc99a8f739a019f9cbc5248f0f0454c200b9ed32 (diff) | |
parent | 3651f25a761c1ea0019ede26200fcc38c6f44a33 (diff) |
Merge branch 'trace-cmd' into trace-view
-rw-r--r-- | trace-input.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/trace-input.c b/trace-input.c index 9096521..239fb86 100644 --- a/trace-input.c +++ b/trace-input.c | |||
@@ -1218,23 +1218,24 @@ tracecmd_peek_data(struct tracecmd_input *handle, int cpu) | |||
1218 | unsigned int type_len; | 1218 | unsigned int type_len; |
1219 | int length; | 1219 | int length; |
1220 | 1220 | ||
1221 | if (index < 0) | ||
1222 | die("negative index on cpu iterator %d", cpu); | ||
1223 | |||
1221 | /* Hack to work around function graph read ahead */ | 1224 | /* Hack to work around function graph read ahead */ |
1222 | tracecmd_curr_thread_handle = handle; | 1225 | tracecmd_curr_thread_handle = handle; |
1223 | 1226 | ||
1224 | if (handle->cpu_data[cpu].next) { | 1227 | if (handle->cpu_data[cpu].next) { |
1225 | /* Make sure it's still mapped */ | 1228 | |
1226 | record = handle->cpu_data[cpu].next; | 1229 | record = handle->cpu_data[cpu].next; |
1230 | |||
1231 | if (handle->cpu_data[cpu].timestamp == record->ts) | ||
1232 | return record; | ||
1233 | |||
1227 | /* | 1234 | /* |
1228 | * Make sure the index and timestamp are where | 1235 | * The timestamp changed, which means the cached |
1229 | * we want them. | 1236 | * record is no longer valid. Reread a new record. |
1230 | */ | 1237 | */ |
1231 | if (handle->cpu_data[cpu].timestamp != record->ts) { | 1238 | free_record(record); |
1232 | handle->cpu_data[cpu].index = | ||
1233 | (record->offset & (handle->page_size - 1)) + | ||
1234 | record->record_size; | ||
1235 | handle->cpu_data[cpu].timestamp = record->ts; | ||
1236 | } | ||
1237 | return record; | ||
1238 | } | 1239 | } |
1239 | 1240 | ||
1240 | if (!page) | 1241 | if (!page) |
@@ -1248,6 +1249,9 @@ tracecmd_peek_data(struct tracecmd_input *handle, int cpu) | |||
1248 | read_again: | 1249 | read_again: |
1249 | index = calc_index(handle, ptr, cpu); | 1250 | index = calc_index(handle, ptr, cpu); |
1250 | 1251 | ||
1252 | if (index < 0) | ||
1253 | die("negative index on cpu record %d", cpu); | ||
1254 | |||
1251 | if (index >= handle->cpu_data[cpu].page_size) { | 1255 | if (index >= handle->cpu_data[cpu].page_size) { |
1252 | if (get_next_page(handle, cpu)) | 1256 | if (get_next_page(handle, cpu)) |
1253 | return NULL; | 1257 | return NULL; |