All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot2 for Jiri Olsa <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Jiri Olsa <jolsa@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Michael Petlan <mpetlan@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
	linux-kernel@vger.kernel.org
Subject: [tip: perf/core] libperf: Add PERF_RECORD_SAMPLE 'struct sample_event' to perf/event.h
Date: Tue, 27 Aug 2019 08:26:23 -0000	[thread overview]
Message-ID: <156689438344.24556.1687215100185726976.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20190825181752.722-13-jolsa@kernel.org>

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     b1fcd190bb3fc1234dca60390d171a4cc75b21b2
Gitweb:        https://git.kernel.org/tip/b1fcd190bb3fc1234dca60390d171a4cc75b21b2
Author:        Jiri Olsa <jolsa@kernel.org>
AuthorDate:    Sun, 25 Aug 2019 20:17:52 +02:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Mon, 26 Aug 2019 19:39:10 -03:00

libperf: Add PERF_RECORD_SAMPLE 'struct sample_event' to perf/event.h

Move the PERF_RECORD_SAMPLE event definition to libperf's event.h header
include.

In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used
events to their generic '__u*' versions.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190825181752.722-13-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/lib/include/perf/event.h | 5 +++++
 tools/perf/util/event.h             | 5 -----
 tools/perf/util/evlist.c            | 2 +-
 tools/perf/util/evsel.c             | 8 ++++----
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/perf/lib/include/perf/event.h b/tools/perf/lib/include/perf/event.h
index 585c9d8..e768a2d 100644
--- a/tools/perf/lib/include/perf/event.h
+++ b/tools/perf/lib/include/perf/event.h
@@ -104,4 +104,9 @@ struct bpf_event {
 	__u8			 tag[BPF_TAG_SIZE];  // prog tag
 };
 
+struct sample_event {
+	struct perf_event_header header;
+	__u64			 array[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 091a069..dee0ee5 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -37,11 +37,6 @@
 /* perf sample has 16 bits size limit */
 #define PERF_SAMPLE_MAX_SIZE (1 << 16)
 
-struct sample_event {
-	struct perf_event_header        header;
-	u64 array[];
-};
-
 struct regs_dump {
 	u64 abi;
 	u64 mask;
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index ff41568..47bc541 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -587,7 +587,7 @@ struct evsel *perf_evlist__id2evsel_strict(struct evlist *evlist,
 static int perf_evlist__event2id(struct evlist *evlist,
 				 union perf_event *event, u64 *id)
 {
-	const u64 *array = event->sample.array;
+	const __u64 *array = event->sample.array;
 	ssize_t n;
 
 	n = (event->header.size - sizeof(event->header)) >> 3;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 9fadd58..778262f 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2009,7 +2009,7 @@ static int perf_evsel__parse_id_sample(const struct evsel *evsel,
 				       struct perf_sample *sample)
 {
 	u64 type = evsel->core.attr.sample_type;
-	const u64 *array = event->sample.array;
+	const __u64 *array = event->sample.array;
 	bool swapped = evsel->needs_swap;
 	union u64_swap u;
 
@@ -2099,7 +2099,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event,
 {
 	u64 type = evsel->core.attr.sample_type;
 	bool swapped = evsel->needs_swap;
-	const u64 *array;
+	const __u64 *array;
 	u16 max_size = event->header.size;
 	const void *endp = (void *)event + max_size;
 	u64 sz;
@@ -2378,7 +2378,7 @@ int perf_evsel__parse_sample_timestamp(struct evsel *evsel,
 				       u64 *timestamp)
 {
 	u64 type = evsel->core.attr.sample_type;
-	const u64 *array;
+	const __u64 *array;
 
 	if (!(type & PERF_SAMPLE_TIME))
 		return -1;
@@ -2529,7 +2529,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
 				  u64 read_format,
 				  const struct perf_sample *sample)
 {
-	u64 *array;
+	__u64 *array;
 	size_t sz;
 	/*
 	 * used for cross-endian analysis. See git commit 65014ab3

  reply	other threads:[~2019-08-27  8:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-25 18:17 [PATCH 00/12] libperf: Add events to perf/event.h Jiri Olsa
2019-08-25 18:17 ` [PATCH 01/12] libperf: Add mmap_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_MMAP 'struct mmap_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 02/12] libperf: Add mmap2_event " Jiri Olsa
2019-08-25 18:17 ` [PATCH 03/12] libperf: Add comm_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_COMM 'struct comm_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 04/12] libperf: Add namespaces_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_NAMESPACES 'struct namespaces_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 05/12] libperf: Add fork_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_FORK 'struct fork_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 06/12] libperf: Add lost_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_LOST 'struct lost_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 07/12] libperf: Add lost_samples_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_LOST_SAMPLES 'struct lost_samples_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 08/12] libperf: Add read_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_READ 'struct read_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 09/12] libperf: Add throttle_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_THROTTLE 'struct throttle_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 10/12] libperf: Add ksymbol_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_KSYMBOL 'struct ksymbol_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 11/12] libperf: Add bpf_event " Jiri Olsa
2019-08-27  8:26   ` [tip: perf/core] libperf: Add PERF_RECORD_BPF_EVENT 'struct bpf_event' " tip-bot2 for Jiri Olsa
2019-08-25 18:17 ` [PATCH 12/12] libperf: Add sample_event " Jiri Olsa
2019-08-27  8:26   ` tip-bot2 for Jiri Olsa [this message]
2019-08-26 15:41 ` [PATCH 00/12] libperf: Add events " Arnaldo Carvalho de Melo
2019-08-26 16:47   ` Jiri Olsa
2019-08-26 22:08     ` Arnaldo Carvalho de Melo
2019-08-26 16:06 ` Arnaldo Carvalho de Melo
2019-08-26 16:18   ` Arnaldo Carvalho de Melo
2019-08-26 16:58     ` Jiri Olsa
2019-08-26 22:14       ` Arnaldo Carvalho de Melo
2019-08-26 22:41         ` Arnaldo Carvalho de Melo
2019-08-27  7:41           ` Jiri Olsa

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=156689438344.24556.1687215100185726976.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.