Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * Copyright IBM Corp. 2021
0004  * Interface implementation for communication with the CPU Measurement
0005  * counter facility device driver.
0006  *
0007  * Author(s): Thomas Richter <tmricht@linux.ibm.com>
0008  *
0009  * Define for ioctl() commands to communicate with the CPU Measurement
0010  * counter facility device driver.
0011  */
0012 
0013 #ifndef _PERF_CPUM_CF_DIAG_H
0014 #define _PERF_CPUM_CF_DIAG_H
0015 
0016 #include <linux/ioctl.h>
0017 #include <linux/types.h>
0018 
0019 #define S390_HWCTR_DEVICE       "hwctr"
0020 #define S390_HWCTR_START_VERSION    1
0021 
0022 struct s390_ctrset_start {      /* Set CPUs to operate on */
0023     __u64 version;          /* Version of interface */
0024     __u64 data_bytes;       /* # of bytes required */
0025     __u64 cpumask_len;      /* Length of CPU mask in bytes */
0026     __u64 *cpumask;         /* Pointer to CPU mask */
0027     __u64 counter_sets;     /* Bit mask of counter sets to get */
0028 };
0029 
0030 struct s390_ctrset_setdata {        /* Counter set data */
0031     __u32 set;          /* Counter set number */
0032     __u32 no_cnts;          /* # of counters stored in cv[] */
0033     __u64 cv[];         /* Counter values (variable length) */
0034 };
0035 
0036 struct s390_ctrset_cpudata {        /* Counter set data per CPU */
0037     __u32 cpu_nr;           /* CPU number */
0038     __u32 no_sets;          /* # of counters sets in data[] */
0039     struct s390_ctrset_setdata data[];
0040 };
0041 
0042 struct s390_ctrset_read {       /* Structure to get all ctr sets */
0043     __u64 no_cpus;          /* Total # of CPUs data taken from */
0044     struct s390_ctrset_cpudata data[];
0045 };
0046 
0047 #define S390_HWCTR_MAGIC    'C' /* Random magic # for ioctls */
0048 #define S390_HWCTR_START    _IOWR(S390_HWCTR_MAGIC, 1, struct s390_ctrset_start)
0049 #define S390_HWCTR_STOP     _IO(S390_HWCTR_MAGIC, 2)
0050 #define S390_HWCTR_READ     _IOWR(S390_HWCTR_MAGIC, 3, struct s390_ctrset_read)
0051 #endif