mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: fweisbec@gmail.com, mingo@kernel.org, eranian@google.com,
	hpa@zytor.com, adrian.hunter@intel.com, dsahern@gmail.com,
	peterz@infradead.org, tglx@linutronix.de, namhyung@gmail.com,
	jolsa@redhat.com, acme@redhat.com, paulus@samba.org,
	linux-kernel@vger.kernel.org
Subject: [tip:perf/core] perf session: Add perf_session__deliver_synth_event()
Date: Wed, 29 Oct 2014 23:48:25 -0700	[thread overview]
Message-ID: <tip-a293829df788ae96a174b315010d4b56a10e5114@git.kernel.org> (raw)
In-Reply-To: <1414417770-18602-3-git-send-email-adrian.hunter@intel.com>

Commit-ID:  a293829df788ae96a174b315010d4b56a10e5114
Gitweb:     http://git.kernel.org/tip/a293829df788ae96a174b315010d4b56a10e5114
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Mon, 27 Oct 2014 15:49:23 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 29 Oct 2014 11:36:15 -0200

perf session: Add perf_session__deliver_synth_event()

Add a function to deliver synthesized events from within a session.

Intel PT decoding works by synthesizing events (primarily branch events)
that can then be consumed by existing tools.  This function will be used
to deliver those events.

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/1414417770-18602-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/session.c | 13 +++++++++++++
 tools/perf/util/session.h |  5 +++++
 2 files changed, 18 insertions(+)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 58dd5ce..f4478ce 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -907,6 +907,19 @@ 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 d8521ac..dc26ebf 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -127,6 +127,11 @@ extern volatile int session_done;
 
 #define session_done()	ACCESS_ONCE(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);

  reply	other threads:[~2014-10-30  6:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 13:49 [PATCH 0/9] perf tools: Intel PT preparation continued Adrian Hunter
2014-10-27 13:49 ` [PATCH 1/9] perf tools: Add id index Adrian Hunter
2014-10-30  6:47   ` [tip:perf/core] " tip-bot for Adrian Hunter
2014-10-27 13:49 ` [PATCH 2/9] perf session: Add perf_session__deliver_synth_event() Adrian Hunter
2014-10-30  6:48   ` tip-bot for Adrian Hunter [this message]
2014-10-27 13:49 ` [PATCH 3/9] perf tools: Add a thread stack for synthesizing call chains Adrian Hunter
2014-10-27 13:49 ` [PATCH 4/9] perf tools: Add branch type to db export Adrian Hunter
2014-10-27 13:49 ` [PATCH 5/9] perf tools: Add branch_type and in_tx to Python export Adrian Hunter
2014-10-27 13:49 ` [PATCH 6/9] perf tools: Enhance the thread stack to output call/return data Adrian Hunter
2014-10-27 13:49 ` [PATCH 7/9] perf tools: Add call information to the database export API Adrian Hunter
2014-10-27 13:49 ` [PATCH 8/9] perf tools: Add call information to Python export Adrian Hunter
2014-10-27 13:49 ` [PATCH 9/9] perf tools: Defer export of comms that were not 'set' Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-a293829df788ae96a174b315010d4b56a10e5114@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome