1 /**
2  * @file lv_profiler_builtin.h
3  *
4  */
5 
6 #ifndef LV_PROFILER_BUILTIN_H
7 #define LV_PROFILER_BUILTIN_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "../lv_conf_internal.h"
18 
19 #if LV_USE_PROFILER && LV_USE_PROFILER_BUILTIN
20 
21 #include "lv_types.h"
22 
23 /*********************
24  *      DEFINES
25  *********************/
26 
27 #define LV_PROFILER_BUILTIN_BEGIN_TAG(tag)  lv_profiler_builtin_write((tag), 'B')
28 #define LV_PROFILER_BUILTIN_END_TAG(tag)    lv_profiler_builtin_write((tag), 'E')
29 #define LV_PROFILER_BUILTIN_BEGIN           LV_PROFILER_BUILTIN_BEGIN_TAG(__func__)
30 #define LV_PROFILER_BUILTIN_END             LV_PROFILER_BUILTIN_END_TAG(__func__)
31 
32 /**********************
33  *      TYPEDEFS
34  **********************/
35 
36 /**********************
37  * GLOBAL PROTOTYPES
38  **********************/
39 
40 /**
41  * @brief Initialize the configuration of the built-in profiler
42  * @param config Pointer to the configuration structure of the built-in profiler
43  */
44 void lv_profiler_builtin_config_init(lv_profiler_builtin_config_t * config);
45 
46 /**
47  * @brief Initialize the built-in profiler with the given configuration
48  * @param config Pointer to the configuration structure of the built-in profiler
49  */
50 void lv_profiler_builtin_init(const lv_profiler_builtin_config_t * config);
51 
52 /**
53  * @brief Uninitialize the built-in profiler
54  */
55 void lv_profiler_builtin_uninit(void);
56 
57 /**
58  * @brief Enable or disable the built-in profiler
59  * @param enable true to enable the built-in profiler, false to disable
60  */
61 void lv_profiler_builtin_set_enable(bool enable);
62 
63 /**
64  * @brief Flush the profiling data to the console
65  */
66 void lv_profiler_builtin_flush(void);
67 
68 /**
69  * @brief Write the profiling data for a function with the given tag
70  * @param func Name of the function being profiled
71  * @param tag Tag to associate with the profiling data for the function
72  */
73 void lv_profiler_builtin_write(const char * func, char tag);
74 
75 /**********************
76  *      MACROS
77  **********************/
78 
79 #endif /*LV_USE_PROFILER_BUILTIN*/
80 
81 #ifdef __cplusplus
82 } /*extern "C"*/
83 #endif
84 
85 #endif /*LV_PROFILER_BUILTIN_H*/
86