linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
	namhyung@kernel.org, jolsa@redhat.com, fweisbec@gmail.com,
	ak@linux.intel.com, dsahern@gmail.com, tglx@linutronix.de,
	cjashfor@linux.vnet.ibm.com, mingo@elte.hu
Subject: [tip:perf/core] perf tools: Adding throttle event data struct support
Date: Mon, 14 Oct 2013 22:25:21 -0700	[thread overview]
Message-ID: <tip-dd96c46b5c765a779d8c35cc7d1df7515b4c7baf@git.kernel.org> (raw)
In-Reply-To: <1378031796-17892-5-git-send-email-jolsa@redhat.com>

Commit-ID:  dd96c46b5c765a779d8c35cc7d1df7515b4c7baf
Gitweb:     http://git.kernel.org/tip/dd96c46b5c765a779d8c35cc7d1df7515b4c7baf
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Sun, 1 Sep 2013 12:36:15 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 9 Oct 2013 11:39:18 -0300

perf tools: Adding throttle event data struct support

Moving 'struct throttle_event' out of python code and making it global
as any other event.

There's no usage of throttling events in any perf commands so far
(besides python support), but we'll need this event data backup for
upcoming test.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1378031796-17892-5-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/event.h   |  7 +++++++
 tools/perf/util/python.c  |  7 -------
 tools/perf/util/session.c | 13 +++++++++++++
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 17d9e16..9b7d4d3 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -61,6 +61,12 @@ struct read_event {
 	u64 id;
 };
 
+struct throttle_event {
+	struct perf_event_header header;
+	u64 time;
+	u64 id;
+	u64 stream_id;
+};
 
 #define PERF_SAMPLE_MASK				\
 	(PERF_SAMPLE_IP | PERF_SAMPLE_TID |		\
@@ -178,6 +184,7 @@ union perf_event {
 	struct fork_event		fork;
 	struct lost_event		lost;
 	struct read_event		read;
+	struct throttle_event		throttle;
 	struct sample_event		sample;
 	struct attr_event		attr;
 	struct event_type_event		event_type;
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index a24ce0a..06efd02 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -33,13 +33,6 @@ int eprintf(int level, const char *fmt, ...)
 # define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
 #endif
 
-struct throttle_event {
-	struct perf_event_header header;
-	u64			 time;
-	u64			 id;
-	u64			 stream_id;
-};
-
 PyMODINIT_FUNC initperf(void);
 
 #define member_def(type, member, ptype, help) \
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index b97f468..d1e4495 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -397,6 +397,17 @@ static void perf_event__read_swap(union perf_event *event, bool sample_id_all)
 		swap_sample_id_all(event, &event->read + 1);
 }
 
+static void perf_event__throttle_swap(union perf_event *event,
+				      bool sample_id_all)
+{
+	event->throttle.time	  = bswap_64(event->throttle.time);
+	event->throttle.id	  = bswap_64(event->throttle.id);
+	event->throttle.stream_id = bswap_64(event->throttle.stream_id);
+
+	if (sample_id_all)
+		swap_sample_id_all(event, &event->throttle + 1);
+}
+
 static u8 revbyte(u8 b)
 {
 	int rev = (b >> 4) | ((b & 0xf) << 4);
@@ -482,6 +493,8 @@ static perf_event__swap_op perf_event__swap_ops[] = {
 	[PERF_RECORD_EXIT]		  = perf_event__task_swap,
 	[PERF_RECORD_LOST]		  = perf_event__all64_swap,
 	[PERF_RECORD_READ]		  = perf_event__read_swap,
+	[PERF_RECORD_THROTTLE]		  = perf_event__throttle_swap,
+	[PERF_RECORD_UNTHROTTLE]	  = perf_event__throttle_swap,
 	[PERF_RECORD_SAMPLE]		  = perf_event__all64_swap,
 	[PERF_RECORD_HEADER_ATTR]	  = perf_event__hdr_attr_swap,
 	[PERF_RECORD_HEADER_EVENT_TYPE]	  = perf_event__event_type_swap,

  reply	other threads:[~2013-10-15  5:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-01 10:36 [PATCHv2 00/25] perf tool: Add support for multiple data file storage Jiri Olsa
2013-09-01 10:36 ` [PATCH 01/25] perf tools: Check mmap pages value early Jiri Olsa
2013-10-15  5:24   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-09-01 10:36 ` [PATCH 02/25] perf tools: Add possibility to specify mmap size Jiri Olsa
2013-10-15  5:25   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-09-01 10:36 ` [PATCH 03/25] perf tools: Introduce perf_evlist__new_default function Jiri Olsa
2013-10-15  5:25   ` [tip:perf/core] perf evlist: " tip-bot for Jiri Olsa
2013-09-01 10:36 ` [PATCH 04/25] perf tools: Adding throttle event data struct support Jiri Olsa
2013-10-15  5:25   ` tip-bot for Jiri Olsa [this message]
2013-09-01 10:36 ` [PATCH 05/25] perf tests: Add simple session read/write test Jiri Olsa
2013-09-01 10:36 ` [PATCH 06/25] perf tests: Add session reading test for little endian perf data Jiri Olsa
2013-09-01 10:36 ` [PATCH 07/25] perf tests: Add session reading test for big " Jiri Olsa
2013-09-01 10:36 ` [PATCH 08/25] perf doc: Add perf data file documentation Jiri Olsa
2013-09-01 10:36 ` [PATCH 09/25] perf tools: Introduce perf data file version CHECK macro Jiri Olsa
2013-09-01 10:36 ` [PATCH 10/25] perf tools: Introduce swap_features function Jiri Olsa
2013-09-01 10:36 ` [PATCH 11/25] perf tools: Introduce swap_header function Jiri Olsa
2013-09-01 10:36 ` [PATCH 12/25] perf tools: Separate version 2 specific perf data header bits Jiri Olsa
2013-09-01 10:36 ` [PATCH 13/25] perf tools: Using evlist as a holder for event_desc feature Jiri Olsa
2013-09-01 10:36 ` [PATCH 14/25] perf tools: Introduce perf.data version 3 format Jiri Olsa
2013-09-01 10:36 ` [PATCH 15/25] perf tools: Add perf data version 3 header swap Jiri Olsa
2013-09-01 10:36 ` [PATCH 16/25] perf tools: Add perf data version 3 header read Jiri Olsa
2013-09-01 10:36 ` [PATCH 17/25] perf tools: Add perf.data version 3 header write Jiri Olsa
2013-09-01 10:36 ` [PATCH 18/25] perf tools: Get rid of post_processing_offset in record command Jiri Olsa
2013-09-01 10:36 ` [PATCH 19/25] perf tools: Move synthesizing into single function Jiri Olsa
2013-09-01 10:36 ` [PATCH 20/25] perf tools: Add perf_data_file__open interface to data object Jiri Olsa
2013-09-01 10:36 ` [PATCH 21/25] perf tools: Separating data file properties from session Jiri Olsa
2013-09-01 10:36 ` [PATCH 22/25] perf tests: Add session reading test for little endian perf data v3 Jiri Olsa
2013-09-01 10:36 ` [PATCH 23/25] perf tests: Add session reading test for big " Jiri Olsa
2013-09-01 10:36 ` [PATCH 24/25] perf tools: Add multi file '-M' option for record command Jiri Olsa
2013-09-02  7:52   ` Adrian Hunter
2013-09-02  8:37     ` Jiri Olsa
2013-09-02  9:11       ` Adrian Hunter
2013-09-02  9:40         ` Jiri Olsa
2013-09-01 10:36 ` [PATCH 25/25] perf tools: Have the process properly sythesized in subsequent data files Jiri Olsa
2013-09-02  2:42 ` [PATCHv2 00/25] perf tool: Add support for multiple data file storage Andi Kleen
2013-09-09 11:17 ` Peter Zijlstra
2013-09-09 11:36   ` Jiri Olsa
2013-09-09 11:55     ` Peter Zijlstra
2013-09-09 14:03       ` Jiri Olsa
2013-09-09 14:11         ` David Ahern
2013-09-09 14:31           ` Jiri Olsa
2013-09-09 15:03             ` David Ahern
2013-09-14 18:32               ` David Ahern
2013-09-09 16:06           ` Ingo Molnar
2013-09-10 17:29             ` David Ahern
2013-09-10  6:54   ` Adrian Hunter
2013-09-10  9:15     ` Peter Zijlstra
2013-09-10  8:57   ` Namhyung Kim

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-dd96c46b5c765a779d8c35cc7d1df7515b4c7baf@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.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@elte.hu \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).