aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/perf')
-rw-r--r--arch/powerpc/perf/hv-24x7-catalog.h33
-rw-r--r--arch/powerpc/perf/hv-24x7.h109
2 files changed, 142 insertions, 0 deletions
diff --git a/arch/powerpc/perf/hv-24x7-catalog.h b/arch/powerpc/perf/hv-24x7-catalog.h
new file mode 100644
index 000000000000..21b19dd86d9c
--- /dev/null
+++ b/arch/powerpc/perf/hv-24x7-catalog.h
@@ -0,0 +1,33 @@
1#ifndef LINUX_POWERPC_PERF_HV_24X7_CATALOG_H_
2#define LINUX_POWERPC_PERF_HV_24X7_CATALOG_H_
3
4#include <linux/types.h>
5
6/* From document "24x7 Event and Group Catalog Formats Proposal" v0.15 */
7
8struct hv_24x7_catalog_page_0 {
9#define HV_24X7_CATALOG_MAGIC 0x32347837 /* "24x7" in ASCII */
10 __be32 magic;
11 __be32 length; /* In 4096 byte pages */
12 __be64 version; /* XXX: arbitrary? what's the meaning/useage/purpose? */
13 __u8 build_time_stamp[16]; /* "YYYYMMDDHHMMSS\0\0" */
14 __u8 reserved2[32];
15 __be16 schema_data_offs; /* in 4096 byte pages */
16 __be16 schema_data_len; /* in 4096 byte pages */
17 __be16 schema_entry_count;
18 __u8 reserved3[2];
19 __be16 event_data_offs;
20 __be16 event_data_len;
21 __be16 event_entry_count;
22 __u8 reserved4[2];
23 __be16 group_data_offs; /* in 4096 byte pages */
24 __be16 group_data_len; /* in 4096 byte pages */
25 __be16 group_entry_count;
26 __u8 reserved5[2];
27 __be16 formula_data_offs; /* in 4096 byte pages */
28 __be16 formula_data_len; /* in 4096 byte pages */
29 __be16 formula_entry_count;
30 __u8 reserved6[2];
31} __packed;
32
33#endif
diff --git a/arch/powerpc/perf/hv-24x7.h b/arch/powerpc/perf/hv-24x7.h
new file mode 100644
index 000000000000..720ebce4b435
--- /dev/null
+++ b/arch/powerpc/perf/hv-24x7.h
@@ -0,0 +1,109 @@
1#ifndef LINUX_POWERPC_PERF_HV_24X7_H_
2#define LINUX_POWERPC_PERF_HV_24X7_H_
3
4#include <linux/types.h>
5
6struct hv_24x7_request {
7 /* PHYSICAL domains require enabling via phyp/hmc. */
8#define HV_24X7_PERF_DOMAIN_PHYSICAL_CHIP 0x01
9#define HV_24X7_PERF_DOMAIN_PHYSICAL_CORE 0x02
10#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_HOME_CORE 0x03
11#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_HOME_CHIP 0x04
12#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_HOME_NODE 0x05
13#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_REMOTE_NODE 0x06
14 __u8 performance_domain;
15 __u8 reserved[0x1];
16
17 /* bytes to read starting at @data_offset. must be a multiple of 8 */
18 __be16 data_size;
19
20 /*
21 * byte offset within the perf domain to read from. must be 8 byte
22 * aligned
23 */
24 __be32 data_offset;
25
26 /*
27 * only valid for VIRTUAL_PROCESSOR domains, ignored for others.
28 * -1 means "current partition only"
29 * Enabling via phyp/hmc required for non-"-1" values. 0 forbidden
30 * unless requestor is 0.
31 */
32 __be16 starting_lpar_ix;
33
34 /*
35 * Ignored when @starting_lpar_ix == -1
36 * Ignored when @performance_domain is not VIRTUAL_PROCESSOR_*
37 * -1 means "infinite" or all
38 */
39 __be16 max_num_lpars;
40
41 /* chip, core, or virtual processor based on @performance_domain */
42 __be16 starting_ix;
43 __be16 max_ix;
44} __packed;
45
46struct hv_24x7_request_buffer {
47 /* 0 - ? */
48 /* 1 - ? */
49#define HV_24X7_IF_VERSION_CURRENT 0x01
50 __u8 interface_version;
51 __u8 num_requests;
52 __u8 reserved[0xE];
53 struct hv_24x7_request requests[];
54} __packed;
55
56struct hv_24x7_result_element {
57 __be16 lpar_ix;
58
59 /*
60 * represents the core, chip, or virtual processor based on the
61 * request's @performance_domain
62 */
63 __be16 domain_ix;
64
65 /* -1 if @performance_domain does not refer to a virtual processor */
66 __be32 lpar_cfg_instance_id;
67
68 /* size = @result_element_data_size of cointaining result. */
69 __u8 element_data[];
70} __packed;
71
72struct hv_24x7_result {
73 __u8 result_ix;
74
75 /*
76 * 0 = not all result elements fit into the buffer, additional requests
77 * required
78 * 1 = all result elements were returned
79 */
80 __u8 results_complete;
81 __be16 num_elements_returned;
82
83 /* This is a copy of @data_size from the coresponding hv_24x7_request */
84 __be16 result_element_data_size;
85 __u8 reserved[0x2];
86
87 /* WARNING: only valid for first result element due to variable sizes
88 * of result elements */
89 /* struct hv_24x7_result_element[@num_elements_returned] */
90 struct hv_24x7_result_element elements[];
91} __packed;
92
93struct hv_24x7_data_result_buffer {
94 /* See versioning for request buffer */
95 __u8 interface_version;
96
97 __u8 num_results;
98 __u8 reserved[0x1];
99 __u8 failing_request_ix;
100 __be32 detailed_rc;
101 __be64 cec_cfg_instance_id;
102 __be64 catalog_version_num;
103 __u8 reserved2[0x8];
104 /* WARNING: only valid for the first result due to variable sizes of
105 * results */
106 struct hv_24x7_result results[]; /* [@num_results] */
107} __packed;
108
109#endif