aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2014-07-23 15:19:58 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-07-23 16:07:14 -0400
commitd5652d865ea734a13a16cf563937291a84d4364d (patch)
tree4ef63cfe0a61cf208d5fe644f2864b60c4439531 /tools
parent6f917c70998d22bda6d06cb168665068c6066cd4 (diff)
perf session: Add ability to skip 4GiB or more
A session can be made to skip portions of the input file. Do not limit that size to 32-bits. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1406143198-20732-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/session.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index f4399b2087c4..d3da1055239f 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -994,8 +994,10 @@ static int perf_session_deliver_event(struct perf_session *session,
994 } 994 }
995} 995}
996 996
997static int perf_session__process_user_event(struct perf_session *session, union perf_event *event, 997static s64 perf_session__process_user_event(struct perf_session *session,
998 struct perf_tool *tool, u64 file_offset) 998 union perf_event *event,
999 struct perf_tool *tool,
1000 u64 file_offset)
999{ 1001{
1000 int fd = perf_data_file__fd(session->file); 1002 int fd = perf_data_file__fd(session->file);
1001 int err; 1003 int err;
@@ -1037,7 +1039,7 @@ static void event_swap(union perf_event *event, bool sample_id_all)
1037 swap(event, sample_id_all); 1039 swap(event, sample_id_all);
1038} 1040}
1039 1041
1040static int perf_session__process_event(struct perf_session *session, 1042static s64 perf_session__process_event(struct perf_session *session,
1041 union perf_event *event, 1043 union perf_event *event,
1042 struct perf_tool *tool, 1044 struct perf_tool *tool,
1043 u64 file_offset) 1045 u64 file_offset)
@@ -1148,7 +1150,7 @@ static int __perf_session__process_pipe_events(struct perf_session *session,
1148 union perf_event *event; 1150 union perf_event *event;
1149 uint32_t size, cur_size = 0; 1151 uint32_t size, cur_size = 0;
1150 void *buf = NULL; 1152 void *buf = NULL;
1151 int skip = 0; 1153 s64 skip = 0;
1152 u64 head; 1154 u64 head;
1153 ssize_t err; 1155 ssize_t err;
1154 void *p; 1156 void *p;
@@ -1277,14 +1279,13 @@ int __perf_session__process_events(struct perf_session *session,
1277 u64 file_size, struct perf_tool *tool) 1279 u64 file_size, struct perf_tool *tool)
1278{ 1280{
1279 int fd = perf_data_file__fd(session->file); 1281 int fd = perf_data_file__fd(session->file);
1280 u64 head, page_offset, file_offset, file_pos; 1282 u64 head, page_offset, file_offset, file_pos, size;
1281 int err, mmap_prot, mmap_flags, map_idx = 0; 1283 int err, mmap_prot, mmap_flags, map_idx = 0;
1282 size_t mmap_size; 1284 size_t mmap_size;
1283 char *buf, *mmaps[NUM_MMAPS]; 1285 char *buf, *mmaps[NUM_MMAPS];
1284 union perf_event *event; 1286 union perf_event *event;
1285 uint32_t size;
1286 struct ui_progress prog; 1287 struct ui_progress prog;
1287 int skip; 1288 s64 skip;
1288 1289
1289 perf_tool__fill_defaults(tool); 1290 perf_tool__fill_defaults(tool);
1290 1291