[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1408129739-17368-11-git-send-email-adrian.hunter@intel.com>
Date: Fri, 15 Aug 2014 22:08:45 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...il.com>,
Paul Mackerras <paulus@...ba.org>,
Stephane Eranian <eranian@...gle.com>
Subject: [PATCH 10/24] perf session: Add perf_session__deliver_synth_event()
Add a function to deliver synthesized events from
within a session.
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
---
tools/perf/util/session.c | 14 ++++++++++++++
tools/perf/util/session.h | 5 +++++
2 files changed, 19 insertions(+)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 7ffd1a3..cb0f26d 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -924,6 +924,20 @@ static s64 perf_session__process_user_event(struct perf_session *session,
}
}
+int perf_session__deliver_synth_event(struct perf_session *session,
+ union perf_event *event,
+ struct perf_sample *sample,
+ struct perf_tool *tool)
+{
+ events_stats__inc(&session->stats, event->header.type);
+
+ if (event->header.type >= PERF_RECORD_USER_TYPE_START)
+ return perf_session__process_user_event(session, event, tool,
+ 0);
+
+ return perf_session__deliver_event(session, event, sample, tool, 0);
+}
+
static void event_swap(union perf_event *event, bool sample_id_all)
{
perf_event__swap_op swap;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index b3a8fa9..c0f4c2c 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -128,6 +128,11 @@ extern volatile int session_done;
#define session_done() (*(volatile int *)(&session_done))
+int perf_session__deliver_synth_event(struct perf_session *session,
+ union perf_event *event,
+ struct perf_sample *sample,
+ struct perf_tool *tool);
+
int perf_event__process_id_index(struct perf_tool *tool,
union perf_event *event,
struct perf_session *session);
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists