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