mali_kbase_hwcnt_reader.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. *
  3. * (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
  4. *
  5. * This program is free software and is provided to you under the terms of the
  6. * GNU General Public License version 2 as published by the Free Software
  7. * Foundation, and any use by you of this program is subject to the terms
  8. * of such GNU licence.
  9. *
  10. * A copy of the licence is included with the program, and can also be obtained
  11. * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  12. * Boston, MA 02110-1301, USA.
  13. *
  14. */
  15. #ifndef _KBASE_HWCNT_READER_H_
  16. #define _KBASE_HWCNT_READER_H_
  17. /* The ids of ioctl commands. */
  18. #define KBASE_HWCNT_READER 0xBE
  19. #define KBASE_HWCNT_READER_GET_HWVER _IOR(KBASE_HWCNT_READER, 0x00, u32)
  20. #define KBASE_HWCNT_READER_GET_BUFFER_SIZE _IOR(KBASE_HWCNT_READER, 0x01, u32)
  21. #define KBASE_HWCNT_READER_DUMP _IOW(KBASE_HWCNT_READER, 0x10, u32)
  22. #define KBASE_HWCNT_READER_CLEAR _IOW(KBASE_HWCNT_READER, 0x11, u32)
  23. #define KBASE_HWCNT_READER_GET_BUFFER _IOR(KBASE_HWCNT_READER, 0x20,\
  24. struct kbase_hwcnt_reader_metadata)
  25. #define KBASE_HWCNT_READER_PUT_BUFFER _IOW(KBASE_HWCNT_READER, 0x21,\
  26. struct kbase_hwcnt_reader_metadata)
  27. #define KBASE_HWCNT_READER_SET_INTERVAL _IOW(KBASE_HWCNT_READER, 0x30, u32)
  28. #define KBASE_HWCNT_READER_ENABLE_EVENT _IOW(KBASE_HWCNT_READER, 0x40, u32)
  29. #define KBASE_HWCNT_READER_DISABLE_EVENT _IOW(KBASE_HWCNT_READER, 0x41, u32)
  30. #define KBASE_HWCNT_READER_GET_API_VERSION _IOW(KBASE_HWCNT_READER, 0xFF, u32)
  31. /**
  32. * struct kbase_hwcnt_reader_metadata - hwcnt reader sample buffer metadata
  33. * @timestamp: time when sample was collected
  34. * @event_id: id of an event that triggered sample collection
  35. * @buffer_idx: position in sampling area where sample buffer was stored
  36. */
  37. struct kbase_hwcnt_reader_metadata {
  38. u64 timestamp;
  39. u32 event_id;
  40. u32 buffer_idx;
  41. };
  42. /**
  43. * enum base_hwcnt_reader_event - hwcnt dumping events
  44. * @BASE_HWCNT_READER_EVENT_MANUAL: manual request for dump
  45. * @BASE_HWCNT_READER_EVENT_PERIODIC: periodic dump
  46. * @BASE_HWCNT_READER_EVENT_PREJOB: prejob dump request
  47. * @BASE_HWCNT_READER_EVENT_POSTJOB: postjob dump request
  48. * @BASE_HWCNT_READER_EVENT_COUNT: number of supported events
  49. */
  50. enum base_hwcnt_reader_event {
  51. BASE_HWCNT_READER_EVENT_MANUAL,
  52. BASE_HWCNT_READER_EVENT_PERIODIC,
  53. BASE_HWCNT_READER_EVENT_PREJOB,
  54. BASE_HWCNT_READER_EVENT_POSTJOB,
  55. BASE_HWCNT_READER_EVENT_COUNT
  56. };
  57. #endif // ifndef _KBASE_HWCNT_READER_H_