aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-12 15:28:56 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-12 15:28:56 -0500
commit2e4a7019fda668090990e057d6af97d6e6c9ba75 (patch)
tree3d413212e1b3e6747e09349f5d66c17be1986192
parentbc19b0283be9c71ba884c1818a92f5316a4cbc48 (diff)
Use get_page over get_next_page for tracecmd_read_at
The capturing of a page with tracecmd_read_at was a hack that used get_next_page by forcing the index to the previous page. Now that we have a more generic get_page, this patch changes tracecmd_read_at to use that. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-input.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/trace-input.c b/trace-input.c
index cacc136..681da4a 100644
--- a/trace-input.c
+++ b/trace-input.c
@@ -724,20 +724,14 @@ find_and_read_event(struct tracecmd_input *handle, unsigned long long offset,
724 /* 724 /*
725 * If a page already exists, then we need to reset 725 * If a page already exists, then we need to reset
726 * it to point to the page with the data we want. 726 * it to point to the page with the data we want.
727 * We update the pointers to point to the previous
728 * page, and call get_next_page which will mmap
729 * the next page after the pointer of the previous
730 * page we want. Which ends up mapping the page we want.
731 */ 727 */
732 728
733 page_offset -= handle->page_size;
734
735 handle->cpu_data[cpu].offset = page_offset; 729 handle->cpu_data[cpu].offset = page_offset;
736 handle->cpu_data[cpu].size = (handle->cpu_data[cpu].file_offset + 730 handle->cpu_data[cpu].size = (handle->cpu_data[cpu].file_offset +
737 handle->cpu_data[cpu].file_size) - 731 handle->cpu_data[cpu].file_size) -
738 page_offset; 732 page_offset;
739 733
740 if (get_next_page(handle, cpu)) 734 if (get_page(handle, cpu, page_offset))
741 return NULL; 735 return NULL;
742 } else { 736 } else {
743 /* 737 /*