xtensa_perfmon_masks.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef _xtensa_perfmon_masks_H_
  15. #define _xtensa_perfmon_masks_H_
  16. #include <inttypes.h>
  17. #include "xtensa/xt_perf_consts.h"
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. /**
  23. * @brief Description for select parameter
  24. *
  25. * Structure defines description for different select values for performance counters
  26. */
  27. typedef struct xtensa_perfmon_select {
  28. int select; /*!< Selected counter */
  29. const char *description; /*!< Description for selected counter */
  30. } xtensa_perfmon_select_t;
  31. /**
  32. * @brief Description for mask parameter
  33. *
  34. * Structure defines description for different select and mask values for performance counters
  35. */
  36. typedef struct xtensa_perfmon_masks {
  37. int select; /*!< Selected counter */
  38. int mask; /*!< Selected mask for counter */
  39. const char *description; /*!< Description for selected mask */
  40. } xtensa_perfmon_masks_t;
  41. // Maximum amount of performance counter events
  42. #define MAX_PERFMON_EVENTS 119
  43. /**
  44. * @brief Select value description table
  45. *
  46. * Table contains description for different 'select' values for performance counter
  47. */
  48. extern const xtensa_perfmon_select_t xtensa_perfmon_select_table[];
  49. /**
  50. * @brief Mask value description table
  51. *
  52. * Table contains description for different 'select' and 'mask' values for performance counter
  53. */
  54. extern const xtensa_perfmon_masks_t xtensa_perfmon_masks_table[];
  55. /**
  56. * @brief All available counters
  57. *
  58. * Table contains all available counters
  59. */
  60. extern const uint32_t xtensa_perfmon_select_mask_all[MAX_PERFMON_EVENTS * 2];
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #endif // _xtensa_perfmon_masks_H_