| 1 |
|
| 2 | |
| 3 | * Copyright IBM Corp. 2021
|
| 4 | * Interface implementation for communication with the CPU Measurement
|
| 5 | * counter facility device driver.
|
| 6 | *
|
| 7 | * Author(s): Thomas Richter <[email protected]>
|
| 8 | *
|
| 9 | * Define for ioctl() commands to communicate with the CPU Measurement
|
| 10 | * counter facility device driver.
|
| 11 |
|
| 12 |
|
| 13 | #ifndef _PERF_CPUM_CF_DIAG_H
|
| 14 | #define _PERF_CPUM_CF_DIAG_H
|
| 15 |
|
| 16 | #include <linux/ioctl.h>
|
| 17 | #include <linux/types.h>
|
| 18 |
|
| 19 | #define S390_HWCTR_DEVICE "hwctr"
|
| 20 | #define S390_HWCTR_START_VERSION 1
|
| 21 |
|
| 22 | struct s390_ctrset_start {
|
| 23 | __u64 version;
|
| 24 | __u64 data_bytes;
|
| 25 | __u64 cpumask_len;
|
| 26 | __u64 *cpumask;
|
| 27 | __u64 counter_sets;
|
| 28 | };
|
| 29 |
|
| 30 | struct s390_ctrset_setdata {
|
| 31 | __u32 set;
|
| 32 | __u32 no_cnts;
|
| 33 | __u64 cv[];
|
| 34 | };
|
| 35 |
|
| 36 | struct s390_ctrset_cpudata {
|
| 37 | __u32 cpu_nr;
|
| 38 | __u32 no_sets;
|
| 39 | struct s390_ctrset_setdata data[];
|
| 40 | };
|
| 41 |
|
| 42 | struct s390_ctrset_read {
|
| 43 | __u64 no_cpus;
|
| 44 | struct s390_ctrset_cpudata data[];
|
| 45 | };
|
| 46 |
|
| 47 | #define S390_HWCTR_MAGIC 'C'
|
| 48 | #define S390_HWCTR_START _IOWR(S390_HWCTR_MAGIC, 1, struct s390_ctrset_start)
|
| 49 | #define S390_HWCTR_STOP _IO(S390_HWCTR_MAGIC, 2)
|
| 50 | #define S390_HWCTR_READ _IOWR(S390_HWCTR_MAGIC, 3, struct s390_ctrset_read)
|
| 51 | #endif
|