Skip to contentSkip to conversation

libperf: Add rest of events to perf/event.h

PATCH Applied Jiri Olsa 3 participants 48 messages Aug 28, 2019 – Aug 29, 2019

Subsystems (3)
lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

cover libperf: Add rest of events to perf/event.h

hi,
to export 'union perf_event' we need to export the rest of events.

It's also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/fixes

thanks,
jirka

---
Jiri Olsa (23):
libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h
libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h
libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h
libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h
libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h
libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h
libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h
libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h
libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h
libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h
libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h
libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h
libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h
libperf: Add 'union perf_event' to perf/event.h
libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix
libperf: Move 'enum perf_user_event_type' to perf/event.h

 tools/perf/arch/arm/util/cs-etm.c    |   4 +--
 tools/perf/arch/arm64/util/arm-spe.c |   2 +-
 tools/perf/arch/s390/util/auxtrace.c |   2 +-
 tools/perf/arch/x86/util/intel-bts.c |   2 +-
 tools/perf/arch/x86/util/intel-pt.c  |   4 +--
 tools/perf/arch/x86/util/tsc.c       |   2 +-
 tools/perf/builtin-record.c          |   4 +--
 tools/perf/builtin-report.c          |   2 +-
 tools/perf/builtin-script.c          |   2 +-
 tools/perf/builtin-stat.c            |   2 +-
 tools/perf/lib/include/perf/event.h  | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/tests/cpumap.c            |  12 ++++----
 tools/perf/tests/event_update.c      |  16 +++++-----
 tools/perf/tests/stat.c              |   8 ++---
 tools/perf/tests/thread-map.c        |   2 +-
 tools/perf/util/arm-spe.c            |   6 ++--
 tools/perf/util/auxtrace.c           |  20 ++++++------
 tools/perf/util/auxtrace.h           |   8 ++---
 tools/perf/util/build-id.c           |   2 +-
 tools/perf/util/cpumap.c             |   6 ++--
 tools/perf/util/cpumap.h             |   4 +--
 tools/perf/util/cs-etm.c             |   2 +-
 tools/perf/util/event.c              |  38 +++++++++++------------
 tools/perf/util/event.h              | 278 +++--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 tools/perf/util/header.c             |  56 +++++++++++++++++-----------------
 tools/perf/util/intel-bts.c          |   6 ++--
 tools/perf/util/intel-pt.c           |  12 ++++----
 tools/perf/util/python.c             |   4 +--
 tools/perf/util/s390-cpumsf.c        |   4 +--
 tools/perf/util/session.c            |  28 ++++++++---------
 tools/perf/util/session.h            |   2 +-
 tools/perf/util/stat.c               |  12 ++++----
 tools/perf/util/thread_map.c         |   4 +--
 tools/perf/util/thread_map.h         |   4 +--
 34 files changed, 418 insertions(+), 415 deletions(-)
author reviewer
#1 lore raw

PATCH 1/23 libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h

Move the PERF_RECORD_HEADER_ATTR event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index 36ad3a4a79e6..bb66da57d366 100644
@@ -109,4 +109,10 @@ struct perf_record_sample {
 	__u64			 array[];
 };
 
+struct attr_event {
+	struct perf_event_header header;
+	struct perf_event_attr	 attr;
+	__u64			 id[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
index 429a3fe52d6c..21fa6c2acea4 100644
@@ -363,12 +363,6 @@ struct cpu_map_event {
 	struct cpu_map_data		data;
 };
 
-struct attr_event {
-	struct perf_event_header header;
-	struct perf_event_attr attr;
-	u64 id[];
-};
-
 enum {
 	PERF_EVENT_UPDATE__UNIT  = 0,
 	PERF_EVENT_UPDATE__SCALE = 1,
Signature · 1 line
2.21.0
merge bot Applied
#2 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h

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

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

Commit-ID:     c78ad994ad99a4e03ecefe446d39dced48ba254f
Gitweb:        https://git.kernel.org/tip/c78ad994ad99a4e03ecefe446d39dced48ba254f
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:56:55 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:15:04 -03:00

libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h

Move the PERF_RECORD_HEADER_ATTR event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index 36ad3a4..bb66da5 100644
@@ -109,4 +109,10 @@ struct perf_record_sample {
 	__u64			 array[];
 };
 
+struct attr_event {
+	struct perf_event_header header;
+	struct perf_event_attr	 attr;
+	__u64			 id[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
index 429a3fe..21fa6c2 100644
@@ -363,12 +363,6 @@ struct cpu_map_event {
 	struct cpu_map_data		data;
 };
 
-struct attr_event {
-	struct perf_event_header header;
-	struct perf_event_attr attr;
-	u64 id[];
-};
-
 enum {
 	PERF_EVENT_UPDATE__UNIT  = 0,
 	PERF_EVENT_UPDATE__SCALE = 1,
author reviewer
#3 lore raw

PATCH 2/23 libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_CPU_MAP event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 26 ++++++++++++++++++++++++++
 tools/perf/util/event.h             | 26 --------------------------
 2 files changed, 26 insertions(+), 26 deletions(-)
tools/perf/lib/include/perf/event.h +26 -0
index bb66da57d366..469be778fdc1 100644
@@ -115,4 +115,30 @@ struct attr_event {
 	__u64			 id[];
 };
 
+enum {
+	PERF_CPU_MAP__CPUS = 0,
+	PERF_CPU_MAP__MASK = 1,
+};
+
+struct cpu_map_entries {
+	__u16			 nr;
+	__u16			 cpu[];
+};
+
+struct cpu_map_mask {
+	__u16			 nr;
+	__u16			 long_size;
+	unsigned long		 mask[];
+};
+
+struct cpu_map_data {
+	__u16			 type;
+	char			 data[];
+};
+
+struct cpu_map_event {
+	struct perf_event_header header;
+	struct cpu_map_data	 data;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -26
index 21fa6c2acea4..84bf67353635 100644
@@ -337,32 +337,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-enum {
-	PERF_CPU_MAP__CPUS = 0,
-	PERF_CPU_MAP__MASK = 1,
-};
-
-struct cpu_map_entries {
-	u16	nr;
-	u16	cpu[];
-};
-
-struct cpu_map_mask {
-	u16	nr;
-	u16	long_size;
-	unsigned long mask[];
-};
-
-struct cpu_map_data {
-	u16	type;
-	char	data[];
-};
-
-struct cpu_map_event {
-	struct perf_event_header	header;
-	struct cpu_map_data		data;
-};
-
 enum {
 	PERF_EVENT_UPDATE__UNIT  = 0,
 	PERF_EVENT_UPDATE__SCALE = 1,
Signature · 1 line
2.21.0
merge bot Applied
#4 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h

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

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

Commit-ID:     78e5ea1620964c4e34e9bf43e98a3def77e6bcde
Gitweb:        https://git.kernel.org/tip/78e5ea1620964c4e34e9bf43e98a3def77e6bcde
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:56:56 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:15:04 -03:00

libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h

Move the PERF_RECORD_CPU_MAP event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 26 ++++++++++++++++++++++++++
 tools/perf/util/event.h             | 26 --------------------------
 2 files changed, 26 insertions(+), 26 deletions(-)
tools/perf/lib/include/perf/event.h +26 -0
index bb66da5..469be77 100644
@@ -115,4 +115,30 @@ struct attr_event {
 	__u64			 id[];
 };
 
+enum {
+	PERF_CPU_MAP__CPUS = 0,
+	PERF_CPU_MAP__MASK = 1,
+};
+
+struct cpu_map_entries {
+	__u16			 nr;
+	__u16			 cpu[];
+};
+
+struct cpu_map_mask {
+	__u16			 nr;
+	__u16			 long_size;
+	unsigned long		 mask[];
+};
+
+struct cpu_map_data {
+	__u16			 type;
+	char			 data[];
+};
+
+struct cpu_map_event {
+	struct perf_event_header header;
+	struct cpu_map_data	 data;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -26
index 21fa6c2..84bf673 100644
@@ -338,32 +338,6 @@ struct events_stats {
 };
 
 enum {
-	PERF_CPU_MAP__CPUS = 0,
-	PERF_CPU_MAP__MASK = 1,
-};
-
-struct cpu_map_entries {
-	u16	nr;
-	u16	cpu[];
-};
-
-struct cpu_map_mask {
-	u16	nr;
-	u16	long_size;
-	unsigned long mask[];
-};
-
-struct cpu_map_data {
-	u16	type;
-	char	data[];
-};
-
-struct cpu_map_event {
-	struct perf_event_header	header;
-	struct cpu_map_data		data;
-};
-
-enum {
 	PERF_EVENT_UPDATE__UNIT  = 0,
 	PERF_EVENT_UPDATE__SCALE = 1,
 	PERF_EVENT_UPDATE__NAME  = 2,
author reviewer
#5 lore raw

PATCH 3/23 libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_EVENT_UPDATE event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 22 ++++++++++++++++++++++
 tools/perf/util/event.h             | 23 -----------------------
 tools/perf/util/header.c            |  2 +-
 3 files changed, 23 insertions(+), 24 deletions(-)
tools/perf/lib/include/perf/event.h +22 -0
index 469be778fdc1..3d99818077d8 100644
@@ -141,4 +141,26 @@ struct cpu_map_event {
 	struct cpu_map_data	 data;
 };
 
+enum {
+	PERF_EVENT_UPDATE__UNIT  = 0,
+	PERF_EVENT_UPDATE__SCALE = 1,
+	PERF_EVENT_UPDATE__NAME  = 2,
+	PERF_EVENT_UPDATE__CPUS  = 3,
+};
+
+struct event_update_event_cpus {
+	struct cpu_map_data	 cpus;
+};
+
+struct event_update_event_scale {
+	double			 scale;
+};
+
+struct event_update_event {
+	struct perf_event_header header;
+	__u64			 type;
+	__u64			 id;
+	char			 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -23
index 84bf67353635..a579e6b439d6 100644
@@ -337,29 +337,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-enum {
-	PERF_EVENT_UPDATE__UNIT  = 0,
-	PERF_EVENT_UPDATE__SCALE = 1,
-	PERF_EVENT_UPDATE__NAME  = 2,
-	PERF_EVENT_UPDATE__CPUS  = 3,
-};
-
-struct event_update_event_cpus {
-	struct cpu_map_data cpus;
-};
-
-struct event_update_event_scale {
-	double scale;
-};
-
-struct event_update_event {
-	struct perf_event_header header;
-	u64 type;
-	u64 id;
-
-	char data[];
-};
-
 #define MAX_EVENT_NAME 64
 
 struct perf_trace_event_type {
tools/perf/util/header.c +1 -1
index 1f2965a07bef..cc4998fcf4ee 100644
@@ -3892,7 +3892,7 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)
 	struct perf_cpu_map *map;
 	size_t ret;
 
-	ret = fprintf(fp, "\n... id:    %" PRIu64 "\n", ev->id);
+	ret = fprintf(fp, "\n... id:    %" PRI_lu64 "\n", ev->id);
 
 	switch (ev->type) {
 	case PERF_EVENT_UPDATE__SCALE:
Signature · 1 line
2.21.0
merge bot Applied
#6 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h

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

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

Commit-ID:     5ded068e923837068e39c0fd4ab40c0dacaa08e8
Gitweb:        https://git.kernel.org/tip/5ded068e923837068e39c0fd4ab40c0dacaa08e8
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:56:57 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:15:04 -03:00

libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h

Move the PERF_RECORD_EVENT_UPDATE event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 22 ++++++++++++++++++++++
 tools/perf/util/event.h             | 23 -----------------------
 tools/perf/util/header.c            |  2 +-
 3 files changed, 23 insertions(+), 24 deletions(-)
tools/perf/lib/include/perf/event.h +22 -0
index 469be77..3d99818 100644
@@ -141,4 +141,26 @@ struct cpu_map_event {
 	struct cpu_map_data	 data;
 };
 
+enum {
+	PERF_EVENT_UPDATE__UNIT  = 0,
+	PERF_EVENT_UPDATE__SCALE = 1,
+	PERF_EVENT_UPDATE__NAME  = 2,
+	PERF_EVENT_UPDATE__CPUS  = 3,
+};
+
+struct event_update_event_cpus {
+	struct cpu_map_data	 cpus;
+};
+
+struct event_update_event_scale {
+	double			 scale;
+};
+
+struct event_update_event {
+	struct perf_event_header header;
+	__u64			 type;
+	__u64			 id;
+	char			 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -23
index 84bf673..a579e6b 100644
@@ -337,29 +337,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-enum {
-	PERF_EVENT_UPDATE__UNIT  = 0,
-	PERF_EVENT_UPDATE__SCALE = 1,
-	PERF_EVENT_UPDATE__NAME  = 2,
-	PERF_EVENT_UPDATE__CPUS  = 3,
-};
-
-struct event_update_event_cpus {
-	struct cpu_map_data cpus;
-};
-
-struct event_update_event_scale {
-	double scale;
-};
-
-struct event_update_event {
-	struct perf_event_header header;
-	u64 type;
-	u64 id;
-
-	char data[];
-};
-
 #define MAX_EVENT_NAME 64
 
 struct perf_trace_event_type {
tools/perf/util/header.c +1 -1
index 8e67faf..629bdb1 100644
@@ -3893,7 +3893,7 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)
 	struct perf_cpu_map *map;
 	size_t ret;
 
-	ret = fprintf(fp, "\n... id:    %" PRIu64 "\n", ev->id);
+	ret = fprintf(fp, "\n... id:    %" PRI_lu64 "\n", ev->id);
 
 	switch (ev->type) {
 	case PERF_EVENT_UPDATE__SCALE:
author reviewer
#7 lore raw

PATCH 4/23 libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_HEADER_EVENT_TYPE event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 12 ++++++++++++
 tools/perf/util/event.h             | 12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)
tools/perf/lib/include/perf/event.h +12 -0
index 3d99818077d8..ecd1536a3a0c 100644
@@ -163,4 +163,16 @@ struct event_update_event {
 	char			 data[];
 };
 
+#define MAX_EVENT_NAME 64
+
+struct perf_trace_event_type {
+	__u64			 event_id;
+	char			 name[MAX_EVENT_NAME];
+};
+
+struct event_type_event {
+	struct perf_event_header	 header;
+	struct perf_trace_event_type	 event_type;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -12
index a579e6b439d6..00725a1b602b 100644
@@ -337,18 +337,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-#define MAX_EVENT_NAME 64
-
-struct perf_trace_event_type {
-	u64	event_id;
-	char	name[MAX_EVENT_NAME];
-};
-
-struct event_type_event {
-	struct perf_event_header header;
-	struct perf_trace_event_type event_type;
-};
-
 struct tracing_data_event {
 	struct perf_event_header header;
 	u32 size;
Signature · 1 line
2.21.0
merge bot Applied
#8 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h

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

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

Commit-ID:     0f5b1a28c03d416f7a66d47a9b2f18942e334fc6
Gitweb:        https://git.kernel.org/tip/0f5b1a28c03d416f7a66d47a9b2f18942e334fc6
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:56:58 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:15:04 -03:00

libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h

Move the PERF_RECORD_HEADER_EVENT_TYPE event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 12 ++++++++++++
 tools/perf/util/event.h             | 12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)
tools/perf/lib/include/perf/event.h +12 -0
index 3d99818..ecd1536 100644
@@ -163,4 +163,16 @@ struct event_update_event {
 	char			 data[];
 };
 
+#define MAX_EVENT_NAME 64
+
+struct perf_trace_event_type {
+	__u64			 event_id;
+	char			 name[MAX_EVENT_NAME];
+};
+
+struct event_type_event {
+	struct perf_event_header	 header;
+	struct perf_trace_event_type	 event_type;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -12
index a579e6b..00725a1 100644
@@ -337,18 +337,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-#define MAX_EVENT_NAME 64
-
-struct perf_trace_event_type {
-	u64	event_id;
-	char	name[MAX_EVENT_NAME];
-};
-
-struct event_type_event {
-	struct perf_event_header header;
-	struct perf_trace_event_type event_type;
-};
-
 struct tracing_data_event {
 	struct perf_event_header header;
 	u32 size;
author reviewer
#9 lore raw

PATCH 5/23 libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_HEADER_TRACING_DATA event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 5 +++++
 tools/perf/util/event.h             | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
index ecd1536a3a0c..fa81fea8dc02 100644
@@ -175,4 +175,9 @@ struct event_type_event {
 	struct perf_trace_event_type	 event_type;
 };
 
+struct tracing_data_event {
+	struct perf_event_header header;
+	__u32			 size;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
index 00725a1b602b..67f6a67ad3b4 100644
@@ -337,11 +337,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct tracing_data_event {
-	struct perf_event_header header;
-	u32 size;
-};
-
 struct id_index_entry {
 	u64 id;
 	u64 idx;
Signature · 1 line
2.21.0
merge bot Applied
#10 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h

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

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

Commit-ID:     4fd7a4d220421bc6b63a6f693e45d4397d4da055
Gitweb:        https://git.kernel.org/tip/4fd7a4d220421bc6b63a6f693e45d4397d4da055
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:56:59 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:15:04 -03:00

libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h

Move the PERF_RECORD_HEADER_TRACING_DATA event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 5 +++++
 tools/perf/util/event.h             | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
index ecd1536..fa81fea 100644
@@ -175,4 +175,9 @@ struct event_type_event {
 	struct perf_trace_event_type	 event_type;
 };
 
+struct tracing_data_event {
+	struct perf_event_header header;
+	__u32			 size;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
index 00725a1..67f6a67 100644
@@ -337,11 +337,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct tracing_data_event {
-	struct perf_event_header header;
-	u32 size;
-};
-
 struct id_index_entry {
 	u64 id;
 	u64 idx;
author reviewer
#11 lore raw

PATCH 6/23 libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_HEADER_BUILD_ID event definition to libperf's event.h.

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

Adding the fix value for build_id variable,
because it will never change.

---
 tools/perf/lib/include/perf/event.h | 8 ++++++++
 tools/perf/util/event.h             | 7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +8 -0
index fa81fea8dc02..5e6b6d16793c 100644
@@ -6,6 +6,7 @@
 #include <linux/types.h>
 #include <linux/limits.h>
 #include <linux/bpf.h>
+#include <sys/types.h> /* pid_t */
 
 struct perf_record_mmap {
 	struct perf_event_header header;
@@ -180,4 +181,11 @@ struct tracing_data_event {
 	__u32			 size;
 };
 
+struct build_id_event {
+	struct perf_event_header header;
+	pid_t			 pid;
+	__u8			 build_id[24];
+	char			 filename[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
index 67f6a67ad3b4..4b6cf89f31db 100644
@@ -144,13 +144,6 @@ struct perf_sample {
 	 PERF_MEM_S(LOCK, NA) |\
 	 PERF_MEM_S(TLB, NA))
 
-struct build_id_event {
-	struct perf_event_header header;
-	pid_t			 pid;
-	u8			 build_id[PERF_ALIGN(BUILD_ID_SIZE, sizeof(u64))];
-	char			 filename[];
-};
-
 enum perf_user_event_type { /* above any possible kernel type */
 	PERF_RECORD_USER_TYPE_START		= 64,
 	PERF_RECORD_HEADER_ATTR			= 64,
Signature · 1 line
2.21.0
merge bot Applied
#12 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h

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

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

Commit-ID:     ffd337b45b1aedc86b1de3cf8de9a79c10fd3810
Gitweb:        https://git.kernel.org/tip/ffd337b45b1aedc86b1de3cf8de9a79c10fd3810
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:00 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:15:04 -03:00

libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h

Move the PERF_RECORD_HEADER_BUILD_ID event definition to libperf's event.h.

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

Adding the fix value for build_id variable, because it will never change.

---
 tools/perf/lib/include/perf/event.h | 8 ++++++++
 tools/perf/util/event.h             | 7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +8 -0
index fa81fea..5e6b6d1 100644
@@ -6,6 +6,7 @@
 #include <linux/types.h>
 #include <linux/limits.h>
 #include <linux/bpf.h>
+#include <sys/types.h> /* pid_t */
 
 struct perf_record_mmap {
 	struct perf_event_header header;
@@ -180,4 +181,11 @@ struct tracing_data_event {
 	__u32			 size;
 };
 
+struct build_id_event {
+	struct perf_event_header header;
+	pid_t			 pid;
+	__u8			 build_id[24];
+	char			 filename[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
index 67f6a67..4b6cf89 100644
@@ -144,13 +144,6 @@ struct perf_sample {
 	 PERF_MEM_S(LOCK, NA) |\
 	 PERF_MEM_S(TLB, NA))
 
-struct build_id_event {
-	struct perf_event_header header;
-	pid_t			 pid;
-	u8			 build_id[PERF_ALIGN(BUILD_ID_SIZE, sizeof(u64))];
-	char			 filename[];
-};
-
 enum perf_user_event_type { /* above any possible kernel type */
 	PERF_RECORD_USER_TYPE_START		= 64,
 	PERF_RECORD_HEADER_ATTR			= 64,
author reviewer
#13 lore raw

PATCH 7/23 libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_ID_INDEX event definition to libperf's event.h.

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

Adding PRI_ld64 define, so we can use it in printf output.

---
 tools/perf/lib/include/perf/event.h | 13 +++++++++++++
 tools/perf/util/event.h             | 15 ++-------------
 tools/perf/util/session.c           |  8 ++++----
 3 files changed, 19 insertions(+), 17 deletions(-)
tools/perf/lib/include/perf/event.h +13 -0
index 5e6b6d16793c..c68523c4fa01 100644
@@ -188,4 +188,17 @@ struct build_id_event {
 	char			 filename[];
 };
 
+struct id_index_entry {
+	__u64			 id;
+	__u64			 idx;
+	__u64			 cpu;
+	__u64			 tid;
+};
+
+struct id_index_event {
+	struct perf_event_header header;
+	__u64			 nr;
+	struct id_index_entry	 entries[0];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +2 -13
index 4b6cf89f31db..82315d2845fe 100644
@@ -22,9 +22,11 @@
  */
 #define PRI_lu64 "l" PRIu64
 #define PRI_lx64 "l" PRIx64
+#define PRI_ld64 "l" PRId64
 #else
 #define PRI_lu64 PRIu64
 #define PRI_lx64 PRIx64
+#define PRI_ld64 PRId64
 #endif
 
 #define PERF_SAMPLE_MASK				\
@@ -330,19 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct id_index_entry {
-	u64 id;
-	u64 idx;
-	u64 cpu;
-	u64 tid;
-};
-
-struct id_index_event {
-	struct perf_event_header header;
-	u64 nr;
-	struct id_index_entry entries[0];
-};
-
 struct auxtrace_info_event {
 	struct perf_event_header header;
 	u32 type;
tools/perf/util/session.c +4 -4
index 5786e9c807c5..daa8aed27eae 100644
@@ -2392,10 +2392,10 @@ int perf_event__process_id_index(struct perf_session *session,
 		struct perf_sample_id *sid;
 
 		if (dump_trace) {
-			fprintf(stdout,	" ... id: %"PRIu64, e->id);
-			fprintf(stdout,	"  idx: %"PRIu64, e->idx);
-			fprintf(stdout,	"  cpu: %"PRId64, e->cpu);
-			fprintf(stdout,	"  tid: %"PRId64"\n", e->tid);
+			fprintf(stdout,	" ... id: %"PRI_lu64, e->id);
+			fprintf(stdout,	"  idx: %"PRI_lu64, e->idx);
+			fprintf(stdout,	"  cpu: %"PRI_ld64, e->cpu);
+			fprintf(stdout,	"  tid: %"PRI_ld64"\n", e->tid);
 		}
 
 		sid = perf_evlist__id2sid(evlist, e->id);
Signature · 1 line
2.21.0
merge bot Applied
#14 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h

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

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

Commit-ID:     fecb410030628d70401e06a98a585d735f61d7e2
Gitweb:        https://git.kernel.org/tip/fecb410030628d70401e06a98a585d735f61d7e2
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:01 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:15:05 -03:00

libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h

Move the PERF_RECORD_ID_INDEX event definition to libperf's event.h.

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

Add the PRI_ld64 define, so we can use it in printf output.

---
 tools/perf/lib/include/perf/event.h | 13 +++++++++++++
 tools/perf/util/event.h             | 15 ++-------------
 tools/perf/util/session.c           |  8 ++++----
 3 files changed, 19 insertions(+), 17 deletions(-)
tools/perf/lib/include/perf/event.h +13 -0
index 5e6b6d1..c68523c 100644
@@ -188,4 +188,17 @@ struct build_id_event {
 	char			 filename[];
 };
 
+struct id_index_entry {
+	__u64			 id;
+	__u64			 idx;
+	__u64			 cpu;
+	__u64			 tid;
+};
+
+struct id_index_event {
+	struct perf_event_header header;
+	__u64			 nr;
+	struct id_index_entry	 entries[0];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +2 -13
index 4b6cf89..82315d2 100644
@@ -22,9 +22,11 @@
  */
 #define PRI_lu64 "l" PRIu64
 #define PRI_lx64 "l" PRIx64
+#define PRI_ld64 "l" PRId64
 #else
 #define PRI_lu64 PRIu64
 #define PRI_lx64 PRIx64
+#define PRI_ld64 PRId64
 #endif
 
 #define PERF_SAMPLE_MASK				\
@@ -330,19 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct id_index_entry {
-	u64 id;
-	u64 idx;
-	u64 cpu;
-	u64 tid;
-};
-
-struct id_index_event {
-	struct perf_event_header header;
-	u64 nr;
-	struct id_index_entry entries[0];
-};
-
 struct auxtrace_info_event {
 	struct perf_event_header header;
 	u32 type;
tools/perf/util/session.c +4 -4
index a275f2e..aa96674 100644
@@ -2393,10 +2393,10 @@ int perf_event__process_id_index(struct perf_session *session,
 		struct perf_sample_id *sid;
 
 		if (dump_trace) {
-			fprintf(stdout,	" ... id: %"PRIu64, e->id);
-			fprintf(stdout,	"  idx: %"PRIu64, e->idx);
-			fprintf(stdout,	"  cpu: %"PRId64, e->cpu);
-			fprintf(stdout,	"  tid: %"PRId64"\n", e->tid);
+			fprintf(stdout,	" ... id: %"PRI_lu64, e->id);
+			fprintf(stdout,	"  idx: %"PRI_lu64, e->idx);
+			fprintf(stdout,	"  cpu: %"PRI_ld64, e->cpu);
+			fprintf(stdout,	"  tid: %"PRI_ld64"\n", e->tid);
 		}
 
 		sid = perf_evlist__id2sid(evlist, e->id);
author reviewer
#15 lore raw

PATCH 8/23 libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_AUXTRACE_INFO event definition to libperf's event.h.

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

---
 tools/perf/arch/x86/util/intel-pt.c | 2 +-
 tools/perf/lib/include/perf/event.h | 7 +++++++
 tools/perf/util/arm-spe.c           | 2 +-
 tools/perf/util/event.h             | 7 -------
 tools/perf/util/intel-bts.c         | 2 +-
 tools/perf/util/intel-pt.c          | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)
tools/perf/arch/x86/util/intel-pt.c +1 -1
index 44cfe72c1a4c..d7125e331dda 100644
@@ -327,7 +327,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	unsigned long max_non_turbo_ratio;
 	size_t filter_str_len;
 	const char *filter;
-	u64 *info;
+	__u64 *info;
 	int err;
 
 	if (priv_size != ptr->priv_size)
tools/perf/lib/include/perf/event.h +7 -0
index c68523c4fa01..02da73491451 100644
@@ -201,4 +201,11 @@ struct id_index_event {
 	struct id_index_entry	 entries[0];
 };
 
+struct auxtrace_info_event {
+	struct perf_event_header header;
+	__u32			 type;
+	__u32			 reserved__; /* For alignment */
+	__u64			 priv[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/arm-spe.c +1 -1
index a314e5b26e9d..cd26315bc9aa 100644
@@ -181,7 +181,7 @@ static const char * const arm_spe_info_fmts[] = {
 	[ARM_SPE_PMU_TYPE]		= "  PMU Type           %"PRId64"\n",
 };
 
-static void arm_spe_print_info(u64 *arr)
+static void arm_spe_print_info(__u64 *arr)
 {
 	if (!dump_trace)
 		return;
tools/perf/util/event.h +0 -7
index 82315d2845fe..ca2cae332c43 100644
@@ -332,13 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct auxtrace_info_event {
-	struct perf_event_header header;
-	u32 type;
-	u32 reserved__; /* For alignment */
-	u64 priv[];
-};
-
 struct auxtrace_event {
 	struct perf_event_header header;
 	u64 size;
tools/perf/util/intel-bts.c +1 -1
index 8dc6408206b9..03c581a0d5d0 100644
@@ -834,7 +834,7 @@ static const char * const intel_bts_info_fmts[] = {
 	[INTEL_BTS_SNAPSHOT_MODE]	= "  Snapshot mode      %"PRId64"\n",
 };
 
-static void intel_bts_print_info(u64 *arr, int start, int finish)
+static void intel_bts_print_info(__u64 *arr, int start, int finish)
 {
 	int i;
 
tools/perf/util/intel-pt.c +2 -2
index ea504fa9b623..c83a9a718c03 100644
@@ -3044,7 +3044,7 @@ static const char * const intel_pt_info_fmts[] = {
 	[INTEL_PT_FILTER_STR_LEN]	= "  Filter string len.  %"PRIu64"\n",
 };
 
-static void intel_pt_print_info(u64 *arr, int start, int finish)
+static void intel_pt_print_info(__u64 *arr, int start, int finish)
 {
 	int i;
 
@@ -3076,7 +3076,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	size_t min_sz = sizeof(u64) * INTEL_PT_PER_CPU_MMAPS;
 	struct intel_pt *pt;
 	void *info_end;
-	u64 *info;
+	__u64 *info;
 	int err;
 
 	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
Signature · 1 line
2.21.0
merge bot Applied
#16 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h

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

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

Commit-ID:     9a8dad0419552934573ddf94d11146faeda465b5
Gitweb:        https://git.kernel.org/tip/9a8dad0419552934573ddf94d11146faeda465b5
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:02 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:34:52 -03:00

libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h

Move the PERF_RECORD_AUXTRACE_INFO event definition to libperf's event.h.

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

Cc Alexander Shishkin <[email protected]>
Cc Michael Petlan <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
[ Fix cs_etm__print_auxtrace_info() arg to be __u64 too to fix the CORESIGHT=1 build ]
---
 tools/perf/arch/x86/util/intel-pt.c | 2 +-
 tools/perf/lib/include/perf/event.h | 7 +++++++
 tools/perf/util/arm-spe.c           | 2 +-
 tools/perf/util/cs-etm.c            | 2 +-
 tools/perf/util/event.h             | 7 -------
 tools/perf/util/intel-bts.c         | 2 +-
 tools/perf/util/intel-pt.c          | 4 ++--
 7 files changed, 13 insertions(+), 13 deletions(-)
tools/perf/arch/x86/util/intel-pt.c +1 -1
index 04b424a..89fe30d 100644
@@ -328,7 +328,7 @@ static int intel_pt_info_fill(struct auxtrace_record *itr,
 	unsigned long max_non_turbo_ratio;
 	size_t filter_str_len;
 	const char *filter;
-	u64 *info;
+	__u64 *info;
 	int err;
 
 	if (priv_size != ptr->priv_size)
tools/perf/lib/include/perf/event.h +7 -0
index c68523c..02da734 100644
@@ -201,4 +201,11 @@ struct id_index_event {
 	struct id_index_entry	 entries[0];
 };
 
+struct auxtrace_info_event {
+	struct perf_event_header header;
+	__u32			 type;
+	__u32			 reserved__; /* For alignment */
+	__u64			 priv[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/arm-spe.c +1 -1
index a314e5b..cd26315 100644
@@ -181,7 +181,7 @@ static const char * const arm_spe_info_fmts[] = {
 	[ARM_SPE_PMU_TYPE]		= "  PMU Type           %"PRId64"\n",
 };
 
-static void arm_spe_print_info(u64 *arr)
+static void arm_spe_print_info(__u64 *arr)
 {
 	if (!dump_trace)
 		return;
tools/perf/util/cs-etm.c +1 -1
index b3a5daa..e210c1d 100644
@@ -2370,7 +2370,7 @@ static const char * const cs_etmv4_priv_fmts[] = {
 	[CS_ETMV4_TRCAUTHSTATUS] = "	TRCAUTHSTATUS		       %llx\n",
 };
 
-static void cs_etm__print_auxtrace_info(u64 *val, int num)
+static void cs_etm__print_auxtrace_info(__u64 *val, int num)
 {
 	int i, j, cpu = 0;
 
tools/perf/util/event.h +0 -7
index 82315d2..ca2cae3 100644
@@ -332,13 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct auxtrace_info_event {
-	struct perf_event_header header;
-	u32 type;
-	u32 reserved__; /* For alignment */
-	u64 priv[];
-};
-
 struct auxtrace_event {
 	struct perf_event_header header;
 	u64 size;
tools/perf/util/intel-bts.c +1 -1
index 8dc6408..03c581a 100644
@@ -834,7 +834,7 @@ static const char * const intel_bts_info_fmts[] = {
 	[INTEL_BTS_SNAPSHOT_MODE]	= "  Snapshot mode      %"PRId64"\n",
 };
 
-static void intel_bts_print_info(u64 *arr, int start, int finish)
+static void intel_bts_print_info(__u64 *arr, int start, int finish)
 {
 	int i;
 
tools/perf/util/intel-pt.c +2 -2
index ea504fa..c83a9a7 100644
@@ -3044,7 +3044,7 @@ static const char * const intel_pt_info_fmts[] = {
 	[INTEL_PT_FILTER_STR_LEN]	= "  Filter string len.  %"PRIu64"\n",
 };
 
-static void intel_pt_print_info(u64 *arr, int start, int finish)
+static void intel_pt_print_info(__u64 *arr, int start, int finish)
 {
 	int i;
 
@@ -3076,7 +3076,7 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
 	size_t min_sz = sizeof(u64) * INTEL_PT_PER_CPU_MMAPS;
 	struct intel_pt *pt;
 	void *info_end;
-	u64 *info;
+	__u64 *info;
 	int err;
 
 	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
author reviewer
#17 lore raw

PATCH 9/23 libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_AUXTRACE event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 11 +++++++++++
 tools/perf/util/auxtrace.c          |  2 +-
 tools/perf/util/event.h             | 11 -----------
 3 files changed, 12 insertions(+), 12 deletions(-)
tools/perf/lib/include/perf/event.h +11 -0
index 02da73491451..78001c2973b6 100644
@@ -208,4 +208,15 @@ struct auxtrace_info_event {
 	__u64			 priv[];
 };
 
+struct auxtrace_event {
+	struct perf_event_header header;
+	__u64			 size;
+	__u64			 offset;
+	__u64			 reference;
+	__u32			 idx;
+	__u32			 tid;
+	__u32			 cpu;
+	__u32			 reserved__; /* For alignment */
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/auxtrace.c +1 -1
index 12e9b7acbb2c..0d2ba1397e47 100644
@@ -942,7 +942,7 @@ s64 perf_event__process_auxtrace(struct perf_session *session,
 	s64 err;
 
 	if (dump_trace)
-		fprintf(stdout, " size: %#"PRIx64"  offset: %#"PRIx64"  ref: %#"PRIx64"  idx: %u  tid: %d  cpu: %d\n",
+		fprintf(stdout, " size: %#"PRI_lx64"  offset: %#"PRI_lx64"  ref: %#"PRI_lx64"  idx: %u  tid: %d  cpu: %d\n",
 			event->auxtrace.size, event->auxtrace.offset,
 			event->auxtrace.reference, event->auxtrace.idx,
 			event->auxtrace.tid, event->auxtrace.cpu);
tools/perf/util/event.h +0 -11
index ca2cae332c43..60895a3b2c85 100644
@@ -332,17 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct auxtrace_event {
-	struct perf_event_header header;
-	u64 size;
-	u64 offset;
-	u64 reference;
-	u32 idx;
-	u32 tid;
-	u32 cpu;
-	u32 reserved__; /* For alignment */
-};
-
 #define MAX_AUXTRACE_ERROR_MSG 64
 
 struct auxtrace_error_event {
Signature · 1 line
2.21.0
merge bot Applied
#18 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h

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

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

Commit-ID:     306c9d24c09d84d80ae54b36f7f907c8b8fa537a
Gitweb:        https://git.kernel.org/tip/306c9d24c09d84d80ae54b36f7f907c8b8fa537a
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:03 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:11 -03:00

libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h

Move the PERF_RECORD_AUXTRACE event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 11 +++++++++++
 tools/perf/util/auxtrace.c          |  2 +-
 tools/perf/util/event.h             | 11 -----------
 3 files changed, 12 insertions(+), 12 deletions(-)
tools/perf/lib/include/perf/event.h +11 -0
index 02da734..78001c2 100644
@@ -208,4 +208,15 @@ struct auxtrace_info_event {
 	__u64			 priv[];
 };
 
+struct auxtrace_event {
+	struct perf_event_header header;
+	__u64			 size;
+	__u64			 offset;
+	__u64			 reference;
+	__u32			 idx;
+	__u32			 tid;
+	__u32			 cpu;
+	__u32			 reserved__; /* For alignment */
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/auxtrace.c +1 -1
index 112c24a..5edec71 100644
@@ -943,7 +943,7 @@ s64 perf_event__process_auxtrace(struct perf_session *session,
 	s64 err;
 
 	if (dump_trace)
-		fprintf(stdout, " size: %#"PRIx64"  offset: %#"PRIx64"  ref: %#"PRIx64"  idx: %u  tid: %d  cpu: %d\n",
+		fprintf(stdout, " size: %#"PRI_lx64"  offset: %#"PRI_lx64"  ref: %#"PRI_lx64"  idx: %u  tid: %d  cpu: %d\n",
 			event->auxtrace.size, event->auxtrace.offset,
 			event->auxtrace.reference, event->auxtrace.idx,
 			event->auxtrace.tid, event->auxtrace.cpu);
tools/perf/util/event.h +0 -11
index ca2cae3..60895a3 100644
@@ -332,17 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct auxtrace_event {
-	struct perf_event_header header;
-	u64 size;
-	u64 offset;
-	u64 reference;
-	u32 idx;
-	u32 tid;
-	u32 cpu;
-	u32 reserved__; /* For alignment */
-};
-
 #define MAX_AUXTRACE_ERROR_MSG 64
 
 struct auxtrace_error_event {
author reviewer
#19 lore raw

PATCH 10/23 libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_AUXTRACE_ERROR event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 15 +++++++++++++++
 tools/perf/util/auxtrace.c          |  2 +-
 tools/perf/util/event.h             | 15 ---------------
 3 files changed, 16 insertions(+), 16 deletions(-)
tools/perf/lib/include/perf/event.h +15 -0
index 78001c2973b6..6292b7c41bac 100644
@@ -219,4 +219,19 @@ struct auxtrace_event {
 	__u32			 reserved__; /* For alignment */
 };
 
+#define MAX_AUXTRACE_ERROR_MSG 64
+
+struct auxtrace_error_event {
+	struct perf_event_header header;
+	__u32			 type;
+	__u32			 code;
+	__u32			 cpu;
+	__u32			 pid;
+	__u32			 tid;
+	__u32			 fmt;
+	__u64			 ip;
+	__u64			 time;
+	char			 msg[MAX_AUXTRACE_ERROR_MSG];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/auxtrace.c +1 -1
index 0d2ba1397e47..cddf04c45a20 100644
@@ -1188,7 +1188,7 @@ size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)
 	if (!e->fmt)
 		msg = (const char *)&e->time;
 
-	ret += fprintf(fp, " cpu %d pid %d tid %d ip %#"PRIx64" code %u: %s\n",
+	ret += fprintf(fp, " cpu %d pid %d tid %d ip %#"PRI_lx64" code %u: %s\n",
 		       e->cpu, e->pid, e->tid, e->ip, e->code, msg);
 	return ret;
 }
tools/perf/util/event.h +0 -15
index 60895a3b2c85..e334ecbe50a0 100644
@@ -332,21 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-#define MAX_AUXTRACE_ERROR_MSG 64
-
-struct auxtrace_error_event {
-	struct perf_event_header header;
-	u32 type;
-	u32 code;
-	u32 cpu;
-	u32 pid;
-	u32 tid;
-	u32 fmt;
-	u64 ip;
-	u64 time;
-	char msg[MAX_AUXTRACE_ERROR_MSG];
-};
-
 struct aux_event {
 	struct perf_event_header header;
 	u64	aux_offset;
Signature · 1 line
2.21.0
merge bot Applied
#20 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h

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

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

Commit-ID:     3460efb2e842cccc4566756f194a1be0547f7098
Gitweb:        https://git.kernel.org/tip/3460efb2e842cccc4566756f194a1be0547f7098
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:04 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:11 -03:00

libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h

Move the PERF_RECORD_AUXTRACE_ERROR event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 15 +++++++++++++++
 tools/perf/util/auxtrace.c          |  2 +-
 tools/perf/util/event.h             | 15 ---------------
 3 files changed, 16 insertions(+), 16 deletions(-)
tools/perf/lib/include/perf/event.h +15 -0
index 78001c2..6292b7c 100644
@@ -219,4 +219,19 @@ struct auxtrace_event {
 	__u32			 reserved__; /* For alignment */
 };
 
+#define MAX_AUXTRACE_ERROR_MSG 64
+
+struct auxtrace_error_event {
+	struct perf_event_header header;
+	__u32			 type;
+	__u32			 code;
+	__u32			 cpu;
+	__u32			 pid;
+	__u32			 tid;
+	__u32			 fmt;
+	__u64			 ip;
+	__u64			 time;
+	char			 msg[MAX_AUXTRACE_ERROR_MSG];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/auxtrace.c +1 -1
index 5edec71..c3da8a0 100644
@@ -1189,7 +1189,7 @@ size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)
 	if (!e->fmt)
 		msg = (const char *)&e->time;
 
-	ret += fprintf(fp, " cpu %d pid %d tid %d ip %#"PRIx64" code %u: %s\n",
+	ret += fprintf(fp, " cpu %d pid %d tid %d ip %#"PRI_lx64" code %u: %s\n",
 		       e->cpu, e->pid, e->tid, e->ip, e->code, msg);
 	return ret;
 }
tools/perf/util/event.h +0 -15
index 60895a3..e334ecb 100644
@@ -332,21 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-#define MAX_AUXTRACE_ERROR_MSG 64
-
-struct auxtrace_error_event {
-	struct perf_event_header header;
-	u32 type;
-	u32 code;
-	u32 cpu;
-	u32 pid;
-	u32 tid;
-	u32 fmt;
-	u64 ip;
-	u64 time;
-	char msg[MAX_AUXTRACE_ERROR_MSG];
-};
-
 struct aux_event {
 	struct perf_event_header header;
 	u64	aux_offset;
author reviewer
#21 lore raw

PATCH 11/23 libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_AUX event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 7 +++++++
 tools/perf/util/event.c             | 2 +-
 tools/perf/util/event.h             | 7 -------
 3 files changed, 8 insertions(+), 8 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
index 6292b7c41bac..d453ac833a58 100644
@@ -234,4 +234,11 @@ struct auxtrace_error_event {
 	char			 msg[MAX_AUXTRACE_ERROR_MSG];
 };
 
+struct aux_event {
+	struct perf_event_header header;
+	__u64			 aux_offset;
+	__u64			 aux_size;
+	__u64			 flags;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
index 33616ea62a47..85f9f27782b1 100644
@@ -1448,7 +1448,7 @@ int perf_event__process_exit(struct perf_tool *tool __maybe_unused,
 
 size_t perf_event__fprintf_aux(union perf_event *event, FILE *fp)
 {
-	return fprintf(fp, " offset: %#"PRIx64" size: %#"PRIx64" flags: %#"PRIx64" [%s%s%s]\n",
+	return fprintf(fp, " offset: %#"PRI_lx64" size: %#"PRI_lx64" flags: %#"PRI_lx64" [%s%s%s]\n",
 		       event->aux.aux_offset, event->aux.aux_size,
 		       event->aux.flags,
 		       event->aux.flags & PERF_AUX_FLAG_TRUNCATED ? "T" : "",
tools/perf/util/event.h +0 -7
index e334ecbe50a0..db901aea33af 100644
@@ -332,13 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct aux_event {
-	struct perf_event_header header;
-	u64	aux_offset;
-	u64	aux_size;
-	u64	flags;
-};
-
 struct itrace_start_event {
 	struct perf_event_header header;
 	u32 pid, tid;
Signature · 1 line
2.21.0
merge bot Applied
#22 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h

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

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

Commit-ID:     aedebdca09ca6efa7efbc0bf26d94cb235120ee4
Gitweb:        https://git.kernel.org/tip/aedebdca09ca6efa7efbc0bf26d94cb235120ee4
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:05 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:11 -03:00

libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h

Move the PERF_RECORD_AUX event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 7 +++++++
 tools/perf/util/event.c             | 2 +-
 tools/perf/util/event.h             | 7 -------
 3 files changed, 8 insertions(+), 8 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
index 6292b7c..d453ac8 100644
@@ -234,4 +234,11 @@ struct auxtrace_error_event {
 	char			 msg[MAX_AUXTRACE_ERROR_MSG];
 };
 
+struct aux_event {
+	struct perf_event_header header;
+	__u64			 aux_offset;
+	__u64			 aux_size;
+	__u64			 flags;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
index e33dd1a..b048e60 100644
@@ -1449,7 +1449,7 @@ int perf_event__process_exit(struct perf_tool *tool __maybe_unused,
 
 size_t perf_event__fprintf_aux(union perf_event *event, FILE *fp)
 {
-	return fprintf(fp, " offset: %#"PRIx64" size: %#"PRIx64" flags: %#"PRIx64" [%s%s%s]\n",
+	return fprintf(fp, " offset: %#"PRI_lx64" size: %#"PRI_lx64" flags: %#"PRI_lx64" [%s%s%s]\n",
 		       event->aux.aux_offset, event->aux.aux_size,
 		       event->aux.flags,
 		       event->aux.flags & PERF_AUX_FLAG_TRUNCATED ? "T" : "",
tools/perf/util/event.h +0 -7
index e334ecb..db901ae 100644
@@ -332,13 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct aux_event {
-	struct perf_event_header header;
-	u64	aux_offset;
-	u64	aux_size;
-	u64	flags;
-};
-
 struct itrace_start_event {
 	struct perf_event_header header;
 	u32 pid, tid;
author reviewer
#23 lore raw

PATCH 12/23 libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_ITRACE_START event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index d453ac833a58..3bcbc1eaeb35 100644
@@ -241,4 +241,10 @@ struct aux_event {
 	__u64			 flags;
 };
 
+struct itrace_start_event {
+	struct perf_event_header header;
+	__u32			 pid;
+	__u32			 tid;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
index db901aea33af..f89e8ddadd46 100644
@@ -332,11 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct itrace_start_event {
-	struct perf_event_header header;
-	u32 pid, tid;
-};
-
 struct context_switch_event {
 	struct perf_event_header header;
 	u32 next_prev_pid;
Signature · 1 line
2.21.0
merge bot Applied
#24 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h

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

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

Commit-ID:     f279ad63a09da65766dfeaf03cfd659f95414936
Gitweb:        https://git.kernel.org/tip/f279ad63a09da65766dfeaf03cfd659f95414936
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:06 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:11 -03:00

libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h

Move the PERF_RECORD_ITRACE_START event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index d453ac8..3bcbc1e 100644
@@ -241,4 +241,10 @@ struct aux_event {
 	__u64			 flags;
 };
 
+struct itrace_start_event {
+	struct perf_event_header header;
+	__u32			 pid;
+	__u32			 tid;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
index db901ae..f89e8dd 100644
@@ -332,11 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct itrace_start_event {
-	struct perf_event_header header;
-	u32 pid, tid;
-};
-
 struct context_switch_event {
 	struct perf_event_header header;
 	u32 next_prev_pid;
author reviewer
#25 lore raw

PATCH 13/23 libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_SWITCH event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index 3bcbc1eaeb35..a7b0344bb8b4 100644
@@ -110,6 +110,12 @@ struct perf_record_sample {
 	__u64			 array[];
 };
 
+struct context_switch_event {
+	struct perf_event_header header;
+	__u32			 next_prev_pid;
+	__u32			 next_prev_tid;
+};
+
 struct attr_event {
 	struct perf_event_header header;
 	struct perf_event_attr	 attr;
tools/perf/util/event.h +0 -6
index f89e8ddadd46..012b2ba9a9a8 100644
@@ -332,12 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct context_switch_event {
-	struct perf_event_header header;
-	u32 next_prev_pid;
-	u32 next_prev_tid;
-};
-
 struct thread_map_event_entry {
 	u64	pid;
 	char	comm[16];
Signature · 1 line
2.21.0
merge bot Applied
#26 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h

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

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

Commit-ID:     6b49aaebd05fdbb29a4ab6e28b4fa91539c64877
Gitweb:        https://git.kernel.org/tip/6b49aaebd05fdbb29a4ab6e28b4fa91539c64877
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:07 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:11 -03:00

libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h

Move the PERF_RECORD_SWITCH event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index 3bcbc1e..a7b0344 100644
@@ -110,6 +110,12 @@ struct perf_record_sample {
 	__u64			 array[];
 };
 
+struct context_switch_event {
+	struct perf_event_header header;
+	__u32			 next_prev_pid;
+	__u32			 next_prev_tid;
+};
+
 struct attr_event {
 	struct perf_event_header header;
 	struct perf_event_attr	 attr;
tools/perf/util/event.h +0 -6
index f89e8dd..012b2ba 100644
@@ -332,12 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct context_switch_event {
-	struct perf_event_header header;
-	u32 next_prev_pid;
-	u32 next_prev_tid;
-};
-
 struct thread_map_event_entry {
 	u64	pid;
 	char	comm[16];
author reviewer
#27 lore raw

PATCH 14/23 libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_THREAD_MAP event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 11 +++++++++++
 tools/perf/util/event.h             | 11 -----------
 2 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/lib/include/perf/event.h +11 -0
index a7b0344bb8b4..fe0ce655af17 100644
@@ -253,4 +253,15 @@ struct itrace_start_event {
 	__u32			 tid;
 };
 
+struct thread_map_event_entry {
+	__u64			 pid;
+	char			 comm[16];
+};
+
+struct thread_map_event {
+	struct perf_event_header	 header;
+	__u64				 nr;
+	struct thread_map_event_entry	 entries[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -11
index 012b2ba9a9a8..3a856696c6b1 100644
@@ -332,17 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct thread_map_event_entry {
-	u64	pid;
-	char	comm[16];
-};
-
-struct thread_map_event {
-	struct perf_event_header	header;
-	u64				nr;
-	struct thread_map_event_entry	entries[];
-};
-
 enum {
 	PERF_STAT_CONFIG_TERM__AGGR_MODE	= 0,
 	PERF_STAT_CONFIG_TERM__INTERVAL		= 1,
Signature · 1 line
2.21.0
merge bot Applied
#28 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h

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

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

Commit-ID:     3e4c453f5cbac75afec37eedd0ffcd8dac82e23e
Gitweb:        https://git.kernel.org/tip/3e4c453f5cbac75afec37eedd0ffcd8dac82e23e
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:08 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:11 -03:00

libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h

Move the PERF_RECORD_THREAD_MAP event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 11 +++++++++++
 tools/perf/util/event.h             | 11 -----------
 2 files changed, 11 insertions(+), 11 deletions(-)
tools/perf/lib/include/perf/event.h +11 -0
index a7b0344..fe0ce65 100644
@@ -253,4 +253,15 @@ struct itrace_start_event {
 	__u32			 tid;
 };
 
+struct thread_map_event_entry {
+	__u64			 pid;
+	char			 comm[16];
+};
+
+struct thread_map_event {
+	struct perf_event_header	 header;
+	__u64				 nr;
+	struct thread_map_event_entry	 entries[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -11
index 012b2ba..3a85669 100644
@@ -332,17 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct thread_map_event_entry {
-	u64	pid;
-	char	comm[16];
-};
-
-struct thread_map_event {
-	struct perf_event_header	header;
-	u64				nr;
-	struct thread_map_event_entry	entries[];
-};
-
 enum {
 	PERF_STAT_CONFIG_TERM__AGGR_MODE	= 0,
 	PERF_STAT_CONFIG_TERM__INTERVAL		= 1,
author reviewer
#29 lore raw

PATCH 15/23 libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_STAT_CONFIG event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 18 ++++++++++++++++++
 tools/perf/util/event.c             |  2 +-
 tools/perf/util/event.h             | 18 ------------------
 3 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/lib/include/perf/event.h +18 -0
index fe0ce655af17..ba6ed243a31f 100644
@@ -264,4 +264,22 @@ struct thread_map_event {
 	struct thread_map_event_entry	 entries[];
 };
 
+enum {
+	PERF_STAT_CONFIG_TERM__AGGR_MODE	= 0,
+	PERF_STAT_CONFIG_TERM__INTERVAL		= 1,
+	PERF_STAT_CONFIG_TERM__SCALE		= 2,
+	PERF_STAT_CONFIG_TERM__MAX		= 3,
+};
+
+struct stat_config_event_entry {
+	__u64			 tag;
+	__u64			 val;
+};
+
+struct stat_config_event {
+	struct perf_event_header	 header;
+	__u64				 nr;
+	struct stat_config_event_entry	 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
index 85f9f27782b1..2369333d61d8 100644
@@ -1234,7 +1234,7 @@ void perf_event__read_stat_config(struct perf_stat_config *config,
 		CASE(INTERVAL,  interval)
 #undef CASE
 		default:
-			pr_warning("unknown stat config term %" PRIu64 "\n",
+			pr_warning("unknown stat config term %" PRI_lu64 "\n",
 				   event->data[i].tag);
 		}
 	}
tools/perf/util/event.h +0 -18
index 3a856696c6b1..68531d08dcec 100644
@@ -332,24 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-enum {
-	PERF_STAT_CONFIG_TERM__AGGR_MODE	= 0,
-	PERF_STAT_CONFIG_TERM__INTERVAL		= 1,
-	PERF_STAT_CONFIG_TERM__SCALE		= 2,
-	PERF_STAT_CONFIG_TERM__MAX		= 3,
-};
-
-struct stat_config_event_entry {
-	u64	tag;
-	u64	val;
-};
-
-struct stat_config_event {
-	struct perf_event_header	header;
-	u64				nr;
-	struct stat_config_event_entry	data[];
-};
-
 struct stat_event {
 	struct perf_event_header	header;
 
Signature · 1 line
2.21.0
merge bot Applied
#30 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h

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

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

Commit-ID:     c5f416e6c69e333207666a1ddab0b41c6f12e588
Gitweb:        https://git.kernel.org/tip/c5f416e6c69e333207666a1ddab0b41c6f12e588
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:09 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:11 -03:00

libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h

Move the PERF_RECORD_STAT_CONFIG event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 18 ++++++++++++++++++
 tools/perf/util/event.c             |  2 +-
 tools/perf/util/event.h             | 18 ------------------
 3 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/lib/include/perf/event.h +18 -0
index fe0ce65..ba6ed24 100644
@@ -264,4 +264,22 @@ struct thread_map_event {
 	struct thread_map_event_entry	 entries[];
 };
 
+enum {
+	PERF_STAT_CONFIG_TERM__AGGR_MODE	= 0,
+	PERF_STAT_CONFIG_TERM__INTERVAL		= 1,
+	PERF_STAT_CONFIG_TERM__SCALE		= 2,
+	PERF_STAT_CONFIG_TERM__MAX		= 3,
+};
+
+struct stat_config_event_entry {
+	__u64			 tag;
+	__u64			 val;
+};
+
+struct stat_config_event {
+	struct perf_event_header	 header;
+	__u64				 nr;
+	struct stat_config_event_entry	 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.c +1 -1
index b048e60..b711019 100644
@@ -1235,7 +1235,7 @@ void perf_event__read_stat_config(struct perf_stat_config *config,
 		CASE(INTERVAL,  interval)
 #undef CASE
 		default:
-			pr_warning("unknown stat config term %" PRIu64 "\n",
+			pr_warning("unknown stat config term %" PRI_lu64 "\n",
 				   event->data[i].tag);
 		}
 	}
tools/perf/util/event.h +0 -18
index 3a85669..68531d0 100644
@@ -332,24 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-enum {
-	PERF_STAT_CONFIG_TERM__AGGR_MODE	= 0,
-	PERF_STAT_CONFIG_TERM__INTERVAL		= 1,
-	PERF_STAT_CONFIG_TERM__SCALE		= 2,
-	PERF_STAT_CONFIG_TERM__MAX		= 3,
-};
-
-struct stat_config_event_entry {
-	u64	tag;
-	u64	val;
-};
-
-struct stat_config_event {
-	struct perf_event_header	header;
-	u64				nr;
-	struct stat_config_event_entry	data[];
-};
-
 struct stat_event {
 	struct perf_event_header	header;
 
author reviewer
#31 lore raw

PATCH 16/23 libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_STAT event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 17 +++++++++++++++++
 tools/perf/util/event.h             | 17 -----------------
 tools/perf/util/stat.c              |  4 ++--
 3 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/lib/include/perf/event.h +17 -0
index ba6ed243a31f..7d1834f558d6 100644
@@ -282,4 +282,21 @@ struct stat_config_event {
 	struct stat_config_event_entry	 data[];
 };
 
+struct stat_event {
+	struct perf_event_header header;
+
+	__u64			 id;
+	__u32			 cpu;
+	__u32			 thread;
+
+	union {
+		struct {
+			__u64	 val;
+			__u64	 ena;
+			__u64	 run;
+		};
+		__u64		 values[3];
+	};
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -17
index 68531d08dcec..f3a02e01852a 100644
@@ -332,23 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct stat_event {
-	struct perf_event_header	header;
-
-	u64	id;
-	u32	cpu;
-	u32	thread;
-
-	union {
-		struct {
-			u64 val;
-			u64 ena;
-			u64 run;
-		};
-		u64 values[3];
-	};
-};
-
 enum {
 	PERF_STAT_ROUND_TYPE__INTERVAL	= 0,
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
tools/perf/util/stat.c +2 -2
index f985336b3a22..c0cd9f9bb0ea 100644
@@ -405,9 +405,9 @@ size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)
 	struct stat_event *st = (struct stat_event *) event;
 	size_t ret;
 
-	ret  = fprintf(fp, "\n... id %" PRIu64 ", cpu %d, thread %d\n",
+	ret  = fprintf(fp, "\n... id %" PRI_lu64 ", cpu %d, thread %d\n",
 		       st->id, st->cpu, st->thread);
-	ret += fprintf(fp, "... value %" PRIu64 ", enabled %" PRIu64 ", running %" PRIu64 "\n",
+	ret += fprintf(fp, "... value %" PRI_lu64 ", enabled %" PRI_lu64 ", running %" PRI_lu64 "\n",
 		       st->val, st->ena, st->run);
 
 	return ret;
Signature · 1 line
2.21.0
merge bot Applied
#32 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h

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

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

Commit-ID:     18a13a60f6f50f2fb1f7354f6d0b2ded01995443
Gitweb:        https://git.kernel.org/tip/18a13a60f6f50f2fb1f7354f6d0b2ded01995443
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:10 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h

Move the PERF_RECORD_STAT event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 17 +++++++++++++++++
 tools/perf/util/event.h             | 17 -----------------
 tools/perf/util/stat.c              |  4 ++--
 3 files changed, 19 insertions(+), 19 deletions(-)
tools/perf/lib/include/perf/event.h +17 -0
index ba6ed24..7d1834f 100644
@@ -282,4 +282,21 @@ struct stat_config_event {
 	struct stat_config_event_entry	 data[];
 };
 
+struct stat_event {
+	struct perf_event_header header;
+
+	__u64			 id;
+	__u32			 cpu;
+	__u32			 thread;
+
+	union {
+		struct {
+			__u64	 val;
+			__u64	 ena;
+			__u64	 run;
+		};
+		__u64		 values[3];
+	};
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -17
index 68531d0..f3a02e0 100644
@@ -332,23 +332,6 @@ struct events_stats {
 	u32 nr_proc_map_timeout;
 };
 
-struct stat_event {
-	struct perf_event_header	header;
-
-	u64	id;
-	u32	cpu;
-	u32	thread;
-
-	union {
-		struct {
-			u64 val;
-			u64 ena;
-			u64 run;
-		};
-		u64 values[3];
-	};
-};
-
 enum {
 	PERF_STAT_ROUND_TYPE__INTERVAL	= 0,
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
tools/perf/util/stat.c +2 -2
index f985336..c0cd9f9 100644
@@ -405,9 +405,9 @@ size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)
 	struct stat_event *st = (struct stat_event *) event;
 	size_t ret;
 
-	ret  = fprintf(fp, "\n... id %" PRIu64 ", cpu %d, thread %d\n",
+	ret  = fprintf(fp, "\n... id %" PRI_lu64 ", cpu %d, thread %d\n",
 		       st->id, st->cpu, st->thread);
-	ret += fprintf(fp, "... value %" PRIu64 ", enabled %" PRIu64 ", running %" PRIu64 "\n",
+	ret += fprintf(fp, "... value %" PRI_lu64 ", enabled %" PRI_lu64 ", running %" PRI_lu64 "\n",
 		       st->val, st->ena, st->run);
 
 	return ret;
author reviewer
#33 lore raw

PATCH 17/23 libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_STAT_ROUND event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 tools/perf/util/stat.c              | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index 7d1834f558d6..34d365bd2c5c 100644
@@ -299,4 +299,10 @@ struct stat_event {
 	};
 };
 
+struct stat_round_event {
+	struct perf_event_header header;
+	__u64			 type;
+	__u64			 time;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
index f3a02e01852a..ec76412afba1 100644
@@ -337,12 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct stat_round_event {
-	struct perf_event_header	header;
-	u64				type;
-	u64				time;
-};
-
 struct time_conv_event {
 	struct perf_event_header header;
 	u64 time_shift;
tools/perf/util/stat.c +1 -1
index c0cd9f9bb0ea..4c7957496e7c 100644
@@ -418,7 +418,7 @@ size_t perf_event__fprintf_stat_round(union perf_event *event, FILE *fp)
 	struct stat_round_event *rd = (struct stat_round_event *)event;
 	size_t ret;
 
-	ret = fprintf(fp, "\n... time %" PRIu64 ", type %s\n", rd->time,
+	ret = fprintf(fp, "\n... time %" PRI_lu64 ", type %s\n", rd->time,
 		      rd->type == PERF_STAT_ROUND_TYPE__FINAL ? "FINAL" : "INTERVAL");
 
 	return ret;
Signature · 1 line
2.21.0
merge bot Applied
#34 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h

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

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

Commit-ID:     782adbe2964953803ea1a38b80f6255c336cdd7b
Gitweb:        https://git.kernel.org/tip/782adbe2964953803ea1a38b80f6255c336cdd7b
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:11 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h

Move the PERF_RECORD_STAT_ROUND event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 tools/perf/util/stat.c              | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +6 -0
index 7d1834f..34d365b 100644
@@ -299,4 +299,10 @@ struct stat_event {
 	};
 };
 
+struct stat_round_event {
+	struct perf_event_header header;
+	__u64			 type;
+	__u64			 time;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
index f3a02e0..ec76412 100644
@@ -337,12 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct stat_round_event {
-	struct perf_event_header	header;
-	u64				type;
-	u64				time;
-};
-
 struct time_conv_event {
 	struct perf_event_header header;
 	u64 time_shift;
tools/perf/util/stat.c +1 -1
index c0cd9f9..4c79574 100644
@@ -418,7 +418,7 @@ size_t perf_event__fprintf_stat_round(union perf_event *event, FILE *fp)
 	struct stat_round_event *rd = (struct stat_round_event *)event;
 	size_t ret;
 
-	ret = fprintf(fp, "\n... time %" PRIu64 ", type %s\n", rd->time,
+	ret = fprintf(fp, "\n... time %" PRI_lu64 ", type %s\n", rd->time,
 		      rd->type == PERF_STAT_ROUND_TYPE__FINAL ? "FINAL" : "INTERVAL");
 
 	return ret;
author reviewer
#35 lore raw

PATCH 18/23 libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_TIME_CONV event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 7 +++++++
 tools/perf/util/event.h             | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
index 34d365bd2c5c..7600f53f6ad1 100644
@@ -305,4 +305,11 @@ struct stat_round_event {
 	__u64			 time;
 };
 
+struct time_conv_event {
+	struct perf_event_header header;
+	__u64			 time_shift;
+	__u64			 time_mult;
+	__u64			 time_zero;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
index ec76412afba1..d758485956b3 100644
@@ -337,13 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct time_conv_event {
-	struct perf_event_header header;
-	u64 time_shift;
-	u64 time_mult;
-	u64 time_zero;
-};
-
 struct feature_event {
 	struct perf_event_header 	header;
 	u64				feat_id;
Signature · 1 line
2.21.0
merge bot Applied
#36 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h

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

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

Commit-ID:     bfd922d8f09a692f2a952a67451bc3eeaad3fb73
Gitweb:        https://git.kernel.org/tip/bfd922d8f09a692f2a952a67451bc3eeaad3fb73
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:12 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h

Move the PERF_RECORD_TIME_CONV event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 7 +++++++
 tools/perf/util/event.h             | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/lib/include/perf/event.h +7 -0
index 34d365b..7600f53 100644
@@ -305,4 +305,11 @@ struct stat_round_event {
 	__u64			 time;
 };
 
+struct time_conv_event {
+	struct perf_event_header header;
+	__u64			 time_shift;
+	__u64			 time_mult;
+	__u64			 time_zero;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -7
index ec76412..d758485 100644
@@ -337,13 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct time_conv_event {
-	struct perf_event_header header;
-	u64 time_shift;
-	u64 time_mult;
-	u64 time_zero;
-};
-
 struct feature_event {
 	struct perf_event_header 	header;
 	u64				feat_id;
author reviewer
#37 lore raw

PATCH 19/23 libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_HEADER_FEATURE event definition to libperf's event.h.

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

---
 tools/perf/builtin-report.c         | 2 +-
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-report.c +1 -1
index 318b0b95c14c..0d71f26a8a44 100644
@@ -211,7 +211,7 @@ static int process_feature_event(struct perf_session *session,
 		return perf_event__process_feature(session, event);
 
 	if (event->feat.feat_id != HEADER_LAST_FEATURE) {
-		pr_err("failed: wrong feature ID: %" PRIu64 "\n",
+		pr_err("failed: wrong feature ID: %" PRI_lu64 "\n",
 		       event->feat.feat_id);
 		return -1;
 	}
tools/perf/lib/include/perf/event.h +6 -0
index 7600f53f6ad1..ed1c22e650e2 100644
@@ -312,4 +312,10 @@ struct time_conv_event {
 	__u64			 time_zero;
 };
 
+struct feature_event {
+	struct perf_event_header header;
+	__u64			 feat_id;
+	char			 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
index d758485956b3..94777ee435c2 100644
@@ -337,12 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct feature_event {
-	struct perf_event_header 	header;
-	u64				feat_id;
-	char				data[];
-};
-
 struct compressed_event {
 	struct perf_event_header	header;
 	char				data[];
Signature · 1 line
2.21.0
merge bot Applied
#38 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h

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

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

Commit-ID:     1b8896fb296f4087c45c997c4b212544c639e272
Gitweb:        https://git.kernel.org/tip/1b8896fb296f4087c45c997c4b212544c639e272
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:13 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h

Move the PERF_RECORD_HEADER_FEATURE event definition to libperf's event.h.

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

---
 tools/perf/builtin-report.c         | 2 +-
 tools/perf/lib/include/perf/event.h | 6 ++++++
 tools/perf/util/event.h             | 6 ------
 3 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/builtin-report.c +1 -1
index 0338916..33c20e2 100644
@@ -212,7 +212,7 @@ static int process_feature_event(struct perf_session *session,
 		return perf_event__process_feature(session, event);
 
 	if (event->feat.feat_id != HEADER_LAST_FEATURE) {
-		pr_err("failed: wrong feature ID: %" PRIu64 "\n",
+		pr_err("failed: wrong feature ID: %" PRI_lu64 "\n",
 		       event->feat.feat_id);
 		return -1;
 	}
tools/perf/lib/include/perf/event.h +6 -0
index 7600f53..ed1c22e 100644
@@ -312,4 +312,10 @@ struct time_conv_event {
 	__u64			 time_zero;
 };
 
+struct feature_event {
+	struct perf_event_header header;
+	__u64			 feat_id;
+	char			 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -6
index d758485..94777ee 100644
@@ -337,12 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct feature_event {
-	struct perf_event_header 	header;
-	u64				feat_id;
-	char				data[];
-};
-
 struct compressed_event {
 	struct perf_event_header	header;
 	char				data[];
author reviewer
#39 lore raw

PATCH 20/23 libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h

In reply to Jiri Olsa

Move the PERF_RECORD_COMPRESSED event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 5 +++++
 tools/perf/util/event.h             | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
index ed1c22e650e2..ef7a46e82a6d 100644
@@ -318,4 +318,9 @@ struct feature_event {
 	char			 data[];
 };
 
+struct compressed_event {
+	struct perf_event_header header;
+	char			 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
index 94777ee435c2..ee2ee23e4c46 100644
@@ -337,11 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct compressed_event {
-	struct perf_event_header	header;
-	char				data[];
-};
-
 union perf_event {
 	struct perf_event_header	header;
 	struct perf_record_mmap		mmap;
Signature · 1 line
2.21.0
merge bot Applied
#40 lore raw

[tip: perf/core] libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h

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

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

Commit-ID:     f5f684321791eb5ebb8c56d7d223e71fe08b5dd9
Gitweb:        https://git.kernel.org/tip/f5f684321791eb5ebb8c56d7d223e71fe08b5dd9
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:14 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h

Move the PERF_RECORD_COMPRESSED event definition to libperf's event.h.

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

---
 tools/perf/lib/include/perf/event.h | 5 +++++
 tools/perf/util/event.h             | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/perf/lib/include/perf/event.h +5 -0
index ed1c22e..ef7a46e 100644
@@ -318,4 +318,9 @@ struct feature_event {
 	char			 data[];
 };
 
+struct compressed_event {
+	struct perf_event_header header;
+	char			 data[];
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -5
index 94777ee..ee2ee23 100644
@@ -337,11 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-struct compressed_event {
-	struct perf_event_header	header;
-	char				data[];
-};
-
 union perf_event {
 	struct perf_event_header	header;
 	struct perf_record_mmap		mmap;
author reviewer
#41 lore raw

PATCH 21/23 libperf: Add 'union perf_event' to perf/event.h

In reply to Jiri Olsa

So it's available for libperf's users.

---
 tools/perf/lib/include/perf/event.h | 36 +++++++++++++++++++++++++++++
 tools/perf/util/event.h             | 36 -----------------------------
 2 files changed, 36 insertions(+), 36 deletions(-)
tools/perf/lib/include/perf/event.h +36 -0
index ef7a46e82a6d..a5b08ef118a7 100644
@@ -323,4 +323,40 @@ struct compressed_event {
 	char			 data[];
 };
 
+union perf_event {
+	struct perf_event_header	header;
+	struct perf_record_mmap		mmap;
+	struct perf_record_mmap2	mmap2;
+	struct perf_record_comm		comm;
+	struct perf_record_namespaces	namespaces;
+	struct perf_record_fork		fork;
+	struct perf_record_lost		lost;
+	struct perf_record_lost_samples	lost_samples;
+	struct perf_record_read		read;
+	struct perf_record_throttle	throttle;
+	struct perf_record_sample	sample;
+	struct perf_record_bpf_event	bpf;
+	struct perf_record_ksymbol	ksymbol;
+	struct attr_event		attr;
+	struct event_update_event	event_update;
+	struct event_type_event		event_type;
+	struct tracing_data_event	tracing_data;
+	struct build_id_event		build_id;
+	struct id_index_event		id_index;
+	struct auxtrace_info_event	auxtrace_info;
+	struct auxtrace_event		auxtrace;
+	struct auxtrace_error_event	auxtrace_error;
+	struct aux_event		aux;
+	struct itrace_start_event	itrace_start;
+	struct context_switch_event	context_switch;
+	struct thread_map_event		thread_map;
+	struct cpu_map_event		cpu_map;
+	struct stat_config_event	stat_config;
+	struct stat_event		stat;
+	struct stat_round_event		stat_round;
+	struct time_conv_event		time_conv;
+	struct feature_event		feat;
+	struct compressed_event		pack;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -36
index ee2ee23e4c46..e15eed53ce90 100644
@@ -337,42 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-union perf_event {
-	struct perf_event_header	header;
-	struct perf_record_mmap		mmap;
-	struct perf_record_mmap2	mmap2;
-	struct perf_record_comm		comm;
-	struct perf_record_namespaces	namespaces;
-	struct perf_record_fork		fork;
-	struct perf_record_lost		lost;
-	struct perf_record_lost_samples	lost_samples;
-	struct perf_record_read		read;
-	struct perf_record_throttle	throttle;
-	struct perf_record_sample	sample;
-	struct perf_record_bpf_event	bpf;
-	struct perf_record_ksymbol	ksymbol;
-	struct attr_event		attr;
-	struct event_update_event	event_update;
-	struct event_type_event		event_type;
-	struct tracing_data_event	tracing_data;
-	struct build_id_event		build_id;
-	struct id_index_event		id_index;
-	struct auxtrace_info_event	auxtrace_info;
-	struct auxtrace_event		auxtrace;
-	struct auxtrace_error_event	auxtrace_error;
-	struct aux_event		aux;
-	struct itrace_start_event	itrace_start;
-	struct context_switch_event	context_switch;
-	struct thread_map_event		thread_map;
-	struct cpu_map_event		cpu_map;
-	struct stat_config_event	stat_config;
-	struct stat_event		stat;
-	struct stat_round_event		stat_round;
-	struct time_conv_event		time_conv;
-	struct feature_event		feat;
-	struct compressed_event		pack;
-};
-
 void perf_event__print_totals(void);
 
 struct perf_tool;
Signature · 1 line
2.21.0
merge bot Applied
#42 lore raw

[tip: perf/core] libperf: Add 'union perf_event' to perf/event.h

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

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

Commit-ID:     7510410a38c71eb5d45217a4934e60eef88c04e1
Gitweb:        https://git.kernel.org/tip/7510410a38c71eb5d45217a4934e60eef88c04e1
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:15 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Add 'union perf_event' to perf/event.h

So it's available for libperf's users.

---
 tools/perf/lib/include/perf/event.h | 36 ++++++++++++++++++++++++++++-
 tools/perf/util/event.h             | 36 +----------------------------
 2 files changed, 36 insertions(+), 36 deletions(-)
tools/perf/lib/include/perf/event.h +36 -0
index ef7a46e..a5b08ef 100644
@@ -323,4 +323,40 @@ struct compressed_event {
 	char			 data[];
 };
 
+union perf_event {
+	struct perf_event_header	header;
+	struct perf_record_mmap		mmap;
+	struct perf_record_mmap2	mmap2;
+	struct perf_record_comm		comm;
+	struct perf_record_namespaces	namespaces;
+	struct perf_record_fork		fork;
+	struct perf_record_lost		lost;
+	struct perf_record_lost_samples	lost_samples;
+	struct perf_record_read		read;
+	struct perf_record_throttle	throttle;
+	struct perf_record_sample	sample;
+	struct perf_record_bpf_event	bpf;
+	struct perf_record_ksymbol	ksymbol;
+	struct attr_event		attr;
+	struct event_update_event	event_update;
+	struct event_type_event		event_type;
+	struct tracing_data_event	tracing_data;
+	struct build_id_event		build_id;
+	struct id_index_event		id_index;
+	struct auxtrace_info_event	auxtrace_info;
+	struct auxtrace_event		auxtrace;
+	struct auxtrace_error_event	auxtrace_error;
+	struct aux_event		aux;
+	struct itrace_start_event	itrace_start;
+	struct context_switch_event	context_switch;
+	struct thread_map_event		thread_map;
+	struct cpu_map_event		cpu_map;
+	struct stat_config_event	stat_config;
+	struct stat_event		stat;
+	struct stat_round_event		stat_round;
+	struct time_conv_event		time_conv;
+	struct feature_event		feat;
+	struct compressed_event		pack;
+};
+
 #endif /* __LIBPERF_EVENT_H */
tools/perf/util/event.h +0 -36
index ee2ee23..e15eed5 100644
@@ -337,42 +337,6 @@ enum {
 	PERF_STAT_ROUND_TYPE__FINAL	= 1,
 };
 
-union perf_event {
-	struct perf_event_header	header;
-	struct perf_record_mmap		mmap;
-	struct perf_record_mmap2	mmap2;
-	struct perf_record_comm		comm;
-	struct perf_record_namespaces	namespaces;
-	struct perf_record_fork		fork;
-	struct perf_record_lost		lost;
-	struct perf_record_lost_samples	lost_samples;
-	struct perf_record_read		read;
-	struct perf_record_throttle	throttle;
-	struct perf_record_sample	sample;
-	struct perf_record_bpf_event	bpf;
-	struct perf_record_ksymbol	ksymbol;
-	struct attr_event		attr;
-	struct event_update_event	event_update;
-	struct event_type_event		event_type;
-	struct tracing_data_event	tracing_data;
-	struct build_id_event		build_id;
-	struct id_index_event		id_index;
-	struct auxtrace_info_event	auxtrace_info;
-	struct auxtrace_event		auxtrace;
-	struct auxtrace_error_event	auxtrace_error;
-	struct aux_event		aux;
-	struct itrace_start_event	itrace_start;
-	struct context_switch_event	context_switch;
-	struct thread_map_event		thread_map;
-	struct cpu_map_event		cpu_map;
-	struct stat_config_event	stat_config;
-	struct stat_event		stat;
-	struct stat_round_event		stat_round;
-	struct time_conv_event		time_conv;
-	struct feature_event		feat;
-	struct compressed_event		pack;
-};
-
 void perf_event__print_totals(void);
 
 struct perf_tool;
author reviewer
#43 lore raw

PATCH 22/23 libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix

In reply to Jiri Olsa

Even more, to have a "perf_record_" prefix, so that they match the PERF_RECORD_ enum they map to.

---
 tools/perf/arch/arm/util/cs-etm.c    |   4 +-
 tools/perf/arch/arm64/util/arm-spe.c |   2 +-
 tools/perf/arch/s390/util/auxtrace.c |   2 +-
 tools/perf/arch/x86/util/intel-bts.c |   2 +-
 tools/perf/arch/x86/util/intel-pt.c  |   2 +-
 tools/perf/arch/x86/util/tsc.c       |   2 +-
 tools/perf/builtin-record.c          |   4 +-
 tools/perf/builtin-script.c          |   2 +-
 tools/perf/builtin-stat.c            |   2 +-
 tools/perf/lib/include/perf/event.h  | 136 +++++++++++++--------------
 tools/perf/tests/cpumap.c            |  12 +--
 tools/perf/tests/event_update.c      |  16 ++--
 tools/perf/tests/stat.c              |   8 +-
 tools/perf/tests/thread-map.c        |   2 +-
 tools/perf/util/arm-spe.c            |   4 +-
 tools/perf/util/auxtrace.c           |  16 ++--
 tools/perf/util/auxtrace.h           |   8 +-
 tools/perf/util/build-id.c           |   2 +-
 tools/perf/util/cpumap.c             |   6 +-
 tools/perf/util/cpumap.h             |   4 +-
 tools/perf/util/cs-etm.c             |   2 +-
 tools/perf/util/event.c              |  34 +++----
 tools/perf/util/event.h              |   4 +-
 tools/perf/util/header.c             |  54 +++++------
 tools/perf/util/intel-bts.c          |   4 +-
 tools/perf/util/intel-pt.c           |   8 +-
 tools/perf/util/python.c             |   4 +-
 tools/perf/util/s390-cpumsf.c        |   4 +-
 tools/perf/util/session.c            |  20 ++--
 tools/perf/util/session.h            |   2 +-
 tools/perf/util/stat.c               |   6 +-
 tools/perf/util/thread_map.c         |   4 +-
 tools/perf/util/thread_map.h         |   4 +-
 33 files changed, 193 insertions(+), 193 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +2 -2
index a185dab2d903..a5a4632e1a78 100644
@@ -564,7 +564,7 @@ static int cs_etm_get_ro(struct perf_pmu *pmu, int cpu, const char *path)
 
 static void cs_etm_get_metadata(int cpu, u32 *offset,
 				struct auxtrace_record *itr,
-				struct auxtrace_info_event *info)
+				struct perf_record_auxtrace_info *info)
 {
 	u32 increment;
 	u64 magic;
@@ -629,7 +629,7 @@ static void cs_etm_get_metadata(int cpu, u32 *offset,
 
 static int cs_etm_info_fill(struct auxtrace_record *itr,
 			    struct perf_session *session,
-			    struct auxtrace_info_event *info,
+			    struct perf_record_auxtrace_info *info,
 			    size_t priv_size)
 {
 	int i;
tools/perf/arch/arm64/util/arm-spe.c +1 -1
index cdd5c0c84183..984da1f8151c 100644
@@ -40,7 +40,7 @@ arm_spe_info_priv_size(struct auxtrace_record *itr __maybe_unused,
 
 static int arm_spe_info_fill(struct auxtrace_record *itr,
 			     struct perf_session *session,
-			     struct auxtrace_info_event *auxtrace_info,
+			     struct perf_record_auxtrace_info *auxtrace_info,
 			     size_t priv_size)
 {
 	struct arm_spe_recording *sper =
tools/perf/arch/s390/util/auxtrace.c +1 -1
index f32d7a72d039..b0fb70e38960 100644
@@ -29,7 +29,7 @@ static size_t cpumsf_info_priv_size(struct auxtrace_record *itr __maybe_unused,
 static int
 cpumsf_info_fill(struct auxtrace_record *itr __maybe_unused,
 		 struct perf_session *session __maybe_unused,
-		 struct auxtrace_info_event *auxtrace_info __maybe_unused,
+		 struct perf_record_auxtrace_info *auxtrace_info __maybe_unused,
 		 size_t priv_size __maybe_unused)
 {
 	auxtrace_info->type = PERF_AUXTRACE_S390_CPUMSF;
tools/perf/arch/x86/util/intel-bts.c +1 -1
index 1f2cf612bc9c..664377182ba8 100644
@@ -58,7 +58,7 @@ intel_bts_info_priv_size(struct auxtrace_record *itr __maybe_unused,
 
 static int intel_bts_info_fill(struct auxtrace_record *itr,
 			       struct perf_session *session,
-			       struct auxtrace_info_event *auxtrace_info,
+			       struct perf_record_auxtrace_info *auxtrace_info,
 			       size_t priv_size)
 {
 	struct intel_bts_recording *btsr =
tools/perf/arch/x86/util/intel-pt.c +1 -1
index d7125e331dda..ecf3068e980b 100644
@@ -313,7 +313,7 @@ static void intel_pt_tsc_ctc_ratio(u32 *n, u32 *d)
 
 static int intel_pt_info_fill(struct auxtrace_record *itr,
 			      struct perf_session *session,
-			      struct auxtrace_info_event *auxtrace_info,
+			      struct perf_record_auxtrace_info *auxtrace_info,
 			      size_t priv_size)
 {
 	struct intel_pt_recording *ptr =
tools/perf/arch/x86/util/tsc.c +1 -1
index b1eb963b4a6e..81720e27f8a3 100644
@@ -57,7 +57,7 @@ int perf_event__synth_time_conv(const struct perf_event_mmap_page *pc,
 		.time_conv = {
 			.header = {
 				.type = PERF_RECORD_TIME_CONV,
-				.size = sizeof(struct time_conv_event),
+				.size = sizeof(struct perf_record_time_conv),
 			},
 		},
 	};
tools/perf/builtin-record.c +2 -2
index 359bb8f33e57..3c00be8cac71 100644
@@ -898,7 +898,7 @@ static void record__adjust_affinity(struct record *rec, struct perf_mmap *map)
 
 static size_t process_comp_header(void *record, size_t increment)
 {
-	struct compressed_event *event = record;
+	struct perf_record_compressed *event = record;
 	size_t size = sizeof(*event);
 
 	if (increment) {
@@ -916,7 +916,7 @@ static size_t zstd_compress(struct perf_session *session, void *dst, size_t dst_
 			    void *src, size_t src_size)
 {
 	size_t compressed;
-	size_t max_record_size = PERF_SAMPLE_MAX_SIZE - sizeof(struct compressed_event) - 1;
+	size_t max_record_size = PERF_SAMPLE_MAX_SIZE - sizeof(struct perf_record_compressed) - 1;
 
 	compressed = zstd_compress_stream_to_records(&session->zstd_data, dst, dst_size, src, src_size,
 						     max_record_size, process_comp_header);
tools/perf/builtin-script.c +1 -1
index 51e7e6d0eee6..948bd4e82248 100644
@@ -3243,7 +3243,7 @@ static void script__setup_sample_type(struct perf_script *script)
 static int process_stat_round_event(struct perf_session *session,
 				    union perf_event *event)
 {
-	struct stat_round_event *round = &event->stat_round;
+	struct perf_record_stat_round *round = &event->stat_round;
 	struct evsel *counter;
 
 	evlist__for_each_entry(session->evlist, counter) {
tools/perf/builtin-stat.c +1 -1
index 6ab13f466827..a7e8c26635db 100644
@@ -1462,7 +1462,7 @@ static int __cmd_record(int argc, const char **argv)
 static int process_stat_round_event(struct perf_session *session,
 				    union perf_event *event)
 {
-	struct stat_round_event *stat_round = &event->stat_round;
+	struct perf_record_stat_round *stat_round = &event->stat_round;
 	struct evsel *counter;
 	struct timespec tsh, *ts = NULL;
 	const char **argv = session->header.env.cmdline_argv;
tools/perf/lib/include/perf/event.h +68 -68

270 lines not on this page · raw message

tools/perf/tests/cpumap.c +6 -6
index b71fe09a8087..39493de50117 100644
@@ -15,9 +15,9 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,
 			 struct perf_sample *sample __maybe_unused,
 			 struct machine *machine __maybe_unused)
 {
-	struct cpu_map_event *map_event = &event->cpu_map;
-	struct cpu_map_mask *mask;
-	struct cpu_map_data *data;
+	struct perf_record_cpu_map *map_event = &event->cpu_map;
+	struct perf_record_record_cpu_map *mask;
+	struct perf_record_cpu_map_data *data;
 	struct perf_cpu_map *map;
 	int i;
 
@@ -25,7 +25,7 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,
 
 	TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__MASK);
 
-	mask = (struct cpu_map_mask *)data->data;
+	mask = (struct perf_record_record_cpu_map *)data->data;
 
 	TEST_ASSERT_VAL("wrong nr",   mask->nr == 1);
 
@@ -49,9 +49,9 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 			 struct perf_sample *sample __maybe_unused,
 			 struct machine *machine __maybe_unused)
 {
-	struct cpu_map_event *map_event = &event->cpu_map;
+	struct perf_record_cpu_map *map_event = &event->cpu_map;
 	struct cpu_map_entries *cpus;
-	struct cpu_map_data *data;
+	struct perf_record_cpu_map_data *data;
 	struct perf_cpu_map *map;
 
 	data = &map_event->data;
tools/perf/tests/event_update.c +8 -8
index c37ff49c07c7..fc04c0f7145b 100644
@@ -12,7 +12,7 @@ static int process_event_unit(struct perf_tool *tool __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
 			      struct machine *machine __maybe_unused)
 {
-	struct event_update_event *ev = (struct event_update_event *) event;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *) event;
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__UNIT);
@@ -25,10 +25,10 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused,
 			       struct perf_sample *sample __maybe_unused,
 			       struct machine *machine __maybe_unused)
 {
-	struct event_update_event *ev = (struct event_update_event *) event;
-	struct event_update_event_scale *ev_data;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *) event;
+	struct perf_record_event_update_scale *ev_data;
 
-	ev_data = (struct event_update_event_scale *) ev->data;
+	ev_data = (struct perf_record_event_update_scale *) ev->data;
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__SCALE);
@@ -47,7 +47,7 @@ static int process_event_name(struct perf_tool *tool,
 			      struct machine *machine __maybe_unused)
 {
 	struct event_name *tmp = container_of(tool, struct event_name, tool);
-	struct event_update_event *ev = (struct event_update_event*) event;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *) event;
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__NAME);
@@ -60,11 +60,11 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
 			      struct machine *machine __maybe_unused)
 {
-	struct event_update_event *ev = (struct event_update_event*) event;
-	struct event_update_event_cpus *ev_data;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *) event;
+	struct perf_record_event_update_cpus *ev_data;
 	struct perf_cpu_map *map;
 
-	ev_data = (struct event_update_event_cpus*) ev->data;
+	ev_data = (struct perf_record_event_update_cpus *) ev->data;
 
 	map = cpu_map__new_data(&ev_data->cpus);
 
tools/perf/tests/stat.c +4 -4
index 94250024684a..cc10b4116c9f 100644
@@ -6,7 +6,7 @@
 #include "counts.h"
 #include "debug.h"
 
-static bool has_term(struct stat_config_event *config,
+static bool has_term(struct perf_record_stat_config *config,
 		     u64 tag, u64 val)
 {
 	unsigned i;
@@ -25,7 +25,7 @@ static int process_stat_config_event(struct perf_tool *tool __maybe_unused,
 				     struct perf_sample *sample __maybe_unused,
 				     struct machine *machine __maybe_unused)
 {
-	struct stat_config_event *config = &event->stat_config;
+	struct perf_record_stat_config *config = &event->stat_config;
 	struct perf_stat_config stat_config;
 
 #define HAS(term, val) \
@@ -65,7 +65,7 @@ static int process_stat_event(struct perf_tool *tool __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
 			      struct machine *machine __maybe_unused)
 {
-	struct stat_event *st = &event->stat;
+	struct perf_record_stat *st = &event->stat;
 
 	TEST_ASSERT_VAL("wrong cpu",    st->cpu    == 1);
 	TEST_ASSERT_VAL("wrong thread", st->thread == 2);
@@ -95,7 +95,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
 				    struct perf_sample *sample __maybe_unused,
 				    struct machine *machine __maybe_unused)
 {
-	struct stat_round_event *stat_round = &event->stat_round;
+	struct perf_record_stat_round *stat_round = &event->stat_round;
 
 	TEST_ASSERT_VAL("wrong time", stat_round->time == 0xdeadbeef);
 	TEST_ASSERT_VAL("wrong type", stat_round->type == PERF_STAT_ROUND_TYPE__INTERVAL);
tools/perf/tests/thread-map.c +1 -1
index d803eafedc60..c19ec8849e77 100644
@@ -56,7 +56,7 @@ static int process_event(struct perf_tool *tool __maybe_unused,
 			 struct perf_sample *sample __maybe_unused,
 			 struct machine *machine __maybe_unused)
 {
-	struct thread_map_event *map = &event->thread_map;
+	struct perf_record_thread_map *map = &event->thread_map;
 	struct perf_thread_map *threads;
 
 	TEST_ASSERT_VAL("wrong nr",   map->nr == 1);
tools/perf/util/arm-spe.c +2 -2
index cd26315bc9aa..d7c3fbb3694f 100644
@@ -192,12 +192,12 @@ static void arm_spe_print_info(__u64 *arr)
 int arm_spe_process_auxtrace_info(union perf_event *event,
 				  struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	size_t min_sz = sizeof(u64) * ARM_SPE_PMU_TYPE;
 	struct arm_spe *spe;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info) +
 					min_sz)
 		return -EINVAL;
 
tools/perf/util/auxtrace.c +8 -8
index cddf04c45a20..c1bf86911e71 100644
@@ -385,7 +385,7 @@ static int auxtrace_queues__add_indexed_event(struct auxtrace_queues *queues,
 		return err;
 
 	if (event->header.type == PERF_RECORD_AUXTRACE) {
-		if (event->header.size < sizeof(struct auxtrace_event) ||
+		if (event->header.size < sizeof(struct perf_record_auxtrace) ||
 		    event->header.size != sz) {
 			err = -EINVAL;
 			goto out;
@@ -518,7 +518,7 @@ static int auxtrace_not_supported(void)
 
 int auxtrace_record__info_fill(struct auxtrace_record *itr,
 			       struct perf_session *session,
-			       struct auxtrace_info_event *auxtrace_info,
+			       struct perf_record_auxtrace_info *auxtrace_info,
 			       size_t priv_size)
 {
 	if (itr)
@@ -858,13 +858,13 @@ void auxtrace_buffer__free(struct auxtrace_buffer *buffer)
 	free(buffer);
 }
 
-void auxtrace_synth_error(struct auxtrace_error_event *auxtrace_error, int type,
+void auxtrace_synth_error(struct perf_record_auxtrace_error *auxtrace_error, int type,
 			  int code, int cpu, pid_t pid, pid_t tid, u64 ip,
 			  const char *msg, u64 timestamp)
 {
 	size_t size;
 
-	memset(auxtrace_error, 0, sizeof(struct auxtrace_error_event));
+	memset(auxtrace_error, 0, sizeof(struct perf_record_auxtrace_error));
 
 	auxtrace_error->header.type = PERF_RECORD_AUXTRACE_ERROR;
 	auxtrace_error->type = type;
@@ -893,12 +893,12 @@ int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr,
 
 	pr_debug2("Synthesizing auxtrace information\n");
 	priv_size = auxtrace_record__info_priv_size(itr, session->evlist);
-	ev = zalloc(sizeof(struct auxtrace_info_event) + priv_size);
+	ev = zalloc(sizeof(struct perf_record_auxtrace_info) + priv_size);
 	if (!ev)
 		return -ENOMEM;
 
 	ev->auxtrace_info.header.type = PERF_RECORD_AUXTRACE_INFO;
-	ev->auxtrace_info.header.size = sizeof(struct auxtrace_info_event) +
+	ev->auxtrace_info.header.size = sizeof(struct perf_record_auxtrace_info) +
 					priv_size;
 	err = auxtrace_record__info_fill(itr, session, &ev->auxtrace_info,
 					 priv_size);
@@ -1168,7 +1168,7 @@ static const char *auxtrace_error_name(int type)
 
 size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)
 {
-	struct auxtrace_error_event *e = &event->auxtrace_error;
+	struct perf_record_auxtrace_error *e = &event->auxtrace_error;
 	unsigned long long nsecs = e->time;
 	const char *msg = e->msg;
 	int ret;
@@ -1196,7 +1196,7 @@ size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)
 void perf_session__auxtrace_error_inc(struct perf_session *session,
 				      union perf_event *event)
 {
-	struct auxtrace_error_event *e = &event->auxtrace_error;
+	struct perf_record_auxtrace_error *e = &event->auxtrace_error;
 
 	if (e->type < PERF_AUXTRACE_ERROR_MAX)
 		session->evlist->stats.nr_auxtrace_errors[e->type] += 1;
tools/perf/util/auxtrace.h +4 -4
index 8e637ac3918e..b213e6431d88 100644
@@ -28,7 +28,7 @@ struct perf_tool;
 struct perf_mmap;
 struct option;
 struct record_opts;
-struct auxtrace_info_event;
+struct perf_record_auxtrace_info;
 struct events_stats;
 
 /* Auxtrace records must have the same alignment as perf event records */
@@ -318,7 +318,7 @@ struct auxtrace_record {
 				 struct evlist *evlist);
 	int (*info_fill)(struct auxtrace_record *itr,
 			 struct perf_session *session,
-			 struct auxtrace_info_event *auxtrace_info,
+			 struct perf_record_auxtrace_info *auxtrace_info,
 			 size_t priv_size);
 	void (*free)(struct auxtrace_record *itr);
 	int (*snapshot_start)(struct auxtrace_record *itr);
@@ -498,7 +498,7 @@ size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr,
 				       struct evlist *evlist);
 int auxtrace_record__info_fill(struct auxtrace_record *itr,
 			       struct perf_session *session,
-			       struct auxtrace_info_event *auxtrace_info,
+			       struct perf_record_auxtrace_info *auxtrace_info,
 			       size_t priv_size);
 void auxtrace_record__free(struct auxtrace_record *itr);
 int auxtrace_record__snapshot_start(struct auxtrace_record *itr);
@@ -515,7 +515,7 @@ int auxtrace_index__process(int fd, u64 size, struct perf_session *session,
 			    bool needs_swap);
 void auxtrace_index__free(struct list_head *head);
 
-void auxtrace_synth_error(struct auxtrace_error_event *auxtrace_error, int type,
+void auxtrace_synth_error(struct perf_record_auxtrace_error *auxtrace_error, int type,
 			  int code, int cpu, pid_t pid, pid_t tid, u64 ip,
 			  const char *msg, u64 timestamp);
 
tools/perf/util/build-id.c +1 -1
index b98754863de9..4c96a33b09ff 100644
@@ -295,7 +295,7 @@ static int write_buildid(const char *name, size_t name_len, u8 *build_id,
 			 pid_t pid, u16 misc, struct feat_fd *fd)
 {
 	int err;
-	struct build_id_event b;
+	struct perf_record_header_build_id b;
 	size_t len;
 
 	len = name_len + 1;
tools/perf/util/cpumap.c +3 -3
index f5c21184e1fc..b9301e7e9c76 100644
@@ -43,7 +43,7 @@ static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus)
 	return map;
 }
 
-static struct perf_cpu_map *cpu_map__from_mask(struct cpu_map_mask *mask)
+static struct perf_cpu_map *cpu_map__from_mask(struct perf_record_record_cpu_map *mask)
 {
 	struct perf_cpu_map *map;
 	int nr, nbits = mask->nr * mask->long_size * BITS_PER_BYTE;
@@ -61,12 +61,12 @@ static struct perf_cpu_map *cpu_map__from_mask(struct cpu_map_mask *mask)
 
 }
 
-struct perf_cpu_map *cpu_map__new_data(struct cpu_map_data *data)
+struct perf_cpu_map *cpu_map__new_data(struct perf_record_cpu_map_data *data)
 {
 	if (data->type == PERF_CPU_MAP__CPUS)
 		return cpu_map__from_entries((struct cpu_map_entries *)data->data);
 	else
-		return cpu_map__from_mask((struct cpu_map_mask *)data->data);
+		return cpu_map__from_mask((struct perf_record_record_cpu_map *)data->data);
 }
 
 size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp)
tools/perf/util/cpumap.h +2 -2
index c2519e7ea958..2553bef1279d 100644
@@ -7,10 +7,10 @@
 #include <internal/cpumap.h>
 #include <perf/cpumap.h>
 
-struct cpu_map_data;
+struct perf_record_cpu_map_data;
 
 struct perf_cpu_map *perf_cpu_map__empty_new(int nr);
-struct perf_cpu_map *cpu_map__new_data(struct cpu_map_data *data);
+struct perf_cpu_map *cpu_map__new_data(struct perf_record_cpu_map_data *data);
 size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size);
 size_t cpu_map__snprint_mask(struct perf_cpu_map *map, char *buf, size_t size);
 size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp);
tools/perf/util/cs-etm.c +1 -1
index b3a5daaf1a8f..c84da56f5f7d 100644
@@ -2393,7 +2393,7 @@ static void cs_etm__print_auxtrace_info(u64 *val, int num)
 int cs_etm__process_auxtrace_info(union perf_event *event,
 				  struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	struct cs_etm_auxtrace *etm = NULL;
 	struct int_node *inode;
 	unsigned int pmu_type;
tools/perf/util/event.c +17 -17
index 2369333d61d8..742fba062746 100644
@@ -991,7 +991,7 @@ int perf_event__synthesize_thread_map2(struct perf_tool *tool,
 	event->thread_map.nr = threads->nr;
 
 	for (i = 0; i < threads->nr; i++) {
-		struct thread_map_event_entry *entry = &event->thread_map.entries[i];
+		struct perf_record_thread_map_entry *entry = &event->thread_map.entries[i];
 		char *comm = perf_thread_map__comm(threads, i);
 
 		if (!comm)
@@ -1018,7 +1018,7 @@ static void synthesize_cpus(struct cpu_map_entries *cpus,
 		cpus->cpu[i] = map->map[i];
 }
 
-static void synthesize_mask(struct cpu_map_mask *mask,
+static void synthesize_mask(struct perf_record_record_cpu_map *mask,
 			    struct perf_cpu_map *map, int max)
 {
 	int i;
@@ -1049,7 +1049,7 @@ static size_t mask_size(struct perf_cpu_map *map, int *max)
 			*max = bit;
 	}
 
-	return sizeof(struct cpu_map_mask) + BITS_TO_LONGS(*max) * sizeof(long);
+	return sizeof(struct perf_record_record_cpu_map) + BITS_TO_LONGS(*max) * sizeof(long);
 }
 
 void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int *max)
@@ -1060,15 +1060,15 @@ void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int
 	/*
 	 * Both array and mask data have variable size based
 	 * on the number of cpus and their actual values.
-	 * The size of the 'struct cpu_map_data' is:
+	 * The size of the 'struct perf_record_cpu_map_data' is:
 	 *
 	 *   array = size of 'struct cpu_map_entries' +
 	 *           number of cpus * sizeof(u64)
 	 *
-	 *   mask  = size of 'struct cpu_map_mask' +
+	 *   mask  = size of 'struct perf_record_record_cpu_map' +
 	 *           maximum cpu bit converted to size of longs
 	 *
-	 * and finaly + the size of 'struct cpu_map_data'.
+	 * and finaly + the size of 'struct perf_record_cpu_map_data'.
 	 */
 	size_cpus = cpus_size(map);
 	size_mask = mask_size(map, max);
@@ -1081,12 +1081,12 @@ void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int
 		*type  = PERF_CPU_MAP__MASK;
 	}
 
-	*size += sizeof(struct cpu_map_data);
+	*size += sizeof(struct perf_record_cpu_map_data);
 	*size = PERF_ALIGN(*size, sizeof(u64));
 	return zalloc(*size);
 }
 
-void cpu_map_data__synthesize(struct cpu_map_data *data, struct perf_cpu_map *map,
+void cpu_map_data__synthesize(struct perf_record_cpu_map_data *data, struct perf_cpu_map *map,
 			      u16 type, int max)
 {
 	data->type = type;
@@ -1096,16 +1096,16 @@ void cpu_map_data__synthesize(struct cpu_map_data *data, struct perf_cpu_map *ma
 		synthesize_cpus((struct cpu_map_entries *) data->data, map);
 		break;
 	case PERF_CPU_MAP__MASK:
-		synthesize_mask((struct cpu_map_mask *) data->data, map, max);
+		synthesize_mask((struct perf_record_record_cpu_map *) data->data, map, max);
 	default:
 		break;
 	};
 }
 
-static struct cpu_map_event* cpu_map_event__new(struct perf_cpu_map *map)
+static struct perf_record_cpu_map *cpu_map_event__new(struct perf_cpu_map *map)
 {
-	size_t size = sizeof(struct cpu_map_event);
-	struct cpu_map_event *event;
+	size_t size = sizeof(struct perf_record_cpu_map);
+	struct perf_record_cpu_map *event;
 	int max;
 	u16 type;
 
@@ -1126,7 +1126,7 @@ int perf_event__synthesize_cpu_map(struct perf_tool *tool,
 				   perf_event__handler_t process,
 				   struct machine *machine)
 {
-	struct cpu_map_event *event;
+	struct perf_record_cpu_map *event;
 	int err;
 
 	event = cpu_map_event__new(map);
@@ -1144,7 +1144,7 @@ int perf_event__synthesize_stat_config(struct perf_tool *tool,
 				       perf_event__handler_t process,
 				       struct machine *machine)
 {
-	struct stat_config_event *event;
+	struct perf_record_stat_config *event;
 	int size, i = 0, err;
 
 	size  = sizeof(*event);
@@ -1183,7 +1183,7 @@ int perf_event__synthesize_stat(struct perf_tool *tool,
 				perf_event__handler_t process,
 				struct machine *machine)
 {
-	struct stat_event event;
+	struct perf_record_stat event;
 
 	event.header.type = PERF_RECORD_STAT;
 	event.header.size = sizeof(event);
@@ -1204,7 +1204,7 @@ int perf_event__synthesize_stat_round(struct perf_tool *tool,
 				      perf_event__handler_t process,
 				      struct machine *machine)
 {
-	struct stat_round_event event;
+	struct perf_record_stat_round event;
 
 	event.header.type = PERF_RECORD_STAT_ROUND;
 	event.header.size = sizeof(event);
@@ -1217,7 +1217,7 @@ int perf_event__synthesize_stat_round(struct perf_tool *tool,
 }
 
 void perf_event__read_stat_config(struct perf_stat_config *config,
-				  struct stat_config_event *event)
+				  struct perf_record_stat_config *event)
 {
 	unsigned i;
 
tools/perf/util/event.h +2 -2
index e15eed53ce90..a7341e14eb48 100644
@@ -374,7 +374,7 @@ int perf_event__synthesize_stat_config(struct perf_tool *tool,
 				       perf_event__handler_t process,
 				       struct machine *machine);
 void perf_event__read_stat_config(struct perf_stat_config *config,
-				  struct stat_config_event *event);
+				  struct perf_record_stat_config *event);
 int perf_event__synthesize_stat(struct perf_tool *tool,
 				u32 cpu, u32 thread, u64 id,
 				struct perf_counts_values *count,
@@ -511,7 +511,7 @@ int kallsyms__get_function_start(const char *kallsyms_filename,
 				 const char *symbol_name, u64 *addr);
 
 void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int *max);
-void  cpu_map_data__synthesize(struct cpu_map_data *data, struct perf_cpu_map *map,
+void  cpu_map_data__synthesize(struct perf_record_cpu_map_data *data, struct perf_cpu_map *map,
 			       u16 type, int max);
 
 void event_attr_init(struct perf_event_attr *attr);
tools/perf/util/header.c +27 -27

173 lines not on this page · raw message

tools/perf/util/intel-bts.c +2 -2
index 03c581a0d5d0..99dddb63dac1 100644
@@ -848,12 +848,12 @@ static void intel_bts_print_info(__u64 *arr, int start, int finish)
 int intel_bts_process_auxtrace_info(union perf_event *event,
 				    struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	size_t min_sz = sizeof(u64) * INTEL_BTS_SNAPSHOT_MODE;
 	struct intel_bts *bts;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info) +
 					min_sz)
 		return -EINVAL;
 
tools/perf/util/intel-pt.c +4 -4
index c83a9a718c03..825a6a3b03a1 100644
@@ -3063,23 +3063,23 @@ static void intel_pt_print_info_str(const char *name, const char *str)
 	fprintf(stdout, "  %-20s%s\n", name, str ? str : "");
 }
 
-static bool intel_pt_has(struct auxtrace_info_event *auxtrace_info, int pos)
+static bool intel_pt_has(struct perf_record_auxtrace_info *auxtrace_info, int pos)
 {
 	return auxtrace_info->header.size >=
-		sizeof(struct auxtrace_info_event) + (sizeof(u64) * (pos + 1));
+		sizeof(struct perf_record_auxtrace_info) + (sizeof(u64) * (pos + 1));
 }
 
 int intel_pt_process_auxtrace_info(union perf_event *event,
 				   struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	size_t min_sz = sizeof(u64) * INTEL_PT_PER_CPU_MMAPS;
 	struct intel_pt *pt;
 	void *info_end;
 	__u64 *info;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info) +
 					min_sz)
 		return -EINVAL;
 
tools/perf/util/python.c +2 -2
index 59974e901232..11479a7ad1c7 100644
@@ -431,8 +431,8 @@ static char pyrf_context_switch_event__doc[] = PyDoc_STR("perf context_switch ev
 static PyMemberDef pyrf_context_switch_event__members[] = {
 	sample_members
 	member_def(perf_event_header, type, T_UINT, "event type"),
-	member_def(context_switch_event, next_prev_pid, T_UINT, "next/prev pid"),
-	member_def(context_switch_event, next_prev_tid, T_UINT, "next/prev tid"),
+	member_def(perf_record_switch, next_prev_pid, T_UINT, "next/prev pid"),
+	member_def(perf_record_switch, next_prev_tid, T_UINT, "next/prev tid"),
 	{ .name = NULL, },
 };
 
tools/perf/util/s390-cpumsf.c +2 -2
index d078ae8353c8..4f6c1465998f 100644
@@ -1109,11 +1109,11 @@ static int s390_cpumsf__config(const char *var, const char *value, void *cb)
 int s390_cpumsf_process_auxtrace_info(union perf_event *event,
 				      struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	struct s390_cpumsf *sf;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event))
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info))
 		return -EINVAL;
 
 	sf = zalloc(sizeof(struct s390_cpumsf));
tools/perf/util/session.c +10 -10
index daa8aed27eae..cb584a87dc6e 100644
@@ -63,8 +63,8 @@ static int perf_session__process_compressed_event(struct perf_session *session,
 		decomp->size = decomp_last_rem;
 	}
 
-	src = (void *)event + sizeof(struct compressed_event);
-	src_size = event->pack.header.size - sizeof(struct compressed_event);
+	src = (void *)event + sizeof(struct perf_record_compressed);
+	src_size = event->pack.header.size - sizeof(struct perf_record_compressed);
 
 	decomp_size = zstd_decompress_stream(&(session->zstd_data), src, src_size,
 				&(decomp->data[decomp_last_rem]), decomp_len - decomp_last_rem);
@@ -835,9 +835,9 @@ static void perf_event__thread_map_swap(union perf_event *event,
 static void perf_event__cpu_map_swap(union perf_event *event,
 				     bool sample_id_all __maybe_unused)
 {
-	struct cpu_map_data *data = &event->cpu_map.data;
+	struct perf_record_cpu_map_data *data = &event->cpu_map.data;
 	struct cpu_map_entries *cpus;
-	struct cpu_map_mask *mask;
+	struct perf_record_record_cpu_map *mask;
 	unsigned i;
 
 	data->type = bswap_64(data->type);
@@ -852,7 +852,7 @@ static void perf_event__cpu_map_swap(union perf_event *event,
 			cpus->cpu[i] = bswap_16(cpus->cpu[i]);
 		break;
 	case PERF_CPU_MAP__MASK:
-		mask = (struct cpu_map_mask *) data->data;
+		mask = (struct perf_record_record_cpu_map *) data->data;
 
 		mask->nr = bswap_16(mask->nr);
 		mask->long_size = bswap_16(mask->long_size);
@@ -2375,10 +2375,10 @@ int perf_event__process_id_index(struct perf_session *session,
 				 union perf_event *event)
 {
 	struct evlist *evlist = session->evlist;
-	struct id_index_event *ie = &event->id_index;
+	struct perf_record_id_index *ie = &event->id_index;
 	size_t i, nr, max_nr;
 
-	max_nr = (ie->header.size - sizeof(struct id_index_event)) /
+	max_nr = (ie->header.size - sizeof(struct perf_record_id_index)) /
 		 sizeof(struct id_index_entry);
 	nr = ie->nr;
 	if (nr > max_nr)
@@ -2420,14 +2420,14 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,
 
 	pr_debug2("Synthesizing id index\n");
 
-	max_nr = (UINT16_MAX - sizeof(struct id_index_event)) /
+	max_nr = (UINT16_MAX - sizeof(struct perf_record_id_index)) /
 		 sizeof(struct id_index_entry);
 
 	evlist__for_each_entry(evlist, evsel)
 		nr += evsel->ids;
 
 	n = nr > max_nr ? max_nr : nr;
-	sz = sizeof(struct id_index_event) + n * sizeof(struct id_index_entry);
+	sz = sizeof(struct perf_record_id_index) + n * sizeof(struct id_index_entry);
 	ev = zalloc(sz);
 	if (!ev)
 		return -ENOMEM;
@@ -2467,7 +2467,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,
 		}
 	}
 
-	sz = sizeof(struct id_index_event) + nr * sizeof(struct id_index_entry);
+	sz = sizeof(struct perf_record_id_index) + nr * sizeof(struct id_index_entry);
 	ev->id_index.header.size = sz;
 	ev->id_index.nr = nr;
 
tools/perf/util/session.h +1 -1
index 79e97d17ea04..b7aa076ab6fd 100644
@@ -28,7 +28,7 @@ struct perf_session {
 	struct itrace_synth_opts *itrace_synth_opts;
 	struct list_head	auxtrace_index;
 	struct trace_event	tevent;
-	struct time_conv_event	time_conv;
+	struct perf_record_time_conv	time_conv;
 	bool			repipe;
 	bool			one_mmap;
 	void			*one_mmap_addr;
tools/perf/util/stat.c +3 -3
index 4c7957496e7c..018c6d3ee01b 100644
@@ -382,7 +382,7 @@ int perf_event__process_stat_event(struct perf_session *session,
 				   union perf_event *event)
 {
 	struct perf_counts_values count;
-	struct stat_event *st = &event->stat;
+	struct perf_record_stat *st = &event->stat;
 	struct evsel *counter;
 
 	count.val = st->val;
@@ -402,7 +402,7 @@ int perf_event__process_stat_event(struct perf_session *session,
 
 size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)
 {
-	struct stat_event *st = (struct stat_event *) event;
+	struct perf_record_stat *st = (struct perf_record_stat *) event;
 	size_t ret;
 
 	ret  = fprintf(fp, "\n... id %" PRI_lu64 ", cpu %d, thread %d\n",
@@ -415,7 +415,7 @@ size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)
 
 size_t perf_event__fprintf_stat_round(union perf_event *event, FILE *fp)
 {
-	struct stat_round_event *rd = (struct stat_round_event *)event;
+	struct perf_record_stat_round *rd = (struct perf_record_stat_round *)event;
 	size_t ret;
 
 	ret = fprintf(fp, "\n... time %" PRI_lu64 ", type %s\n", rd->time,
tools/perf/util/thread_map.c +2 -2
index 3e64525bf604..c9bfe4696943 100644
@@ -369,7 +369,7 @@ void thread_map__read_comms(struct perf_thread_map *threads)
 }
 
 static void thread_map__copy_event(struct perf_thread_map *threads,
-				   struct thread_map_event *event)
+				   struct perf_record_thread_map *event)
 {
 	unsigned i;
 
@@ -383,7 +383,7 @@ static void thread_map__copy_event(struct perf_thread_map *threads,
 	refcount_set(&threads->refcnt, 1);
 }
 
-struct perf_thread_map *thread_map__new_event(struct thread_map_event *event)
+struct perf_thread_map *thread_map__new_event(struct perf_record_thread_map *event)
 {
 	struct perf_thread_map *threads;
 
tools/perf/util/thread_map.h +2 -2
index ca165fdf6cb0..3bb860a32b8e 100644
@@ -8,7 +8,7 @@
 #include <internal/threadmap.h>
 #include <perf/threadmap.h>
 
-struct thread_map_event;
+struct perf_record_thread_map;
 
 struct perf_thread_map *thread_map__new_dummy(void);
 struct perf_thread_map *thread_map__new_by_pid(pid_t pid);
@@ -16,7 +16,7 @@ struct perf_thread_map *thread_map__new_by_tid(pid_t tid);
 struct perf_thread_map *thread_map__new_by_uid(uid_t uid);
 struct perf_thread_map *thread_map__new_all_cpus(void);
 struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid);
-struct perf_thread_map *thread_map__new_event(struct thread_map_event *event);
+struct perf_thread_map *thread_map__new_event(struct perf_record_thread_map *event);
 
 struct perf_thread_map *thread_map__new_str(const char *pid,
 		const char *tid, uid_t uid, bool all_threads);
Signature · 1 line
2.21.0
merge bot Applied
#44 lore raw

[tip: perf/core] libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix

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

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

Commit-ID:     72932371e78012cea96edb9e833d81f1c32dd892
Gitweb:        https://git.kernel.org/tip/72932371e78012cea96edb9e833d81f1c32dd892
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:16 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix

Even more, to have a "perf_record_" prefix, so that they match the PERF_RECORD_ enum they map to.

---
 tools/perf/arch/arm/util/cs-etm.c    |   4 +-
 tools/perf/arch/arm64/util/arm-spe.c |   2 +-
 tools/perf/arch/s390/util/auxtrace.c |   2 +-
 tools/perf/arch/x86/util/intel-bts.c |   2 +-
 tools/perf/arch/x86/util/intel-pt.c  |   2 +-
 tools/perf/arch/x86/util/tsc.c       |   2 +-
 tools/perf/builtin-record.c          |   4 +-
 tools/perf/builtin-script.c          |   2 +-
 tools/perf/builtin-stat.c            |   2 +-
 tools/perf/lib/include/perf/event.h  | 136 +++++++++++++-------------
 tools/perf/tests/cpumap.c            |  12 +-
 tools/perf/tests/event_update.c      |  16 +--
 tools/perf/tests/stat.c              |   8 +-
 tools/perf/tests/thread-map.c        |   2 +-
 tools/perf/util/arm-spe.c            |   4 +-
 tools/perf/util/auxtrace.c           |  16 +--
 tools/perf/util/auxtrace.h           |   8 +-
 tools/perf/util/build-id.c           |   2 +-
 tools/perf/util/cpumap.c             |   6 +-
 tools/perf/util/cpumap.h             |   4 +-
 tools/perf/util/cs-etm.c             |   2 +-
 tools/perf/util/event.c              |  34 +++----
 tools/perf/util/event.h              |   4 +-
 tools/perf/util/header.c             |  54 +++++-----
 tools/perf/util/intel-bts.c          |   4 +-
 tools/perf/util/intel-pt.c           |   8 +-
 tools/perf/util/python.c             |   4 +-
 tools/perf/util/s390-cpumsf.c        |   4 +-
 tools/perf/util/session.c            |  20 ++--
 tools/perf/util/session.h            |   2 +-
 tools/perf/util/stat.c               |   6 +-
 tools/perf/util/thread_map.c         |   4 +-
 tools/perf/util/thread_map.h         |   4 +-
 33 files changed, 193 insertions(+), 193 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +2 -2
index 5d856ed..9644e2d 100644
@@ -565,7 +565,7 @@ static int cs_etm_get_ro(struct perf_pmu *pmu, int cpu, const char *path)
 
 static void cs_etm_get_metadata(int cpu, u32 *offset,
 				struct auxtrace_record *itr,
-				struct auxtrace_info_event *info)
+				struct perf_record_auxtrace_info *info)
 {
 	u32 increment;
 	u64 magic;
@@ -630,7 +630,7 @@ static void cs_etm_get_metadata(int cpu, u32 *offset,
 
 static int cs_etm_info_fill(struct auxtrace_record *itr,
 			    struct perf_session *session,
-			    struct auxtrace_info_event *info,
+			    struct perf_record_auxtrace_info *info,
 			    size_t priv_size)
 {
 	int i;
tools/perf/arch/arm64/util/arm-spe.c +1 -1
index c7b38f0..4b36469 100644
@@ -41,7 +41,7 @@ arm_spe_info_priv_size(struct auxtrace_record *itr __maybe_unused,
 
 static int arm_spe_info_fill(struct auxtrace_record *itr,
 			     struct perf_session *session,
-			     struct auxtrace_info_event *auxtrace_info,
+			     struct perf_record_auxtrace_info *auxtrace_info,
 			     size_t priv_size)
 {
 	struct arm_spe_recording *sper =
tools/perf/arch/s390/util/auxtrace.c +1 -1
index f32d7a7..b0fb70e 100644
@@ -29,7 +29,7 @@ static size_t cpumsf_info_priv_size(struct auxtrace_record *itr __maybe_unused,
 static int
 cpumsf_info_fill(struct auxtrace_record *itr __maybe_unused,
 		 struct perf_session *session __maybe_unused,
-		 struct auxtrace_info_event *auxtrace_info __maybe_unused,
+		 struct perf_record_auxtrace_info *auxtrace_info __maybe_unused,
 		 size_t priv_size __maybe_unused)
 {
 	auxtrace_info->type = PERF_AUXTRACE_S390_CPUMSF;
tools/perf/arch/x86/util/intel-bts.c +1 -1
index e4bb5df..d263430 100644
@@ -60,7 +60,7 @@ intel_bts_info_priv_size(struct auxtrace_record *itr __maybe_unused,
 
 static int intel_bts_info_fill(struct auxtrace_record *itr,
 			       struct perf_session *session,
-			       struct auxtrace_info_event *auxtrace_info,
+			       struct perf_record_auxtrace_info *auxtrace_info,
 			       size_t priv_size)
 {
 	struct intel_bts_recording *btsr =
tools/perf/arch/x86/util/intel-pt.c +1 -1
index 89fe30d..cb7cf16 100644
@@ -314,7 +314,7 @@ static void intel_pt_tsc_ctc_ratio(u32 *n, u32 *d)
 
 static int intel_pt_info_fill(struct auxtrace_record *itr,
 			      struct perf_session *session,
-			      struct auxtrace_info_event *auxtrace_info,
+			      struct perf_record_auxtrace_info *auxtrace_info,
 			      size_t priv_size)
 {
 	struct intel_pt_recording *ptr =
tools/perf/arch/x86/util/tsc.c +1 -1
index b1eb963..81720e2 100644
@@ -57,7 +57,7 @@ int perf_event__synth_time_conv(const struct perf_event_mmap_page *pc,
 		.time_conv = {
 			.header = {
 				.type = PERF_RECORD_TIME_CONV,
-				.size = sizeof(struct time_conv_event),
+				.size = sizeof(struct perf_record_time_conv),
 			},
 		},
 	};
tools/perf/builtin-record.c +2 -2
index afe5584..bd2a0cc 100644
@@ -898,7 +898,7 @@ static void record__adjust_affinity(struct record *rec, struct perf_mmap *map)
 
 static size_t process_comp_header(void *record, size_t increment)
 {
-	struct compressed_event *event = record;
+	struct perf_record_compressed *event = record;
 	size_t size = sizeof(*event);
 
 	if (increment) {
@@ -916,7 +916,7 @@ static size_t zstd_compress(struct perf_session *session, void *dst, size_t dst_
 			    void *src, size_t src_size)
 {
 	size_t compressed;
-	size_t max_record_size = PERF_SAMPLE_MAX_SIZE - sizeof(struct compressed_event) - 1;
+	size_t max_record_size = PERF_SAMPLE_MAX_SIZE - sizeof(struct perf_record_compressed) - 1;
 
 	compressed = zstd_compress_stream_to_records(&session->zstd_data, dst, dst_size, src, src_size,
 						     max_record_size, process_comp_header);
tools/perf/builtin-script.c +1 -1
index e005be0..37297b6 100644
@@ -3244,7 +3244,7 @@ static void script__setup_sample_type(struct perf_script *script)
 static int process_stat_round_event(struct perf_session *session,
 				    union perf_event *event)
 {
-	struct stat_round_event *round = &event->stat_round;
+	struct perf_record_stat_round *round = &event->stat_round;
 	struct evsel *counter;
 
 	evlist__for_each_entry(session->evlist, counter) {
tools/perf/builtin-stat.c +1 -1
index 6ab13f4..a7e8c26 100644
@@ -1462,7 +1462,7 @@ static int __cmd_record(int argc, const char **argv)
 static int process_stat_round_event(struct perf_session *session,
 				    union perf_event *event)
 {
-	struct stat_round_event *stat_round = &event->stat_round;
+	struct perf_record_stat_round *stat_round = &event->stat_round;
 	struct evsel *counter;
 	struct timespec tsh, *ts = NULL;
 	const char **argv = session->header.env.cmdline_argv;
tools/perf/lib/include/perf/event.h +68 -68

270 lines not on this page · raw message

tools/perf/tests/cpumap.c +6 -6
index b71fe09..39493de 100644
@@ -15,9 +15,9 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,
 			 struct perf_sample *sample __maybe_unused,
 			 struct machine *machine __maybe_unused)
 {
-	struct cpu_map_event *map_event = &event->cpu_map;
-	struct cpu_map_mask *mask;
-	struct cpu_map_data *data;
+	struct perf_record_cpu_map *map_event = &event->cpu_map;
+	struct perf_record_record_cpu_map *mask;
+	struct perf_record_cpu_map_data *data;
 	struct perf_cpu_map *map;
 	int i;
 
@@ -25,7 +25,7 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused,
 
 	TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__MASK);
 
-	mask = (struct cpu_map_mask *)data->data;
+	mask = (struct perf_record_record_cpu_map *)data->data;
 
 	TEST_ASSERT_VAL("wrong nr",   mask->nr == 1);
 
@@ -49,9 +49,9 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 			 struct perf_sample *sample __maybe_unused,
 			 struct machine *machine __maybe_unused)
 {
-	struct cpu_map_event *map_event = &event->cpu_map;
+	struct perf_record_cpu_map *map_event = &event->cpu_map;
 	struct cpu_map_entries *cpus;
-	struct cpu_map_data *data;
+	struct perf_record_cpu_map_data *data;
 	struct perf_cpu_map *map;
 
 	data = &map_event->data;
tools/perf/tests/event_update.c +8 -8
index c37ff49..1411155 100644
@@ -12,7 +12,7 @@ static int process_event_unit(struct perf_tool *tool __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
 			      struct machine *machine __maybe_unused)
 {
-	struct event_update_event *ev = (struct event_update_event *) event;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *)event;
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__UNIT);
@@ -25,10 +25,10 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused,
 			       struct perf_sample *sample __maybe_unused,
 			       struct machine *machine __maybe_unused)
 {
-	struct event_update_event *ev = (struct event_update_event *) event;
-	struct event_update_event_scale *ev_data;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *)event;
+	struct perf_record_event_update_scale *ev_data;
 
-	ev_data = (struct event_update_event_scale *) ev->data;
+	ev_data = (struct perf_record_event_update_scale *)ev->data;
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__SCALE);
@@ -47,7 +47,7 @@ static int process_event_name(struct perf_tool *tool,
 			      struct machine *machine __maybe_unused)
 {
 	struct event_name *tmp = container_of(tool, struct event_name, tool);
-	struct event_update_event *ev = (struct event_update_event*) event;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *)event;
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__NAME);
@@ -60,11 +60,11 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
 			      struct machine *machine __maybe_unused)
 {
-	struct event_update_event *ev = (struct event_update_event*) event;
-	struct event_update_event_cpus *ev_data;
+	struct perf_record_event_update *ev = (struct perf_record_event_update *)event;
+	struct perf_record_event_update_cpus *ev_data;
 	struct perf_cpu_map *map;
 
-	ev_data = (struct event_update_event_cpus*) ev->data;
+	ev_data = (struct perf_record_event_update_cpus *) ev->data;
 
 	map = cpu_map__new_data(&ev_data->cpus);
 
tools/perf/tests/stat.c +4 -4
index 9425002..cc10b41 100644
@@ -6,7 +6,7 @@
 #include "counts.h"
 #include "debug.h"
 
-static bool has_term(struct stat_config_event *config,
+static bool has_term(struct perf_record_stat_config *config,
 		     u64 tag, u64 val)
 {
 	unsigned i;
@@ -25,7 +25,7 @@ static int process_stat_config_event(struct perf_tool *tool __maybe_unused,
 				     struct perf_sample *sample __maybe_unused,
 				     struct machine *machine __maybe_unused)
 {
-	struct stat_config_event *config = &event->stat_config;
+	struct perf_record_stat_config *config = &event->stat_config;
 	struct perf_stat_config stat_config;
 
 #define HAS(term, val) \
@@ -65,7 +65,7 @@ static int process_stat_event(struct perf_tool *tool __maybe_unused,
 			      struct perf_sample *sample __maybe_unused,
 			      struct machine *machine __maybe_unused)
 {
-	struct stat_event *st = &event->stat;
+	struct perf_record_stat *st = &event->stat;
 
 	TEST_ASSERT_VAL("wrong cpu",    st->cpu    == 1);
 	TEST_ASSERT_VAL("wrong thread", st->thread == 2);
@@ -95,7 +95,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
 				    struct perf_sample *sample __maybe_unused,
 				    struct machine *machine __maybe_unused)
 {
-	struct stat_round_event *stat_round = &event->stat_round;
+	struct perf_record_stat_round *stat_round = &event->stat_round;
 
 	TEST_ASSERT_VAL("wrong time", stat_round->time == 0xdeadbeef);
 	TEST_ASSERT_VAL("wrong type", stat_round->type == PERF_STAT_ROUND_TYPE__INTERVAL);
tools/perf/tests/thread-map.c +1 -1
index d803eaf..c19ec88 100644
@@ -56,7 +56,7 @@ static int process_event(struct perf_tool *tool __maybe_unused,
 			 struct perf_sample *sample __maybe_unused,
 			 struct machine *machine __maybe_unused)
 {
-	struct thread_map_event *map = &event->thread_map;
+	struct perf_record_thread_map *map = &event->thread_map;
 	struct perf_thread_map *threads;
 
 	TEST_ASSERT_VAL("wrong nr",   map->nr == 1);
tools/perf/util/arm-spe.c +2 -2
index cd26315..d7c3fbb 100644
@@ -192,12 +192,12 @@ static void arm_spe_print_info(__u64 *arr)
 int arm_spe_process_auxtrace_info(union perf_event *event,
 				  struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	size_t min_sz = sizeof(u64) * ARM_SPE_PMU_TYPE;
 	struct arm_spe *spe;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info) +
 					min_sz)
 		return -EINVAL;
 
tools/perf/util/auxtrace.c +8 -8
index c3da8a0..10c7077 100644
@@ -386,7 +386,7 @@ static int auxtrace_queues__add_indexed_event(struct auxtrace_queues *queues,
 		return err;
 
 	if (event->header.type == PERF_RECORD_AUXTRACE) {
-		if (event->header.size < sizeof(struct auxtrace_event) ||
+		if (event->header.size < sizeof(struct perf_record_auxtrace) ||
 		    event->header.size != sz) {
 			err = -EINVAL;
 			goto out;
@@ -519,7 +519,7 @@ static int auxtrace_not_supported(void)
 
 int auxtrace_record__info_fill(struct auxtrace_record *itr,
 			       struct perf_session *session,
-			       struct auxtrace_info_event *auxtrace_info,
+			       struct perf_record_auxtrace_info *auxtrace_info,
 			       size_t priv_size)
 {
 	if (itr)
@@ -859,13 +859,13 @@ void auxtrace_buffer__free(struct auxtrace_buffer *buffer)
 	free(buffer);
 }
 
-void auxtrace_synth_error(struct auxtrace_error_event *auxtrace_error, int type,
+void auxtrace_synth_error(struct perf_record_auxtrace_error *auxtrace_error, int type,
 			  int code, int cpu, pid_t pid, pid_t tid, u64 ip,
 			  const char *msg, u64 timestamp)
 {
 	size_t size;
 
-	memset(auxtrace_error, 0, sizeof(struct auxtrace_error_event));
+	memset(auxtrace_error, 0, sizeof(struct perf_record_auxtrace_error));
 
 	auxtrace_error->header.type = PERF_RECORD_AUXTRACE_ERROR;
 	auxtrace_error->type = type;
@@ -894,12 +894,12 @@ int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr,
 
 	pr_debug2("Synthesizing auxtrace information\n");
 	priv_size = auxtrace_record__info_priv_size(itr, session->evlist);
-	ev = zalloc(sizeof(struct auxtrace_info_event) + priv_size);
+	ev = zalloc(sizeof(struct perf_record_auxtrace_info) + priv_size);
 	if (!ev)
 		return -ENOMEM;
 
 	ev->auxtrace_info.header.type = PERF_RECORD_AUXTRACE_INFO;
-	ev->auxtrace_info.header.size = sizeof(struct auxtrace_info_event) +
+	ev->auxtrace_info.header.size = sizeof(struct perf_record_auxtrace_info) +
 					priv_size;
 	err = auxtrace_record__info_fill(itr, session, &ev->auxtrace_info,
 					 priv_size);
@@ -1169,7 +1169,7 @@ static const char *auxtrace_error_name(int type)
 
 size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)
 {
-	struct auxtrace_error_event *e = &event->auxtrace_error;
+	struct perf_record_auxtrace_error *e = &event->auxtrace_error;
 	unsigned long long nsecs = e->time;
 	const char *msg = e->msg;
 	int ret;
@@ -1197,7 +1197,7 @@ size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp)
 void perf_session__auxtrace_error_inc(struct perf_session *session,
 				      union perf_event *event)
 {
-	struct auxtrace_error_event *e = &event->auxtrace_error;
+	struct perf_record_auxtrace_error *e = &event->auxtrace_error;
 
 	if (e->type < PERF_AUXTRACE_ERROR_MAX)
 		session->evlist->stats.nr_auxtrace_errors[e->type] += 1;
tools/perf/util/auxtrace.h +4 -4
index 8e637ac..b213e64 100644
@@ -28,7 +28,7 @@ struct perf_tool;
 struct perf_mmap;
 struct option;
 struct record_opts;
-struct auxtrace_info_event;
+struct perf_record_auxtrace_info;
 struct events_stats;
 
 /* Auxtrace records must have the same alignment as perf event records */
@@ -318,7 +318,7 @@ struct auxtrace_record {
 				 struct evlist *evlist);
 	int (*info_fill)(struct auxtrace_record *itr,
 			 struct perf_session *session,
-			 struct auxtrace_info_event *auxtrace_info,
+			 struct perf_record_auxtrace_info *auxtrace_info,
 			 size_t priv_size);
 	void (*free)(struct auxtrace_record *itr);
 	int (*snapshot_start)(struct auxtrace_record *itr);
@@ -498,7 +498,7 @@ size_t auxtrace_record__info_priv_size(struct auxtrace_record *itr,
 				       struct evlist *evlist);
 int auxtrace_record__info_fill(struct auxtrace_record *itr,
 			       struct perf_session *session,
-			       struct auxtrace_info_event *auxtrace_info,
+			       struct perf_record_auxtrace_info *auxtrace_info,
 			       size_t priv_size);
 void auxtrace_record__free(struct auxtrace_record *itr);
 int auxtrace_record__snapshot_start(struct auxtrace_record *itr);
@@ -515,7 +515,7 @@ int auxtrace_index__process(int fd, u64 size, struct perf_session *session,
 			    bool needs_swap);
 void auxtrace_index__free(struct list_head *head);
 
-void auxtrace_synth_error(struct auxtrace_error_event *auxtrace_error, int type,
+void auxtrace_synth_error(struct perf_record_auxtrace_error *auxtrace_error, int type,
 			  int code, int cpu, pid_t pid, pid_t tid, u64 ip,
 			  const char *msg, u64 timestamp);
 
tools/perf/util/build-id.c +1 -1
index b987548..4c96a33 100644
@@ -295,7 +295,7 @@ static int write_buildid(const char *name, size_t name_len, u8 *build_id,
 			 pid_t pid, u16 misc, struct feat_fd *fd)
 {
 	int err;
-	struct build_id_event b;
+	struct perf_record_header_build_id b;
 	size_t len;
 
 	len = name_len + 1;
tools/perf/util/cpumap.c +3 -3
index f5c2118..b9301e7 100644
@@ -43,7 +43,7 @@ static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus)
 	return map;
 }
 
-static struct perf_cpu_map *cpu_map__from_mask(struct cpu_map_mask *mask)
+static struct perf_cpu_map *cpu_map__from_mask(struct perf_record_record_cpu_map *mask)
 {
 	struct perf_cpu_map *map;
 	int nr, nbits = mask->nr * mask->long_size * BITS_PER_BYTE;
@@ -61,12 +61,12 @@ static struct perf_cpu_map *cpu_map__from_mask(struct cpu_map_mask *mask)
 
 }
 
-struct perf_cpu_map *cpu_map__new_data(struct cpu_map_data *data)
+struct perf_cpu_map *cpu_map__new_data(struct perf_record_cpu_map_data *data)
 {
 	if (data->type == PERF_CPU_MAP__CPUS)
 		return cpu_map__from_entries((struct cpu_map_entries *)data->data);
 	else
-		return cpu_map__from_mask((struct cpu_map_mask *)data->data);
+		return cpu_map__from_mask((struct perf_record_record_cpu_map *)data->data);
 }
 
 size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp)
tools/perf/util/cpumap.h +2 -2
index c2519e7..2553bef 100644
@@ -7,10 +7,10 @@
 #include <internal/cpumap.h>
 #include <perf/cpumap.h>
 
-struct cpu_map_data;
+struct perf_record_cpu_map_data;
 
 struct perf_cpu_map *perf_cpu_map__empty_new(int nr);
-struct perf_cpu_map *cpu_map__new_data(struct cpu_map_data *data);
+struct perf_cpu_map *cpu_map__new_data(struct perf_record_cpu_map_data *data);
 size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size);
 size_t cpu_map__snprint_mask(struct perf_cpu_map *map, char *buf, size_t size);
 size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp);
tools/perf/util/cs-etm.c +1 -1
index e210c1d..d6de383 100644
@@ -2393,7 +2393,7 @@ static void cs_etm__print_auxtrace_info(__u64 *val, int num)
 int cs_etm__process_auxtrace_info(union perf_event *event,
 				  struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	struct cs_etm_auxtrace *etm = NULL;
 	struct int_node *inode;
 	unsigned int pmu_type;
tools/perf/util/event.c +17 -17
index b711019..c9d1f83 100644
@@ -992,7 +992,7 @@ int perf_event__synthesize_thread_map2(struct perf_tool *tool,
 	event->thread_map.nr = threads->nr;
 
 	for (i = 0; i < threads->nr; i++) {
-		struct thread_map_event_entry *entry = &event->thread_map.entries[i];
+		struct perf_record_thread_map_entry *entry = &event->thread_map.entries[i];
 		char *comm = perf_thread_map__comm(threads, i);
 
 		if (!comm)
@@ -1019,7 +1019,7 @@ static void synthesize_cpus(struct cpu_map_entries *cpus,
 		cpus->cpu[i] = map->map[i];
 }
 
-static void synthesize_mask(struct cpu_map_mask *mask,
+static void synthesize_mask(struct perf_record_record_cpu_map *mask,
 			    struct perf_cpu_map *map, int max)
 {
 	int i;
@@ -1050,7 +1050,7 @@ static size_t mask_size(struct perf_cpu_map *map, int *max)
 			*max = bit;
 	}
 
-	return sizeof(struct cpu_map_mask) + BITS_TO_LONGS(*max) * sizeof(long);
+	return sizeof(struct perf_record_record_cpu_map) + BITS_TO_LONGS(*max) * sizeof(long);
 }
 
 void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int *max)
@@ -1061,15 +1061,15 @@ void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int
 	/*
 	 * Both array and mask data have variable size based
 	 * on the number of cpus and their actual values.
-	 * The size of the 'struct cpu_map_data' is:
+	 * The size of the 'struct perf_record_cpu_map_data' is:
 	 *
 	 *   array = size of 'struct cpu_map_entries' +
 	 *           number of cpus * sizeof(u64)
 	 *
-	 *   mask  = size of 'struct cpu_map_mask' +
+	 *   mask  = size of 'struct perf_record_record_cpu_map' +
 	 *           maximum cpu bit converted to size of longs
 	 *
-	 * and finaly + the size of 'struct cpu_map_data'.
+	 * and finaly + the size of 'struct perf_record_cpu_map_data'.
 	 */
 	size_cpus = cpus_size(map);
 	size_mask = mask_size(map, max);
@@ -1082,12 +1082,12 @@ void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int
 		*type  = PERF_CPU_MAP__MASK;
 	}
 
-	*size += sizeof(struct cpu_map_data);
+	*size += sizeof(struct perf_record_cpu_map_data);
 	*size = PERF_ALIGN(*size, sizeof(u64));
 	return zalloc(*size);
 }
 
-void cpu_map_data__synthesize(struct cpu_map_data *data, struct perf_cpu_map *map,
+void cpu_map_data__synthesize(struct perf_record_cpu_map_data *data, struct perf_cpu_map *map,
 			      u16 type, int max)
 {
 	data->type = type;
@@ -1097,16 +1097,16 @@ void cpu_map_data__synthesize(struct cpu_map_data *data, struct perf_cpu_map *ma
 		synthesize_cpus((struct cpu_map_entries *) data->data, map);
 		break;
 	case PERF_CPU_MAP__MASK:
-		synthesize_mask((struct cpu_map_mask *) data->data, map, max);
+		synthesize_mask((struct perf_record_record_cpu_map *)data->data, map, max);
 	default:
 		break;
 	};
 }
 
-static struct cpu_map_event* cpu_map_event__new(struct perf_cpu_map *map)
+static struct perf_record_cpu_map *cpu_map_event__new(struct perf_cpu_map *map)
 {
-	size_t size = sizeof(struct cpu_map_event);
-	struct cpu_map_event *event;
+	size_t size = sizeof(struct perf_record_cpu_map);
+	struct perf_record_cpu_map *event;
 	int max;
 	u16 type;
 
@@ -1127,7 +1127,7 @@ int perf_event__synthesize_cpu_map(struct perf_tool *tool,
 				   perf_event__handler_t process,
 				   struct machine *machine)
 {
-	struct cpu_map_event *event;
+	struct perf_record_cpu_map *event;
 	int err;
 
 	event = cpu_map_event__new(map);
@@ -1145,7 +1145,7 @@ int perf_event__synthesize_stat_config(struct perf_tool *tool,
 				       perf_event__handler_t process,
 				       struct machine *machine)
 {
-	struct stat_config_event *event;
+	struct perf_record_stat_config *event;
 	int size, i = 0, err;
 
 	size  = sizeof(*event);
@@ -1184,7 +1184,7 @@ int perf_event__synthesize_stat(struct perf_tool *tool,
 				perf_event__handler_t process,
 				struct machine *machine)
 {
-	struct stat_event event;
+	struct perf_record_stat event;
 
 	event.header.type = PERF_RECORD_STAT;
 	event.header.size = sizeof(event);
@@ -1205,7 +1205,7 @@ int perf_event__synthesize_stat_round(struct perf_tool *tool,
 				      perf_event__handler_t process,
 				      struct machine *machine)
 {
-	struct stat_round_event event;
+	struct perf_record_stat_round event;
 
 	event.header.type = PERF_RECORD_STAT_ROUND;
 	event.header.size = sizeof(event);
@@ -1218,7 +1218,7 @@ int perf_event__synthesize_stat_round(struct perf_tool *tool,
 }
 
 void perf_event__read_stat_config(struct perf_stat_config *config,
-				  struct stat_config_event *event)
+				  struct perf_record_stat_config *event)
 {
 	unsigned i;
 
tools/perf/util/event.h +2 -2
index e15eed5..a7341e1 100644
@@ -374,7 +374,7 @@ int perf_event__synthesize_stat_config(struct perf_tool *tool,
 				       perf_event__handler_t process,
 				       struct machine *machine);
 void perf_event__read_stat_config(struct perf_stat_config *config,
-				  struct stat_config_event *event);
+				  struct perf_record_stat_config *event);
 int perf_event__synthesize_stat(struct perf_tool *tool,
 				u32 cpu, u32 thread, u64 id,
 				struct perf_counts_values *count,
@@ -511,7 +511,7 @@ int kallsyms__get_function_start(const char *kallsyms_filename,
 				 const char *symbol_name, u64 *addr);
 
 void *cpu_map_data__alloc(struct perf_cpu_map *map, size_t *size, u16 *type, int *max);
-void  cpu_map_data__synthesize(struct cpu_map_data *data, struct perf_cpu_map *map,
+void  cpu_map_data__synthesize(struct perf_record_cpu_map_data *data, struct perf_cpu_map *map,
 			       u16 type, int max);
 
 void event_attr_init(struct perf_event_attr *attr);
tools/perf/util/header.c +27 -27

173 lines not on this page · raw message

tools/perf/util/intel-bts.c +2 -2
index 03c581a..99dddb6 100644
@@ -848,12 +848,12 @@ static void intel_bts_print_info(__u64 *arr, int start, int finish)
 int intel_bts_process_auxtrace_info(union perf_event *event,
 				    struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	size_t min_sz = sizeof(u64) * INTEL_BTS_SNAPSHOT_MODE;
 	struct intel_bts *bts;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info) +
 					min_sz)
 		return -EINVAL;
 
tools/perf/util/intel-pt.c +4 -4
index c83a9a7..825a6a3 100644
@@ -3063,23 +3063,23 @@ static void intel_pt_print_info_str(const char *name, const char *str)
 	fprintf(stdout, "  %-20s%s\n", name, str ? str : "");
 }
 
-static bool intel_pt_has(struct auxtrace_info_event *auxtrace_info, int pos)
+static bool intel_pt_has(struct perf_record_auxtrace_info *auxtrace_info, int pos)
 {
 	return auxtrace_info->header.size >=
-		sizeof(struct auxtrace_info_event) + (sizeof(u64) * (pos + 1));
+		sizeof(struct perf_record_auxtrace_info) + (sizeof(u64) * (pos + 1));
 }
 
 int intel_pt_process_auxtrace_info(union perf_event *event,
 				   struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	size_t min_sz = sizeof(u64) * INTEL_PT_PER_CPU_MMAPS;
 	struct intel_pt *pt;
 	void *info_end;
 	__u64 *info;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event) +
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info) +
 					min_sz)
 		return -EINVAL;
 
tools/perf/util/python.c +2 -2
index 59974e9..11479a7 100644
@@ -431,8 +431,8 @@ static char pyrf_context_switch_event__doc[] = PyDoc_STR("perf context_switch ev
 static PyMemberDef pyrf_context_switch_event__members[] = {
 	sample_members
 	member_def(perf_event_header, type, T_UINT, "event type"),
-	member_def(context_switch_event, next_prev_pid, T_UINT, "next/prev pid"),
-	member_def(context_switch_event, next_prev_tid, T_UINT, "next/prev tid"),
+	member_def(perf_record_switch, next_prev_pid, T_UINT, "next/prev pid"),
+	member_def(perf_record_switch, next_prev_tid, T_UINT, "next/prev tid"),
 	{ .name = NULL, },
 };
 
tools/perf/util/s390-cpumsf.c +2 -2
index d078ae8..4f6c146 100644
@@ -1109,11 +1109,11 @@ static int s390_cpumsf__config(const char *var, const char *value, void *cb)
 int s390_cpumsf_process_auxtrace_info(union perf_event *event,
 				      struct perf_session *session)
 {
-	struct auxtrace_info_event *auxtrace_info = &event->auxtrace_info;
+	struct perf_record_auxtrace_info *auxtrace_info = &event->auxtrace_info;
 	struct s390_cpumsf *sf;
 	int err;
 
-	if (auxtrace_info->header.size < sizeof(struct auxtrace_info_event))
+	if (auxtrace_info->header.size < sizeof(struct perf_record_auxtrace_info))
 		return -EINVAL;
 
 	sf = zalloc(sizeof(struct s390_cpumsf));
tools/perf/util/session.c +10 -10
index aa96674..7350b0d 100644
@@ -64,8 +64,8 @@ static int perf_session__process_compressed_event(struct perf_session *session,
 		decomp->size = decomp_last_rem;
 	}
 
-	src = (void *)event + sizeof(struct compressed_event);
-	src_size = event->pack.header.size - sizeof(struct compressed_event);
+	src = (void *)event + sizeof(struct perf_record_compressed);
+	src_size = event->pack.header.size - sizeof(struct perf_record_compressed);
 
 	decomp_size = zstd_decompress_stream(&(session->zstd_data), src, src_size,
 				&(decomp->data[decomp_last_rem]), decomp_len - decomp_last_rem);
@@ -836,9 +836,9 @@ static void perf_event__thread_map_swap(union perf_event *event,
 static void perf_event__cpu_map_swap(union perf_event *event,
 				     bool sample_id_all __maybe_unused)
 {
-	struct cpu_map_data *data = &event->cpu_map.data;
+	struct perf_record_cpu_map_data *data = &event->cpu_map.data;
 	struct cpu_map_entries *cpus;
-	struct cpu_map_mask *mask;
+	struct perf_record_record_cpu_map *mask;
 	unsigned i;
 
 	data->type = bswap_64(data->type);
@@ -853,7 +853,7 @@ static void perf_event__cpu_map_swap(union perf_event *event,
 			cpus->cpu[i] = bswap_16(cpus->cpu[i]);
 		break;
 	case PERF_CPU_MAP__MASK:
-		mask = (struct cpu_map_mask *) data->data;
+		mask = (struct perf_record_record_cpu_map *)data->data;
 
 		mask->nr = bswap_16(mask->nr);
 		mask->long_size = bswap_16(mask->long_size);
@@ -2376,10 +2376,10 @@ int perf_event__process_id_index(struct perf_session *session,
 				 union perf_event *event)
 {
 	struct evlist *evlist = session->evlist;
-	struct id_index_event *ie = &event->id_index;
+	struct perf_record_id_index *ie = &event->id_index;
 	size_t i, nr, max_nr;
 
-	max_nr = (ie->header.size - sizeof(struct id_index_event)) /
+	max_nr = (ie->header.size - sizeof(struct perf_record_id_index)) /
 		 sizeof(struct id_index_entry);
 	nr = ie->nr;
 	if (nr > max_nr)
@@ -2421,14 +2421,14 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,
 
 	pr_debug2("Synthesizing id index\n");
 
-	max_nr = (UINT16_MAX - sizeof(struct id_index_event)) /
+	max_nr = (UINT16_MAX - sizeof(struct perf_record_id_index)) /
 		 sizeof(struct id_index_entry);
 
 	evlist__for_each_entry(evlist, evsel)
 		nr += evsel->ids;
 
 	n = nr > max_nr ? max_nr : nr;
-	sz = sizeof(struct id_index_event) + n * sizeof(struct id_index_entry);
+	sz = sizeof(struct perf_record_id_index) + n * sizeof(struct id_index_entry);
 	ev = zalloc(sz);
 	if (!ev)
 		return -ENOMEM;
@@ -2468,7 +2468,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,
 		}
 	}
 
-	sz = sizeof(struct id_index_event) + nr * sizeof(struct id_index_entry);
+	sz = sizeof(struct perf_record_id_index) + nr * sizeof(struct id_index_entry);
 	ev->id_index.header.size = sz;
 	ev->id_index.nr = nr;
 
tools/perf/util/session.h +1 -1
index 79e97d1..b7aa076 100644
@@ -28,7 +28,7 @@ struct perf_session {
 	struct itrace_synth_opts *itrace_synth_opts;
 	struct list_head	auxtrace_index;
 	struct trace_event	tevent;
-	struct time_conv_event	time_conv;
+	struct perf_record_time_conv	time_conv;
 	bool			repipe;
 	bool			one_mmap;
 	void			*one_mmap_addr;
tools/perf/util/stat.c +3 -3
index 4c79574..66f8808 100644
@@ -382,7 +382,7 @@ int perf_event__process_stat_event(struct perf_session *session,
 				   union perf_event *event)
 {
 	struct perf_counts_values count;
-	struct stat_event *st = &event->stat;
+	struct perf_record_stat *st = &event->stat;
 	struct evsel *counter;
 
 	count.val = st->val;
@@ -402,7 +402,7 @@ int perf_event__process_stat_event(struct perf_session *session,
 
 size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)
 {
-	struct stat_event *st = (struct stat_event *) event;
+	struct perf_record_stat *st = (struct perf_record_stat *)event;
 	size_t ret;
 
 	ret  = fprintf(fp, "\n... id %" PRI_lu64 ", cpu %d, thread %d\n",
@@ -415,7 +415,7 @@ size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp)
 
 size_t perf_event__fprintf_stat_round(union perf_event *event, FILE *fp)
 {
-	struct stat_round_event *rd = (struct stat_round_event *)event;
+	struct perf_record_stat_round *rd = (struct perf_record_stat_round *)event;
 	size_t ret;
 
 	ret = fprintf(fp, "\n... time %" PRI_lu64 ", type %s\n", rd->time,
tools/perf/util/thread_map.c +2 -2
index 3e64525..c9bfe46 100644
@@ -369,7 +369,7 @@ void thread_map__read_comms(struct perf_thread_map *threads)
 }
 
 static void thread_map__copy_event(struct perf_thread_map *threads,
-				   struct thread_map_event *event)
+				   struct perf_record_thread_map *event)
 {
 	unsigned i;
 
@@ -383,7 +383,7 @@ static void thread_map__copy_event(struct perf_thread_map *threads,
 	refcount_set(&threads->refcnt, 1);
 }
 
-struct perf_thread_map *thread_map__new_event(struct thread_map_event *event)
+struct perf_thread_map *thread_map__new_event(struct perf_record_thread_map *event)
 {
 	struct perf_thread_map *threads;
 
tools/perf/util/thread_map.h +2 -2
index ca165fd..3bb860a 100644
@@ -8,7 +8,7 @@
 #include <internal/threadmap.h>
 #include <perf/threadmap.h>
 
-struct thread_map_event;
+struct perf_record_thread_map;
 
 struct perf_thread_map *thread_map__new_dummy(void);
 struct perf_thread_map *thread_map__new_by_pid(pid_t pid);
@@ -16,7 +16,7 @@ struct perf_thread_map *thread_map__new_by_tid(pid_t tid);
 struct perf_thread_map *thread_map__new_by_uid(uid_t uid);
 struct perf_thread_map *thread_map__new_all_cpus(void);
 struct perf_thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid);
-struct perf_thread_map *thread_map__new_event(struct thread_map_event *event);
+struct perf_thread_map *thread_map__new_event(struct perf_record_thread_map *event);
 
 struct perf_thread_map *thread_map__new_str(const char *pid,
 		const char *tid, uid_t uid, bool all_threads);
author reviewer
#45 lore raw

PATCH 23/23 libperf: Move 'enum perf_user_event_type' to perf/event.h

In reply to Jiri Olsa

So it's available for libperf's users.

---
 tools/perf/lib/include/perf/event.h | 23 +++++++++++++++++++++++
 tools/perf/util/event.h             | 23 -----------------------
 2 files changed, 23 insertions(+), 23 deletions(-)
tools/perf/lib/include/perf/event.h +23 -0
index 1655c744ec2b..18106899cb4e 100644
@@ -323,6 +323,29 @@ struct perf_record_compressed {
 	char			 data[];
 };
 
+enum perf_user_event_type { /* above any possible kernel type */
+	PERF_RECORD_USER_TYPE_START		= 64,
+	PERF_RECORD_HEADER_ATTR			= 64,
+	PERF_RECORD_HEADER_EVENT_TYPE		= 65, /* deprecated */
+	PERF_RECORD_HEADER_TRACING_DATA		= 66,
+	PERF_RECORD_HEADER_BUILD_ID		= 67,
+	PERF_RECORD_FINISHED_ROUND		= 68,
+	PERF_RECORD_ID_INDEX			= 69,
+	PERF_RECORD_AUXTRACE_INFO		= 70,
+	PERF_RECORD_AUXTRACE			= 71,
+	PERF_RECORD_AUXTRACE_ERROR		= 72,
+	PERF_RECORD_THREAD_MAP			= 73,
+	PERF_RECORD_CPU_MAP			= 74,
+	PERF_RECORD_STAT_CONFIG			= 75,
+	PERF_RECORD_STAT			= 76,
+	PERF_RECORD_STAT_ROUND			= 77,
+	PERF_RECORD_EVENT_UPDATE		= 78,
+	PERF_RECORD_TIME_CONV			= 79,
+	PERF_RECORD_HEADER_FEATURE		= 80,
+	PERF_RECORD_COMPRESSED			= 81,
+	PERF_RECORD_HEADER_MAX
+};
+
 union perf_event {
 	struct perf_event_header		header;
 	struct perf_record_mmap			mmap;
tools/perf/util/event.h +0 -23
index a7341e14eb48..4c0c5232bd41 100644
@@ -146,29 +146,6 @@ struct perf_sample {
 	 PERF_MEM_S(LOCK, NA) |\
 	 PERF_MEM_S(TLB, NA))
 
-enum perf_user_event_type { /* above any possible kernel type */
-	PERF_RECORD_USER_TYPE_START		= 64,
-	PERF_RECORD_HEADER_ATTR			= 64,
-	PERF_RECORD_HEADER_EVENT_TYPE		= 65, /* deprecated */
-	PERF_RECORD_HEADER_TRACING_DATA		= 66,
-	PERF_RECORD_HEADER_BUILD_ID		= 67,
-	PERF_RECORD_FINISHED_ROUND		= 68,
-	PERF_RECORD_ID_INDEX			= 69,
-	PERF_RECORD_AUXTRACE_INFO		= 70,
-	PERF_RECORD_AUXTRACE			= 71,
-	PERF_RECORD_AUXTRACE_ERROR		= 72,
-	PERF_RECORD_THREAD_MAP			= 73,
-	PERF_RECORD_CPU_MAP			= 74,
-	PERF_RECORD_STAT_CONFIG			= 75,
-	PERF_RECORD_STAT			= 76,
-	PERF_RECORD_STAT_ROUND			= 77,
-	PERF_RECORD_EVENT_UPDATE		= 78,
-	PERF_RECORD_TIME_CONV			= 79,
-	PERF_RECORD_HEADER_FEATURE		= 80,
-	PERF_RECORD_COMPRESSED			= 81,
-	PERF_RECORD_HEADER_MAX
-};
-
 enum auxtrace_error_type {
 	PERF_AUXTRACE_ERROR_ITRACE  = 1,
 	PERF_AUXTRACE_ERROR_MAX
Signature · 1 line
2.21.0
merge bot Applied
#46 lore raw

[tip: perf/core] libperf: Move 'enum perf_user_event_type' to perf/event.h

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

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

Commit-ID:     653dd8e6e8e46591f864b7ad98e10819079d5a88
Gitweb:        https://git.kernel.org/tip/653dd8e6e8e46591f864b7ad98e10819079d5a88
Author:        Jiri Olsa <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 15:57:17 +02:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00

libperf: Move 'enum perf_user_event_type' to perf/event.h

So it's available for libperf's users.

---
 tools/perf/lib/include/perf/event.h | 23 +++++++++++++++++++++++
 tools/perf/util/event.h             | 23 -----------------------
 2 files changed, 23 insertions(+), 23 deletions(-)
tools/perf/lib/include/perf/event.h +23 -0
index 1655c74..1810689 100644
@@ -323,6 +323,29 @@ struct perf_record_compressed {
 	char			 data[];
 };
 
+enum perf_user_event_type { /* above any possible kernel type */
+	PERF_RECORD_USER_TYPE_START		= 64,
+	PERF_RECORD_HEADER_ATTR			= 64,
+	PERF_RECORD_HEADER_EVENT_TYPE		= 65, /* deprecated */
+	PERF_RECORD_HEADER_TRACING_DATA		= 66,
+	PERF_RECORD_HEADER_BUILD_ID		= 67,
+	PERF_RECORD_FINISHED_ROUND		= 68,
+	PERF_RECORD_ID_INDEX			= 69,
+	PERF_RECORD_AUXTRACE_INFO		= 70,
+	PERF_RECORD_AUXTRACE			= 71,
+	PERF_RECORD_AUXTRACE_ERROR		= 72,
+	PERF_RECORD_THREAD_MAP			= 73,
+	PERF_RECORD_CPU_MAP			= 74,
+	PERF_RECORD_STAT_CONFIG			= 75,
+	PERF_RECORD_STAT			= 76,
+	PERF_RECORD_STAT_ROUND			= 77,
+	PERF_RECORD_EVENT_UPDATE		= 78,
+	PERF_RECORD_TIME_CONV			= 79,
+	PERF_RECORD_HEADER_FEATURE		= 80,
+	PERF_RECORD_COMPRESSED			= 81,
+	PERF_RECORD_HEADER_MAX
+};
+
 union perf_event {
 	struct perf_event_header		header;
 	struct perf_record_mmap			mmap;
tools/perf/util/event.h +0 -23
index a7341e1..4c0c523 100644
@@ -146,29 +146,6 @@ struct perf_sample {
 	 PERF_MEM_S(LOCK, NA) |\
 	 PERF_MEM_S(TLB, NA))
 
-enum perf_user_event_type { /* above any possible kernel type */
-	PERF_RECORD_USER_TYPE_START		= 64,
-	PERF_RECORD_HEADER_ATTR			= 64,
-	PERF_RECORD_HEADER_EVENT_TYPE		= 65, /* deprecated */
-	PERF_RECORD_HEADER_TRACING_DATA		= 66,
-	PERF_RECORD_HEADER_BUILD_ID		= 67,
-	PERF_RECORD_FINISHED_ROUND		= 68,
-	PERF_RECORD_ID_INDEX			= 69,
-	PERF_RECORD_AUXTRACE_INFO		= 70,
-	PERF_RECORD_AUXTRACE			= 71,
-	PERF_RECORD_AUXTRACE_ERROR		= 72,
-	PERF_RECORD_THREAD_MAP			= 73,
-	PERF_RECORD_CPU_MAP			= 74,
-	PERF_RECORD_STAT_CONFIG			= 75,
-	PERF_RECORD_STAT			= 76,
-	PERF_RECORD_STAT_ROUND			= 77,
-	PERF_RECORD_EVENT_UPDATE		= 78,
-	PERF_RECORD_TIME_CONV			= 79,
-	PERF_RECORD_HEADER_FEATURE		= 80,
-	PERF_RECORD_COMPRESSED			= 81,
-	PERF_RECORD_HEADER_MAX
-};
-
 enum auxtrace_error_type {
 	PERF_AUXTRACE_ERROR_ITRACE  = 1,
 	PERF_AUXTRACE_ERROR_MAX
#47 lore raw
In reply to Jiri Olsa

Em Wed, Aug 28, 2019 at 03:56:54PM +0200, Jiri Olsa escreveu:

Quoted 2 lines

hi,
to export 'union perf_event' we need to export the rest of events.

Thanks, applied to perf/core.

- Arnaldo

Quoted 69 lines

It's also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/fixes

thanks,
jirka

---
Jiri Olsa (23):
libperf: Add PERF_RECORD_HEADER_ATTR 'struct attr_event' to perf/event.h
libperf: Add PERF_RECORD_CPU_MAP 'struct cpu_map_event' to perf/event.h
libperf: Add PERF_RECORD_EVENT_UPDATE 'struct event_update_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_EVENT_TYPE 'struct event_type_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_TRACING_DATA 'struct tracing_data_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_BUILD_ID 'struct build_id_event' to perf/event.h
libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE_INFO 'struct auxtrace_info_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE 'struct auxtrace_event' to perf/event.h
libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h
libperf: Add PERF_RECORD_AUX 'struct aux_event' to perf/event.h
libperf: Add PERF_RECORD_ITRACE_START 'struct itrace_start_event' to perf/event.h
libperf: Add PERF_RECORD_SWITCH 'struct context_switch_event' to perf/event.h
libperf: Add PERF_RECORD_THREAD_MAP 'struct thread_map_event' to perf/event.h
libperf: Add PERF_RECORD_STAT_CONFIG 'struct stat_config_event' to perf/event.h
libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h
libperf: Add PERF_RECORD_STAT_ROUND 'struct stat_round_event' to perf/event.h
libperf: Add PERF_RECORD_TIME_CONV 'struct time_conv_event' to perf/event.h
libperf: Add PERF_RECORD_HEADER_FEATURE 'struct feature_event' to perf/event.h
libperf: Add PERF_RECORD_COMPRESSED 'struct compressed_event' to perf/event.h
libperf: Add 'union perf_event' to perf/event.h
libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix
libperf: Move 'enum perf_user_event_type' to perf/event.h

 tools/perf/arch/arm/util/cs-etm.c    |   4 +--
 tools/perf/arch/arm64/util/arm-spe.c |   2 +-
 tools/perf/arch/s390/util/auxtrace.c |   2 +-
 tools/perf/arch/x86/util/intel-bts.c |   2 +-
 tools/perf/arch/x86/util/intel-pt.c  |   4 +--
 tools/perf/arch/x86/util/tsc.c       |   2 +-
 tools/perf/builtin-record.c          |   4 +--
 tools/perf/builtin-report.c          |   2 +-
 tools/perf/builtin-script.c          |   2 +-
 tools/perf/builtin-stat.c            |   2 +-
 tools/perf/lib/include/perf/event.h  | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/tests/cpumap.c            |  12 ++++----
 tools/perf/tests/event_update.c      |  16 +++++-----
 tools/perf/tests/stat.c              |   8 ++---
 tools/perf/tests/thread-map.c        |   2 +-
 tools/perf/util/arm-spe.c            |   6 ++--
 tools/perf/util/auxtrace.c           |  20 ++++++------
 tools/perf/util/auxtrace.h           |   8 ++---
 tools/perf/util/build-id.c           |   2 +-
 tools/perf/util/cpumap.c             |   6 ++--
 tools/perf/util/cpumap.h             |   4 +--
 tools/perf/util/cs-etm.c             |   2 +-
 tools/perf/util/event.c              |  38 +++++++++++------------
 tools/perf/util/event.h              | 278 +++--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 tools/perf/util/header.c             |  56 +++++++++++++++++-----------------
 tools/perf/util/intel-bts.c          |   6 ++--
 tools/perf/util/intel-pt.c           |  12 ++++----
 tools/perf/util/python.c             |   4 +--
 tools/perf/util/s390-cpumsf.c        |   4 +--
 tools/perf/util/session.c            |  28 ++++++++---------
 tools/perf/util/session.h            |   2 +-
 tools/perf/util/stat.c               |  12 ++++----
 tools/perf/util/thread_map.c         |   4 +--
 tools/perf/util/thread_map.h         |   4 +--
 34 files changed, 418 insertions(+), 415 deletions(-)
Signature · 1 line
- Arnaldo