1 | /** |
---|
2 | * @file rtems/captureimpl.h |
---|
3 | * |
---|
4 | * @brief Capture Implementation file |
---|
5 | * |
---|
6 | * This file contains an interface between the capture engine and |
---|
7 | * capture user extension methods. |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | ------------------------------------------------------------------------ |
---|
12 | |
---|
13 | Copyright 2002, 2016 Chris Johns <chrisj@rtems.org>. |
---|
14 | All rights reserved. |
---|
15 | |
---|
16 | COPYRIGHT (c) 1989-2014. |
---|
17 | On-Line Applications Research Corporation (OAR). |
---|
18 | |
---|
19 | The license and distribution terms for this file may be |
---|
20 | found in the file LICENSE in this distribution. |
---|
21 | |
---|
22 | This software with is provided ``as is'' and with NO WARRANTY. |
---|
23 | |
---|
24 | ------------------------------------------------------------------------ |
---|
25 | |
---|
26 | RTEMS Performance Monitoring and Measurement Framework. |
---|
27 | This is the Capture Engine component. |
---|
28 | |
---|
29 | */ |
---|
30 | |
---|
31 | #ifndef __CAPTUREIMPL_H_ |
---|
32 | #define __CAPTUREIMPL_H_ |
---|
33 | |
---|
34 | #include "capture.h" |
---|
35 | |
---|
36 | /**@{*/ |
---|
37 | #ifdef __cplusplus |
---|
38 | extern "C" { |
---|
39 | #endif |
---|
40 | |
---|
41 | /** |
---|
42 | * @brief Capture set extension index. |
---|
43 | * |
---|
44 | * This function is used to set the extension index |
---|
45 | * for the capture engine. |
---|
46 | * |
---|
47 | * @param[in] index specifies the extension index to be |
---|
48 | * used for capture engine data. |
---|
49 | */ |
---|
50 | void rtems_capture_set_extension_index(int index); |
---|
51 | |
---|
52 | /** |
---|
53 | * @brief Capture get extension index. |
---|
54 | * |
---|
55 | * This function rturns the extension index for the |
---|
56 | * capture engine. |
---|
57 | * |
---|
58 | * @retval This method returns the extension index. |
---|
59 | */ |
---|
60 | int rtems_capture_get_extension_index(void); |
---|
61 | |
---|
62 | /** |
---|
63 | * @brief Capture get flags. |
---|
64 | * |
---|
65 | * This function gets the current flag settings |
---|
66 | * for the capture engine. |
---|
67 | * |
---|
68 | * @retval This method returns the global capture |
---|
69 | * flags. |
---|
70 | * |
---|
71 | */ |
---|
72 | uint32_t rtems_capture_get_flags(void); |
---|
73 | |
---|
74 | /** |
---|
75 | * @brief Capture set flags. |
---|
76 | * |
---|
77 | * This function sets a flag in the capture engine |
---|
78 | * |
---|
79 | * @param[in] mask specifies the flag to set |
---|
80 | */ |
---|
81 | void rtems_capture_set_flags(uint32_t mask); |
---|
82 | |
---|
83 | /** |
---|
84 | * @brief Capture user extension open. |
---|
85 | * |
---|
86 | * This function creates the capture user extensions. |
---|
87 | * |
---|
88 | * |
---|
89 | * @retval This method returns RTEMS_SUCCESSFUL upon successful |
---|
90 | * creation of the user extensions. |
---|
91 | */ |
---|
92 | rtems_status_code rtems_capture_user_extension_open(void); |
---|
93 | |
---|
94 | /** |
---|
95 | * @brief Capture user extension close. |
---|
96 | * |
---|
97 | * This function closes the capture user extensions. |
---|
98 | * |
---|
99 | * @retval This method returns RTEMS_SUCCESSFUL upon a successful |
---|
100 | * delete of the user extensions. |
---|
101 | */ |
---|
102 | rtems_status_code rtems_capture_user_extension_close(void); |
---|
103 | |
---|
104 | /** |
---|
105 | * @brief Capture check trigger. |
---|
106 | * |
---|
107 | * This function checks if we have triggered or if this event is a |
---|
108 | * cause of a trigger. |
---|
109 | * |
---|
110 | * @param[in] ft specifies specifices the capture from task |
---|
111 | * @param[in] tt specifies specifices the capture to task |
---|
112 | * @param[in] events specifies the events |
---|
113 | * |
---|
114 | * @retval This method returns true if we have triggered or |
---|
115 | * if the event is a cause of a trigger. |
---|
116 | */ |
---|
117 | bool rtems_capture_trigger_fired (rtems_tcb* ft, |
---|
118 | rtems_tcb* tt, |
---|
119 | uint32_t events); |
---|
120 | |
---|
121 | /** |
---|
122 | * @brief Capture print trace records. |
---|
123 | * |
---|
124 | * This function reads, prints and releases up to |
---|
125 | * total trace records in either a csv format or an |
---|
126 | * ascii table format. |
---|
127 | * |
---|
128 | * @param[in] total specifies the number of records to print |
---|
129 | * @param[in] csv specifies a comma seperated value format |
---|
130 | */ |
---|
131 | void rtems_capture_print_trace_records ( int total, bool csv ); |
---|
132 | |
---|
133 | /** |
---|
134 | * @brief Capture print timestamp. |
---|
135 | * |
---|
136 | * This function prints uptime in a timestamp format. |
---|
137 | * |
---|
138 | * @param[in] uptime specifies the timestamp to print |
---|
139 | */ |
---|
140 | void rtems_capture_print_timestamp (uint64_t uptime); |
---|
141 | |
---|
142 | /** |
---|
143 | * @brief Capture print record task. |
---|
144 | * |
---|
145 | * This function prints a capture record task. This |
---|
146 | * record contains information to identify a task. It |
---|
147 | * is refrenced in other records by the task id. |
---|
148 | * |
---|
149 | * @param[in] cpu specifies the cpu the cpu the record was logged on. |
---|
150 | * @param[in] rec specifies the task record. |
---|
151 | */ |
---|
152 | void rtems_capture_print_record_task(int cpu, |
---|
153 | const rtems_capture_record* rec, |
---|
154 | const rtems_capture_task_record* task_rec); |
---|
155 | |
---|
156 | /** |
---|
157 | * @brief Capture print capture record. |
---|
158 | * |
---|
159 | * This function prints a user extension |
---|
160 | * capture record. |
---|
161 | * |
---|
162 | * @param[in] cpu specifies the cpu the cpu the record was logged on. |
---|
163 | * @param[in] rec specifies the record. |
---|
164 | * @param[in] diff specifies the time between this and the last capture record. |
---|
165 | * @param[in] name specifies the name of the task, NULL if none. |
---|
166 | * @param[in] task_count number of tasks to search for. |
---|
167 | */ |
---|
168 | void rtems_capture_print_record_capture(int cpu, |
---|
169 | const rtems_capture_record* rec, |
---|
170 | uint64_t diff, |
---|
171 | const rtems_name* name); |
---|
172 | |
---|
173 | /** |
---|
174 | * @brief Capture print watch list |
---|
175 | * |
---|
176 | * This function prints a capture watch list |
---|
177 | */ |
---|
178 | void rtems_capture_print_watch_list (void); |
---|
179 | |
---|
180 | #ifdef __cplusplus |
---|
181 | } |
---|
182 | #endif |
---|
183 | /**@}*/ |
---|
184 | |
---|
185 | #endif |
---|