[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-7ba4da100261482afcb693a1b39e483c9c03aba2@git.kernel.org>
Date: Tue, 22 Jan 2019 02:10:36 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, mingo@...nel.org, peterz@...radead.org,
tglx@...utronix.de, alexander.shishkin@...ux.intel.com,
namhyung@...nel.org, linux-kernel@...r.kernel.org, acme@...hat.com,
jolsa@...nel.org
Subject: [tip:perf/core] perf session: Rearrange
perf_session__process_events function
Commit-ID: 7ba4da100261482afcb693a1b39e483c9c03aba2
Gitweb: https://git.kernel.org/tip/7ba4da100261482afcb693a1b39e483c9c03aba2
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Thu, 10 Jan 2019 11:12:56 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 21 Jan 2019 15:15:57 -0300
perf session: Rearrange perf_session__process_events function
To reduce function arguments and the code.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Acked-by: Namhyung Kim <namhyung@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20190110101301.6196-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 5456c84c7dd1..ad14192db811 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1820,13 +1820,14 @@ fetch_mmaped_event(struct perf_session *session,
#define NUM_MMAPS 128
#endif
-static int __perf_session__process_events(struct perf_session *session,
- u64 data_offset, u64 data_size,
- u64 file_size)
+static int __perf_session__process_events(struct perf_session *session)
{
struct ordered_events *oe = &session->ordered_events;
struct perf_tool *tool = session->tool;
int fd = perf_data__fd(session->data);
+ u64 file_size = perf_data__size(session->data);
+ u64 data_offset = session->header.data_offset;
+ u64 data_size = session->header.data_size;
u64 head, page_offset, file_offset, file_pos, size;
int err, mmap_prot, mmap_flags, map_idx = 0;
size_t mmap_size;
@@ -1944,20 +1945,13 @@ out_err:
int perf_session__process_events(struct perf_session *session)
{
- u64 size = perf_data__size(session->data);
- int err;
-
if (perf_session__register_idle_thread(session) < 0)
return -ENOMEM;
- if (!perf_data__is_pipe(session->data))
- err = __perf_session__process_events(session,
- session->header.data_offset,
- session->header.data_size, size);
- else
- err = __perf_session__process_pipe_events(session);
+ if (perf_data__is_pipe(session->data))
+ return __perf_session__process_pipe_events(session);
- return err;
+ return __perf_session__process_events(session);
}
bool perf_session__has_traces(struct perf_session *session, const char *msg)
Powered by blists - more mailing lists