hwctrset.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef _PERF_CPUM_CF_DIAG_H
  13. #define _PERF_CPUM_CF_DIAG_H
  14. #include <linux/ioctl.h>
  15. #include <linux/types.h>
  16. #define S390_HWCTR_DEVICE "hwctr"
  17. #define S390_HWCTR_START_VERSION 1
  18. struct s390_ctrset_start { /* Set CPUs to operate on */
  19. __u64 version; /* Version of interface */
  20. __u64 data_bytes; /* # of bytes required */
  21. __u64 cpumask_len; /* Length of CPU mask in bytes */
  22. __u64 *cpumask; /* Pointer to CPU mask */
  23. __u64 counter_sets; /* Bit mask of counter sets to get */
  24. };
  25. struct s390_ctrset_setdata { /* Counter set data */
  26. __u32 set; /* Counter set number */
  27. __u32 no_cnts; /* # of counters stored in cv[] */
  28. __u64 cv[]; /* Counter values (variable length) */
  29. };
  30. struct s390_ctrset_cpudata { /* Counter set data per CPU */
  31. __u32 cpu_nr; /* CPU number */
  32. __u32 no_sets; /* # of counters sets in data[] */
  33. struct s390_ctrset_setdata data[];
  34. };
  35. struct s390_ctrset_read { /* Structure to get all ctr sets */
  36. __u64 no_cpus; /* Total # of CPUs data taken from */
  37. struct s390_ctrset_cpudata data[];
  38. };
  39. #define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */
  40. #define S390_HWCTR_START _IOWR(S390_HWCTR_MAGIC, 1, struct s390_ctrset_start)
  41. #define S390_HWCTR_STOP _IO(S390_HWCTR_MAGIC, 2)
  42. #define S390_HWCTR_READ _IOWR(S390_HWCTR_MAGIC, 3, struct s390_ctrset_read)
  43. #endif