162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci#include <inttypes.h>
362306a36Sopenharmony_ci#include <stdio.h>
462306a36Sopenharmony_ci#include <stdlib.h>
562306a36Sopenharmony_ci#include <stdbool.h>
662306a36Sopenharmony_ci#include <linux/kernel.h>
762306a36Sopenharmony_ci#include <linux/types.h>
862306a36Sopenharmony_ci#include <linux/perf_event.h>
962306a36Sopenharmony_ci#include "util/evsel_fprintf.h"
1062306a36Sopenharmony_ci#include "trace-event.h"
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cistruct bit_names {
1362306a36Sopenharmony_ci	int bit;
1462306a36Sopenharmony_ci	const char *name;
1562306a36Sopenharmony_ci};
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_cistatic void __p_bits(char *buf, size_t size, u64 value, struct bit_names *bits)
1862306a36Sopenharmony_ci{
1962306a36Sopenharmony_ci	bool first_bit = true;
2062306a36Sopenharmony_ci	int i = 0;
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci	do {
2362306a36Sopenharmony_ci		if (value & bits[i].bit) {
2462306a36Sopenharmony_ci			buf += scnprintf(buf, size, "%s%s", first_bit ? "" : "|", bits[i].name);
2562306a36Sopenharmony_ci			first_bit = false;
2662306a36Sopenharmony_ci		}
2762306a36Sopenharmony_ci	} while (bits[++i].name != NULL);
2862306a36Sopenharmony_ci}
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cistatic void __p_sample_type(char *buf, size_t size, u64 value)
3162306a36Sopenharmony_ci{
3262306a36Sopenharmony_ci#define bit_name(n) { PERF_SAMPLE_##n, #n }
3362306a36Sopenharmony_ci	struct bit_names bits[] = {
3462306a36Sopenharmony_ci		bit_name(IP), bit_name(TID), bit_name(TIME), bit_name(ADDR),
3562306a36Sopenharmony_ci		bit_name(READ), bit_name(CALLCHAIN), bit_name(ID), bit_name(CPU),
3662306a36Sopenharmony_ci		bit_name(PERIOD), bit_name(STREAM_ID), bit_name(RAW),
3762306a36Sopenharmony_ci		bit_name(BRANCH_STACK), bit_name(REGS_USER), bit_name(STACK_USER),
3862306a36Sopenharmony_ci		bit_name(IDENTIFIER), bit_name(REGS_INTR), bit_name(DATA_SRC),
3962306a36Sopenharmony_ci		bit_name(WEIGHT), bit_name(PHYS_ADDR), bit_name(AUX),
4062306a36Sopenharmony_ci		bit_name(CGROUP), bit_name(DATA_PAGE_SIZE), bit_name(CODE_PAGE_SIZE),
4162306a36Sopenharmony_ci		bit_name(WEIGHT_STRUCT),
4262306a36Sopenharmony_ci		{ .name = NULL, }
4362306a36Sopenharmony_ci	};
4462306a36Sopenharmony_ci#undef bit_name
4562306a36Sopenharmony_ci	__p_bits(buf, size, value, bits);
4662306a36Sopenharmony_ci}
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_cistatic void __p_branch_sample_type(char *buf, size_t size, u64 value)
4962306a36Sopenharmony_ci{
5062306a36Sopenharmony_ci#define bit_name(n) { PERF_SAMPLE_BRANCH_##n, #n }
5162306a36Sopenharmony_ci	struct bit_names bits[] = {
5262306a36Sopenharmony_ci		bit_name(USER), bit_name(KERNEL), bit_name(HV), bit_name(ANY),
5362306a36Sopenharmony_ci		bit_name(ANY_CALL), bit_name(ANY_RETURN), bit_name(IND_CALL),
5462306a36Sopenharmony_ci		bit_name(ABORT_TX), bit_name(IN_TX), bit_name(NO_TX),
5562306a36Sopenharmony_ci		bit_name(COND), bit_name(CALL_STACK), bit_name(IND_JUMP),
5662306a36Sopenharmony_ci		bit_name(CALL), bit_name(NO_FLAGS), bit_name(NO_CYCLES),
5762306a36Sopenharmony_ci		bit_name(TYPE_SAVE), bit_name(HW_INDEX), bit_name(PRIV_SAVE),
5862306a36Sopenharmony_ci		{ .name = NULL, }
5962306a36Sopenharmony_ci	};
6062306a36Sopenharmony_ci#undef bit_name
6162306a36Sopenharmony_ci	__p_bits(buf, size, value, bits);
6262306a36Sopenharmony_ci}
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_cistatic void __p_read_format(char *buf, size_t size, u64 value)
6562306a36Sopenharmony_ci{
6662306a36Sopenharmony_ci#define bit_name(n) { PERF_FORMAT_##n, #n }
6762306a36Sopenharmony_ci	struct bit_names bits[] = {
6862306a36Sopenharmony_ci		bit_name(TOTAL_TIME_ENABLED), bit_name(TOTAL_TIME_RUNNING),
6962306a36Sopenharmony_ci		bit_name(ID), bit_name(GROUP), bit_name(LOST),
7062306a36Sopenharmony_ci		{ .name = NULL, }
7162306a36Sopenharmony_ci	};
7262306a36Sopenharmony_ci#undef bit_name
7362306a36Sopenharmony_ci	__p_bits(buf, size, value, bits);
7462306a36Sopenharmony_ci}
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci#define ENUM_ID_TO_STR_CASE(x) case x: return (#x);
7762306a36Sopenharmony_cistatic const char *stringify_perf_type_id(u64 value)
7862306a36Sopenharmony_ci{
7962306a36Sopenharmony_ci	switch (value) {
8062306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_TYPE_HARDWARE)
8162306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_TYPE_SOFTWARE)
8262306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_TYPE_TRACEPOINT)
8362306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_TYPE_HW_CACHE)
8462306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_TYPE_RAW)
8562306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_TYPE_BREAKPOINT)
8662306a36Sopenharmony_ci	default:
8762306a36Sopenharmony_ci		return NULL;
8862306a36Sopenharmony_ci	}
8962306a36Sopenharmony_ci}
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_cistatic const char *stringify_perf_hw_id(u64 value)
9262306a36Sopenharmony_ci{
9362306a36Sopenharmony_ci	switch (value) {
9462306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CPU_CYCLES)
9562306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_INSTRUCTIONS)
9662306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_REFERENCES)
9762306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_MISSES)
9862306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_BRANCH_INSTRUCTIONS)
9962306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_BRANCH_MISSES)
10062306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_BUS_CYCLES)
10162306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND)
10262306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_STALLED_CYCLES_BACKEND)
10362306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_REF_CPU_CYCLES)
10462306a36Sopenharmony_ci	default:
10562306a36Sopenharmony_ci		return NULL;
10662306a36Sopenharmony_ci	}
10762306a36Sopenharmony_ci}
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_cistatic const char *stringify_perf_hw_cache_id(u64 value)
11062306a36Sopenharmony_ci{
11162306a36Sopenharmony_ci	switch (value) {
11262306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_L1D)
11362306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_L1I)
11462306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_LL)
11562306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_DTLB)
11662306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_ITLB)
11762306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_BPU)
11862306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_NODE)
11962306a36Sopenharmony_ci	default:
12062306a36Sopenharmony_ci		return NULL;
12162306a36Sopenharmony_ci	}
12262306a36Sopenharmony_ci}
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_cistatic const char *stringify_perf_hw_cache_op_id(u64 value)
12562306a36Sopenharmony_ci{
12662306a36Sopenharmony_ci	switch (value) {
12762306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_OP_READ)
12862306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_OP_WRITE)
12962306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_OP_PREFETCH)
13062306a36Sopenharmony_ci	default:
13162306a36Sopenharmony_ci		return NULL;
13262306a36Sopenharmony_ci	}
13362306a36Sopenharmony_ci}
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_cistatic const char *stringify_perf_hw_cache_op_result_id(u64 value)
13662306a36Sopenharmony_ci{
13762306a36Sopenharmony_ci	switch (value) {
13862306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_RESULT_ACCESS)
13962306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_HW_CACHE_RESULT_MISS)
14062306a36Sopenharmony_ci	default:
14162306a36Sopenharmony_ci		return NULL;
14262306a36Sopenharmony_ci	}
14362306a36Sopenharmony_ci}
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_cistatic const char *stringify_perf_sw_id(u64 value)
14662306a36Sopenharmony_ci{
14762306a36Sopenharmony_ci	switch (value) {
14862306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_CPU_CLOCK)
14962306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_TASK_CLOCK)
15062306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_PAGE_FAULTS)
15162306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_CONTEXT_SWITCHES)
15262306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_CPU_MIGRATIONS)
15362306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_PAGE_FAULTS_MIN)
15462306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_PAGE_FAULTS_MAJ)
15562306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_ALIGNMENT_FAULTS)
15662306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_EMULATION_FAULTS)
15762306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_DUMMY)
15862306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_BPF_OUTPUT)
15962306a36Sopenharmony_ci	ENUM_ID_TO_STR_CASE(PERF_COUNT_SW_CGROUP_SWITCHES)
16062306a36Sopenharmony_ci	default:
16162306a36Sopenharmony_ci		return NULL;
16262306a36Sopenharmony_ci	}
16362306a36Sopenharmony_ci}
16462306a36Sopenharmony_ci#undef ENUM_ID_TO_STR_CASE
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci#define PRINT_ID(_s, _f)					\
16762306a36Sopenharmony_cido {								\
16862306a36Sopenharmony_ci	const char *__s = _s;					\
16962306a36Sopenharmony_ci	if (__s == NULL)					\
17062306a36Sopenharmony_ci		snprintf(buf, size, _f, value);			\
17162306a36Sopenharmony_ci	else							\
17262306a36Sopenharmony_ci		snprintf(buf, size, _f" (%s)", value, __s);	\
17362306a36Sopenharmony_ci} while (0)
17462306a36Sopenharmony_ci#define print_id_unsigned(_s)	PRINT_ID(_s, "%"PRIu64)
17562306a36Sopenharmony_ci#define print_id_hex(_s)	PRINT_ID(_s, "%#"PRIx64)
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_cistatic void __p_type_id(char *buf, size_t size, u64 value)
17862306a36Sopenharmony_ci{
17962306a36Sopenharmony_ci	print_id_unsigned(stringify_perf_type_id(value));
18062306a36Sopenharmony_ci}
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_cistatic void __p_config_hw_id(char *buf, size_t size, u64 value)
18362306a36Sopenharmony_ci{
18462306a36Sopenharmony_ci	print_id_hex(stringify_perf_hw_id(value));
18562306a36Sopenharmony_ci}
18662306a36Sopenharmony_ci
18762306a36Sopenharmony_cistatic void __p_config_sw_id(char *buf, size_t size, u64 value)
18862306a36Sopenharmony_ci{
18962306a36Sopenharmony_ci	print_id_hex(stringify_perf_sw_id(value));
19062306a36Sopenharmony_ci}
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_cistatic void __p_config_hw_cache_id(char *buf, size_t size, u64 value)
19362306a36Sopenharmony_ci{
19462306a36Sopenharmony_ci	const char *hw_cache_str = stringify_perf_hw_cache_id(value & 0xff);
19562306a36Sopenharmony_ci	const char *hw_cache_op_str =
19662306a36Sopenharmony_ci		stringify_perf_hw_cache_op_id((value & 0xff00) >> 8);
19762306a36Sopenharmony_ci	const char *hw_cache_op_result_str =
19862306a36Sopenharmony_ci		stringify_perf_hw_cache_op_result_id((value & 0xff0000) >> 16);
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci	if (hw_cache_str == NULL || hw_cache_op_str == NULL ||
20162306a36Sopenharmony_ci	    hw_cache_op_result_str == NULL) {
20262306a36Sopenharmony_ci		snprintf(buf, size, "%#"PRIx64, value);
20362306a36Sopenharmony_ci	} else {
20462306a36Sopenharmony_ci		snprintf(buf, size, "%#"PRIx64" (%s | %s | %s)", value,
20562306a36Sopenharmony_ci			 hw_cache_op_result_str, hw_cache_op_str, hw_cache_str);
20662306a36Sopenharmony_ci	}
20762306a36Sopenharmony_ci}
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci#ifdef HAVE_LIBTRACEEVENT
21062306a36Sopenharmony_cistatic void __p_config_tracepoint_id(char *buf, size_t size, u64 value)
21162306a36Sopenharmony_ci{
21262306a36Sopenharmony_ci	char *str = tracepoint_id_to_name(value);
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci	print_id_hex(str);
21562306a36Sopenharmony_ci	free(str);
21662306a36Sopenharmony_ci}
21762306a36Sopenharmony_ci#endif
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_cistatic void __p_config_id(char *buf, size_t size, u32 type, u64 value)
22062306a36Sopenharmony_ci{
22162306a36Sopenharmony_ci	switch (type) {
22262306a36Sopenharmony_ci	case PERF_TYPE_HARDWARE:
22362306a36Sopenharmony_ci		return __p_config_hw_id(buf, size, value);
22462306a36Sopenharmony_ci	case PERF_TYPE_SOFTWARE:
22562306a36Sopenharmony_ci		return __p_config_sw_id(buf, size, value);
22662306a36Sopenharmony_ci	case PERF_TYPE_HW_CACHE:
22762306a36Sopenharmony_ci		return __p_config_hw_cache_id(buf, size, value);
22862306a36Sopenharmony_ci	case PERF_TYPE_TRACEPOINT:
22962306a36Sopenharmony_ci#ifdef HAVE_LIBTRACEEVENT
23062306a36Sopenharmony_ci		return __p_config_tracepoint_id(buf, size, value);
23162306a36Sopenharmony_ci#endif
23262306a36Sopenharmony_ci	case PERF_TYPE_RAW:
23362306a36Sopenharmony_ci	case PERF_TYPE_BREAKPOINT:
23462306a36Sopenharmony_ci	default:
23562306a36Sopenharmony_ci		snprintf(buf, size, "%#"PRIx64, value);
23662306a36Sopenharmony_ci		return;
23762306a36Sopenharmony_ci	}
23862306a36Sopenharmony_ci}
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ci#define BUF_SIZE		1024
24162306a36Sopenharmony_ci
24262306a36Sopenharmony_ci#define p_hex(val)		snprintf(buf, BUF_SIZE, "%#"PRIx64, (uint64_t)(val))
24362306a36Sopenharmony_ci#define p_unsigned(val)		snprintf(buf, BUF_SIZE, "%"PRIu64, (uint64_t)(val))
24462306a36Sopenharmony_ci#define p_signed(val)		snprintf(buf, BUF_SIZE, "%"PRId64, (int64_t)(val))
24562306a36Sopenharmony_ci#define p_sample_type(val)	__p_sample_type(buf, BUF_SIZE, val)
24662306a36Sopenharmony_ci#define p_branch_sample_type(val) __p_branch_sample_type(buf, BUF_SIZE, val)
24762306a36Sopenharmony_ci#define p_read_format(val)	__p_read_format(buf, BUF_SIZE, val)
24862306a36Sopenharmony_ci#define p_type_id(val)		__p_type_id(buf, BUF_SIZE, val)
24962306a36Sopenharmony_ci#define p_config_id(val)	__p_config_id(buf, BUF_SIZE, attr->type, val)
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci#define PRINT_ATTRn(_n, _f, _p, _a)			\
25262306a36Sopenharmony_cido {							\
25362306a36Sopenharmony_ci	if (_a || attr->_f) {				\
25462306a36Sopenharmony_ci		_p(attr->_f);				\
25562306a36Sopenharmony_ci		ret += attr__fprintf(fp, _n, buf, priv);\
25662306a36Sopenharmony_ci	}						\
25762306a36Sopenharmony_ci} while (0)
25862306a36Sopenharmony_ci
25962306a36Sopenharmony_ci#define PRINT_ATTRf(_f, _p)	PRINT_ATTRn(#_f, _f, _p, false)
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ciint perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
26262306a36Sopenharmony_ci			     attr__fprintf_f attr__fprintf, void *priv)
26362306a36Sopenharmony_ci{
26462306a36Sopenharmony_ci	char buf[BUF_SIZE];
26562306a36Sopenharmony_ci	int ret = 0;
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ci	PRINT_ATTRn("type", type, p_type_id, true);
26862306a36Sopenharmony_ci	PRINT_ATTRf(size, p_unsigned);
26962306a36Sopenharmony_ci	PRINT_ATTRn("config", config, p_config_id, true);
27062306a36Sopenharmony_ci	PRINT_ATTRn("{ sample_period, sample_freq }", sample_period, p_unsigned, false);
27162306a36Sopenharmony_ci	PRINT_ATTRf(sample_type, p_sample_type);
27262306a36Sopenharmony_ci	PRINT_ATTRf(read_format, p_read_format);
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci	PRINT_ATTRf(disabled, p_unsigned);
27562306a36Sopenharmony_ci	PRINT_ATTRf(inherit, p_unsigned);
27662306a36Sopenharmony_ci	PRINT_ATTRf(pinned, p_unsigned);
27762306a36Sopenharmony_ci	PRINT_ATTRf(exclusive, p_unsigned);
27862306a36Sopenharmony_ci	PRINT_ATTRf(exclude_user, p_unsigned);
27962306a36Sopenharmony_ci	PRINT_ATTRf(exclude_kernel, p_unsigned);
28062306a36Sopenharmony_ci	PRINT_ATTRf(exclude_hv, p_unsigned);
28162306a36Sopenharmony_ci	PRINT_ATTRf(exclude_idle, p_unsigned);
28262306a36Sopenharmony_ci	PRINT_ATTRf(mmap, p_unsigned);
28362306a36Sopenharmony_ci	PRINT_ATTRf(comm, p_unsigned);
28462306a36Sopenharmony_ci	PRINT_ATTRf(freq, p_unsigned);
28562306a36Sopenharmony_ci	PRINT_ATTRf(inherit_stat, p_unsigned);
28662306a36Sopenharmony_ci	PRINT_ATTRf(enable_on_exec, p_unsigned);
28762306a36Sopenharmony_ci	PRINT_ATTRf(task, p_unsigned);
28862306a36Sopenharmony_ci	PRINT_ATTRf(watermark, p_unsigned);
28962306a36Sopenharmony_ci	PRINT_ATTRf(precise_ip, p_unsigned);
29062306a36Sopenharmony_ci	PRINT_ATTRf(mmap_data, p_unsigned);
29162306a36Sopenharmony_ci	PRINT_ATTRf(sample_id_all, p_unsigned);
29262306a36Sopenharmony_ci	PRINT_ATTRf(exclude_host, p_unsigned);
29362306a36Sopenharmony_ci	PRINT_ATTRf(exclude_guest, p_unsigned);
29462306a36Sopenharmony_ci	PRINT_ATTRf(exclude_callchain_kernel, p_unsigned);
29562306a36Sopenharmony_ci	PRINT_ATTRf(exclude_callchain_user, p_unsigned);
29662306a36Sopenharmony_ci	PRINT_ATTRf(mmap2, p_unsigned);
29762306a36Sopenharmony_ci	PRINT_ATTRf(comm_exec, p_unsigned);
29862306a36Sopenharmony_ci	PRINT_ATTRf(use_clockid, p_unsigned);
29962306a36Sopenharmony_ci	PRINT_ATTRf(context_switch, p_unsigned);
30062306a36Sopenharmony_ci	PRINT_ATTRf(write_backward, p_unsigned);
30162306a36Sopenharmony_ci	PRINT_ATTRf(namespaces, p_unsigned);
30262306a36Sopenharmony_ci	PRINT_ATTRf(ksymbol, p_unsigned);
30362306a36Sopenharmony_ci	PRINT_ATTRf(bpf_event, p_unsigned);
30462306a36Sopenharmony_ci	PRINT_ATTRf(aux_output, p_unsigned);
30562306a36Sopenharmony_ci	PRINT_ATTRf(cgroup, p_unsigned);
30662306a36Sopenharmony_ci	PRINT_ATTRf(text_poke, p_unsigned);
30762306a36Sopenharmony_ci	PRINT_ATTRf(build_id, p_unsigned);
30862306a36Sopenharmony_ci	PRINT_ATTRf(inherit_thread, p_unsigned);
30962306a36Sopenharmony_ci	PRINT_ATTRf(remove_on_exec, p_unsigned);
31062306a36Sopenharmony_ci	PRINT_ATTRf(sigtrap, p_unsigned);
31162306a36Sopenharmony_ci
31262306a36Sopenharmony_ci	PRINT_ATTRn("{ wakeup_events, wakeup_watermark }", wakeup_events, p_unsigned, false);
31362306a36Sopenharmony_ci	PRINT_ATTRf(bp_type, p_unsigned);
31462306a36Sopenharmony_ci	PRINT_ATTRn("{ bp_addr, config1 }", bp_addr, p_hex, false);
31562306a36Sopenharmony_ci	PRINT_ATTRn("{ bp_len, config2 }", bp_len, p_hex, false);
31662306a36Sopenharmony_ci	PRINT_ATTRf(branch_sample_type, p_branch_sample_type);
31762306a36Sopenharmony_ci	PRINT_ATTRf(sample_regs_user, p_hex);
31862306a36Sopenharmony_ci	PRINT_ATTRf(sample_stack_user, p_unsigned);
31962306a36Sopenharmony_ci	PRINT_ATTRf(clockid, p_signed);
32062306a36Sopenharmony_ci	PRINT_ATTRf(sample_regs_intr, p_hex);
32162306a36Sopenharmony_ci	PRINT_ATTRf(aux_watermark, p_unsigned);
32262306a36Sopenharmony_ci	PRINT_ATTRf(sample_max_stack, p_unsigned);
32362306a36Sopenharmony_ci	PRINT_ATTRf(aux_sample_size, p_unsigned);
32462306a36Sopenharmony_ci	PRINT_ATTRf(sig_data, p_unsigned);
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_ci	return ret;
32762306a36Sopenharmony_ci}
328