xref: /linux/arch/powerpc/perf/hv-24x7-catalog.h (revision 26fbb4c8c7c3ee9a4c3b4de555a8587b5a19154e)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LINUX_POWERPC_PERF_HV_24X7_CATALOG_H_
3 #define LINUX_POWERPC_PERF_HV_24X7_CATALOG_H_
4 
5 #include <linux/types.h>
6 
7 /* From document "24x7 Event and Group Catalog Formats Proposal" v0.15 */
8 
9 struct hv_24x7_catalog_page_0 {
10 #define HV_24X7_CATALOG_MAGIC 0x32347837 /* "24x7" in ASCII */
11 	__be32 magic;
12 	__be32 length; /* In 4096 byte pages */
13 	__be64 version; /* XXX: arbitrary? what's the meaning/useage/purpose? */
14 	__u8 build_time_stamp[16]; /* "YYYYMMDDHHMMSS\0\0" */
15 	__u8 reserved2[32];
16 	__be16 schema_data_offs; /* in 4096 byte pages */
17 	__be16 schema_data_len;  /* in 4096 byte pages */
18 	__be16 schema_entry_count;
19 	__u8 reserved3[2];
20 	__be16 event_data_offs;
21 	__be16 event_data_len;
22 	__be16 event_entry_count;
23 	__u8 reserved4[2];
24 	__be16 group_data_offs; /* in 4096 byte pages */
25 	__be16 group_data_len;  /* in 4096 byte pages */
26 	__be16 group_entry_count;
27 	__u8 reserved5[2];
28 	__be16 formula_data_offs; /* in 4096 byte pages */
29 	__be16 formula_data_len;  /* in 4096 byte pages */
30 	__be16 formula_entry_count;
31 	__u8 reserved6[2];
32 } __packed;
33 
34 struct hv_24x7_event_data {
35 	__be16 length; /* in bytes, must be a multiple of 16 */
36 	__u8 reserved1[2];
37 	__u8 domain; /* Chip = 1, Core = 2 */
38 	__u8 reserved2[1];
39 	__be16 event_group_record_offs; /* in bytes, must be 8 byte aligned */
40 	__be16 event_group_record_len; /* in bytes */
41 
42 	/* in bytes, offset from event_group_record */
43 	__be16 event_counter_offs;
44 
45 	/* verified_state, unverified_state, caveat_state, broken_state, ... */
46 	__be32 flags;
47 
48 	__be16 primary_group_ix;
49 	__be16 group_count;
50 	__be16 event_name_len;
51 	__u8 remainder[];
52 	/* __u8 event_name[event_name_len - 2]; */
53 	/* __be16 event_description_len; */
54 	/* __u8 event_desc[event_description_len - 2]; */
55 	/* __be16 detailed_desc_len; */
56 	/* __u8 detailed_desc[detailed_desc_len - 2]; */
57 } __packed;
58 
59 #endif
60