microvg  5.0.0
microvg
microvg_trace.h
1 /*
2  * C
3  *
4  * Copyright 2023-2024 MicroEJ Corp. All rights reserved.
5  * Use of this source code is governed by a BSD-style license that can be found with this software.
6  */
7 
8 
9 #if !defined MICROVG_TRACE_H
10 #define MICROVG_TRACE_H
11 
12 #if defined __cplusplus
13 extern "C" {
14 #endif
15 
16 /*
17  * @file
18  * @brief Provides the logs of the CCO MicroVG.
19  * @author MicroEJ Developer Team
20  * @version 5.0.0
21  */
22 
23 // -----------------------------------------------------------------------------
24 // Includes
25 // -----------------------------------------------------------------------------
26 
27 #include "LLTRACE_impl.h"
28 
29 // -----------------------------------------------------------------------------
30 // Defines
31 // -----------------------------------------------------------------------------
32 
33 /*
34  * @brief Available number of events: IMAGE, FONT and DRAWING
35  */
36 #define LOG_MICROVG_EVENTS 3
37 
38 /*
39  * Events identifiers
40  */
41 #define LOG_MICROVG_IMAGE_ID 0
42 #define LOG_MICROVG_FONT_ID 1
43 #define LOG_MICROVG_DRAWING_ID 2
44 
45 /*
46  * @brief Types of Image events
47  */
48 #define LOG_MICROVG_IMAGE_load 0
49 #define LOG_MICROVG_IMAGE_create 1
50 #define LOG_MICROVG_IMAGE_close 2
51 
52 /*
53  * @brief Types of Font events
54  */
55 #define LOG_MICROVG_FONT_load 0
56 #define LOG_MICROVG_FONT_baseline 1
57 #define LOG_MICROVG_FONT_height 2
58 #define LOG_MICROVG_FONT_stringWidth 3
59 #define LOG_MICROVG_FONT_stringHeight 4
60 
61 /*
62  * @brief Types of Drawing events
63  */
64 #define LOG_MICROVG_DRAW_path 0
65 #define LOG_MICROVG_DRAW_pathGradient 1
66 #define LOG_MICROVG_DRAW_string 2
67 #define LOG_MICROVG_DRAW_stringGradient 3
68 #define LOG_MICROVG_DRAW_stringOnCircle 4
69 #define LOG_MICROVG_DRAW_stringOnCircleGradient 5
70 #define LOG_MICROVG_DRAW_image 6
71 
72 /*
73  * @brief Useful macros to concatenate easily some strings and defines.
74  */
75 #define CONCAT_STRINGS(p, s) p ## s
76 #define CONCAT_DEFINES(p, s) CONCAT_STRINGS(p,s)
77 
78 /*
79  * @brief Macro to add an event and its type.
80  */
81 #define LOG_MICROVG_START(event, type) LLTRACE_IMPL_record_event_u32(vg_trace_group_id, event, type);
82 
83 /*
84  * @brief Macro to notify the end of an event and its type.
85  */
86 #define LOG_MICROVG_END(event, type) LLTRACE_IMPL_record_event_end_u32(vg_trace_group_id, event, type);
87 
88 /* The following lines must be added to a SYSVIEW_MicroVG.txt file
89  in the <SYSTEMVIEW instalation dir>/Description folder
90 
91 NamedType VGImage 0=LOAD_IMAGE
92 NamedType VGImage 1=CREATE_IMAGE
93 NamedType VGImage 2=CLOSE_IMAGE
94 
95 NamedType VGFont 0=LOAD_FONT
96 NamedType VGFont 1=FONT_BASELINE
97 NamedType VGFont 2=FONT_HEIGHT
98 NamedType VGFont 3=STRING_WIDTH
99 NamedType VGFont 4=STRING_HEIGHT
100 
101 NamedType VGDraw 0=DRAW_PATH
102 NamedType VGDraw 1=DRAW_PATH_GRADIENT
103 NamedType VGDraw 2=DRAW_STRING
104 NamedType VGDraw 3=DRAW_STRING_GRADIENT
105 NamedType VGDraw 4=DRAW_STRING_ON_CIRCLE
106 NamedType VGDraw 5=DRAW_STRING_ON_CIRCLE_GRADIENT
107 NamedType VGDraw 6=DRAW_IMAGE
108 
109 0 VG_ImageEvent (MicroVG) Execute image event %VGImage | (MicroVG) Image event %VGImage done
110 1 VG_FontEvent (MicroVG) Execute font event %VGFont | (MicroVG) Font event %VGFont done
111 2 VG_DrawingEvent (MicroVG) Execute drawing event %VGDraw | (MicroVG) Drawing event %VGDraw done
112 
113  */
114 
115 // -----------------------------------------------------------------------------
116 // Extern symbols
117 // -----------------------------------------------------------------------------
118 
119 /*
120  * @brief External variable that contains the id for each trace group.
121  */
122 extern int32_t vg_trace_group_id;
123 
124 // -----------------------------------------------------------------------------
125 // EOF
126 // -----------------------------------------------------------------------------
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif // !defined MICROVG_TRACE_H