hwsampler.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * CPUMF HW sampler functions and internal structures
  3. *
  4. * Copyright IBM Corp. 2010
  5. * Author(s): Heinz Graalfs <graalfs@de.ibm.com>
  6. */
  7. #ifndef HWSAMPLER_H_
  8. #define HWSAMPLER_H_
  9. #include <linux/workqueue.h>
  10. #include <asm/cpu_mf.h>
  11. struct hws_ssctl_request_block /* SET SAMPLING CONTROLS req block */
  12. { /* bytes 0 - 7 Bit(s) */
  13. unsigned int s:1; /* 0: maximum buffer indicator */
  14. unsigned int h:1; /* 1: part. level reserved for VM use*/
  15. unsigned long b2_53:52; /* 2-53: zeros */
  16. unsigned int es:1; /* 54: sampling enable control */
  17. unsigned int b55_61:7; /* 55-61: - zeros */
  18. unsigned int cs:1; /* 62: sampling activation control */
  19. unsigned int b63:1; /* 63: zero */
  20. unsigned long interval; /* 8-15: sampling interval */
  21. unsigned long tear; /* 16-23: TEAR contents */
  22. unsigned long dear; /* 24-31: DEAR contents */
  23. /* 32-63: */
  24. unsigned long rsvrd1; /* reserved */
  25. unsigned long rsvrd2; /* reserved */
  26. unsigned long rsvrd3; /* reserved */
  27. unsigned long rsvrd4; /* reserved */
  28. };
  29. struct hws_cpu_buffer {
  30. unsigned long first_sdbt; /* @ of 1st SDB-Table for this CP*/
  31. unsigned long worker_entry;
  32. unsigned long sample_overflow; /* taken from SDB ... */
  33. struct hws_qsi_info_block qsi;
  34. struct hws_ssctl_request_block ssctl;
  35. struct work_struct worker;
  36. atomic_t ext_params;
  37. unsigned long req_alert;
  38. unsigned long loss_of_sample_data;
  39. unsigned long invalid_entry_address;
  40. unsigned long incorrect_sdbt_entry;
  41. unsigned long sample_auth_change_alert;
  42. unsigned int finish:1;
  43. unsigned int oom:1;
  44. unsigned int stop_mode:1;
  45. };
  46. int hwsampler_setup(void);
  47. int hwsampler_shutdown(void);
  48. int hwsampler_allocate(unsigned long sdbt, unsigned long sdb);
  49. int hwsampler_deallocate(void);
  50. unsigned long hwsampler_query_min_interval(void);
  51. unsigned long hwsampler_query_max_interval(void);
  52. int hwsampler_start_all(unsigned long interval);
  53. int hwsampler_stop_all(void);
  54. int hwsampler_deactivate(unsigned int cpu);
  55. int hwsampler_activate(unsigned int cpu);
  56. unsigned long hwsampler_get_sample_overflow_count(unsigned int cpu);
  57. #endif /*HWSAMPLER_H_*/