diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-12-29 14:31:01 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-29 14:31:01 -0500 |
commit | 98d89eabeb07983c6db970bc795bbf32b1d16b99 (patch) | |
tree | f0df785b69a2ed046d00d8f6609d3d7b3a249999 | |
parent | c40b62e42e901e46c1722104dbeaa17ac0b591a5 (diff) | |
parent | 307e9d0956d32bcf12b20400386289baab23223a (diff) |
Merge branch 'trace-cmd' into trace-view
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | trace-ftrace.c | 18 | ||||
-rw-r--r-- | trace-input.c | 13 |
3 files changed, 8 insertions, 26 deletions
@@ -7,4 +7,7 @@ trace.dat | |||
7 | kernelshark | 7 | kernelshark |
8 | trace-graph | 8 | trace-graph |
9 | trace-view | 9 | trace-view |
10 | *.pyc | ||
11 | *.swp | ||
12 | ctracecmd_wrap.c | ||
10 | 13 | ||
diff --git a/trace-ftrace.c b/trace-ftrace.c index 459f74b..1b79ec7 100644 --- a/trace-ftrace.c +++ b/trace-ftrace.c | |||
@@ -255,10 +255,7 @@ fgraph_ent_handler(struct trace_seq *s, struct record *record, | |||
255 | /* | 255 | /* |
256 | * The record returned needs to be freed. | 256 | * The record returned needs to be freed. |
257 | * We also do a new peek on this CPU to update the | 257 | * We also do a new peek on this CPU to update the |
258 | * record cache. (peek caches the record, but the | 258 | * record cache. |
259 | * refresh below will update the CPU iterator. | ||
260 | * If peek has a record in cache, it will update the | ||
261 | * iterator to that) | ||
262 | */ | 259 | */ |
263 | ret = print_graph_entry_leaf(s, event, data, rec); | 260 | ret = print_graph_entry_leaf(s, event, data, rec); |
264 | free_record(rec); | 261 | free_record(rec); |
@@ -268,19 +265,6 @@ fgraph_ent_handler(struct trace_seq *s, struct record *record, | |||
268 | 265 | ||
269 | free(data); | 266 | free(data); |
270 | 267 | ||
271 | /* | ||
272 | * The above peek may unmap the record given to us. | ||
273 | * But callers may still have a reference to that record. | ||
274 | * We need to make sure it is still mapped. | ||
275 | * | ||
276 | * Note, this causes a known bug. If the last item in the trace | ||
277 | * was a leaf function, we can't remove it. The peek cache | ||
278 | * above will be NULL (no records after the leaf) so a new peek | ||
279 | * will simply read the return entry of the leaf and print it | ||
280 | * again. | ||
281 | */ | ||
282 | tracecmd_refresh_record(tracecmd_curr_thread_handle, | ||
283 | record); | ||
284 | return ret; | 268 | return ret; |
285 | } | 269 | } |
286 | 270 | ||
diff --git a/trace-input.c b/trace-input.c index 431c580..9096521 100644 --- a/trace-input.c +++ b/trace-input.c | |||
@@ -917,6 +917,8 @@ tracecmd_read_at(struct tracecmd_input *handle, unsigned long long offset, | |||
917 | * by reading new records the mmap section may be unmapped. | 917 | * by reading new records the mmap section may be unmapped. |
918 | * This will refresh the record's data mapping. | 918 | * This will refresh the record's data mapping. |
919 | * | 919 | * |
920 | * ===== OBSOLETED BY PAGE REFERENCES ===== | ||
921 | * | ||
920 | * Returns 1 if page is still mapped (does not modify CPU iterator) | 922 | * Returns 1 if page is still mapped (does not modify CPU iterator) |
921 | * 0 on successful mapping (was not mapped before, | 923 | * 0 on successful mapping (was not mapped before, |
922 | * This will update CPU iterator to point to | 924 | * This will update CPU iterator to point to |
@@ -1215,7 +1217,6 @@ tracecmd_peek_data(struct tracecmd_input *handle, int cpu) | |||
1215 | unsigned long long extend; | 1217 | unsigned long long extend; |
1216 | unsigned int type_len; | 1218 | unsigned int type_len; |
1217 | int length; | 1219 | int length; |
1218 | int ret; | ||
1219 | 1220 | ||
1220 | /* Hack to work around function graph read ahead */ | 1221 | /* Hack to work around function graph read ahead */ |
1221 | tracecmd_curr_thread_handle = handle; | 1222 | tracecmd_curr_thread_handle = handle; |
@@ -1223,17 +1224,11 @@ tracecmd_peek_data(struct tracecmd_input *handle, int cpu) | |||
1223 | if (handle->cpu_data[cpu].next) { | 1224 | if (handle->cpu_data[cpu].next) { |
1224 | /* Make sure it's still mapped */ | 1225 | /* Make sure it's still mapped */ |
1225 | record = handle->cpu_data[cpu].next; | 1226 | record = handle->cpu_data[cpu].next; |
1226 | ret = tracecmd_refresh_record(handle, record); | ||
1227 | if (ret < 0) { | ||
1228 | free_record(record); | ||
1229 | handle->cpu_data[cpu].next = NULL; | ||
1230 | return NULL; | ||
1231 | } | ||
1232 | /* | 1227 | /* |
1233 | * Make sure the index and timestamp are where | 1228 | * Make sure the index and timestamp are where |
1234 | * we want them, because the refresh did not update it. | 1229 | * we want them. |
1235 | */ | 1230 | */ |
1236 | if (ret && handle->cpu_data[cpu].timestamp != record->ts) { | 1231 | if (handle->cpu_data[cpu].timestamp != record->ts) { |
1237 | handle->cpu_data[cpu].index = | 1232 | handle->cpu_data[cpu].index = |
1238 | (record->offset & (handle->page_size - 1)) + | 1233 | (record->offset & (handle->page_size - 1)) + |
1239 | record->record_size; | 1234 | record->record_size; |