| 1 |
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
| 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 { /* Set CPUs to operate on */ |
| 23 |
__u64 version; /* Version of interface */ |
| 24 |
__u64 data_bytes; /* # of bytes required */ |
| 25 |
__u64 cpumask_len; /* Length of CPU mask in bytes */ |
| 26 |
__u64 *cpumask; /* Pointer to CPU mask */ |
| 27 |
__u64 counter_sets; /* Bit mask of counter sets to get */ |
| 28 |
}; |
| 29 |
|
| 30 |
struct s390_ctrset_setdata { /* Counter set data */ |
| 31 |
__u32 set; /* Counter set number */ |
| 32 |
__u32 no_cnts; /* # of counters stored in cv[] */ |
| 33 |
__u64 cv[]; /* Counter values (variable length) */ |
| 34 |
}; |
| 35 |
|
| 36 |
struct s390_ctrset_cpudata { /* Counter set data per CPU */ |
| 37 |
__u32 cpu_nr; /* CPU number */ |
| 38 |
__u32 no_sets; /* # of counters sets in data[] */ |
| 39 |
struct s390_ctrset_setdata data[]; |
| 40 |
}; |
| 41 |
|
| 42 |
struct s390_ctrset_read { /* Structure to get all ctr sets */ |
| 43 |
__u64 no_cpus; /* Total # of CPUs data taken from */ |
| 44 |
struct s390_ctrset_cpudata data[]; |
| 45 |
}; |
| 46 |
|
| 47 |
#define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */ |
| 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 |