utdebug.c revision 1.17 1 1.1 jruoho /******************************************************************************
2 1.1 jruoho *
3 1.5 christos * Module Name: utdebug - Debug print/trace routines
4 1.1 jruoho *
5 1.1 jruoho *****************************************************************************/
6 1.1 jruoho
7 1.3 jruoho /*
8 1.16 christos * Copyright (C) 2000 - 2019, Intel Corp.
9 1.1 jruoho * All rights reserved.
10 1.1 jruoho *
11 1.3 jruoho * Redistribution and use in source and binary forms, with or without
12 1.3 jruoho * modification, are permitted provided that the following conditions
13 1.3 jruoho * are met:
14 1.3 jruoho * 1. Redistributions of source code must retain the above copyright
15 1.3 jruoho * notice, this list of conditions, and the following disclaimer,
16 1.3 jruoho * without modification.
17 1.3 jruoho * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.3 jruoho * substantially similar to the "NO WARRANTY" disclaimer below
19 1.3 jruoho * ("Disclaimer") and any redistribution must be conditioned upon
20 1.3 jruoho * including a substantially similar Disclaimer requirement for further
21 1.3 jruoho * binary redistribution.
22 1.3 jruoho * 3. Neither the names of the above-listed copyright holders nor the names
23 1.3 jruoho * of any contributors may be used to endorse or promote products derived
24 1.3 jruoho * from this software without specific prior written permission.
25 1.3 jruoho *
26 1.3 jruoho * Alternatively, this software may be distributed under the terms of the
27 1.3 jruoho * GNU General Public License ("GPL") version 2 as published by the Free
28 1.3 jruoho * Software Foundation.
29 1.3 jruoho *
30 1.3 jruoho * NO WARRANTY
31 1.3 jruoho * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.3 jruoho * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.3 jruoho * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.3 jruoho * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.3 jruoho * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.3 jruoho * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.3 jruoho * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.3 jruoho * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.3 jruoho * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.3 jruoho * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.3 jruoho * POSSIBILITY OF SUCH DAMAGES.
42 1.3 jruoho */
43 1.1 jruoho
44 1.5 christos #define EXPORT_ACPI_INTERFACES
45 1.1 jruoho
46 1.1 jruoho #include "acpi.h"
47 1.1 jruoho #include "accommon.h"
48 1.8 christos #include "acinterp.h"
49 1.1 jruoho
50 1.1 jruoho #define _COMPONENT ACPI_UTILITIES
51 1.1 jruoho ACPI_MODULE_NAME ("utdebug")
52 1.1 jruoho
53 1.1 jruoho
54 1.1 jruoho #ifdef ACPI_DEBUG_OUTPUT
55 1.1 jruoho
56 1.10 christos static ACPI_THREAD_ID AcpiGbl_PreviousThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF;
57 1.10 christos static const char *AcpiGbl_FunctionEntryPrefix = "----Entry";
58 1.10 christos static const char *AcpiGbl_FunctionExitPrefix = "----Exit-";
59 1.1 jruoho
60 1.1 jruoho
61 1.1 jruoho /*******************************************************************************
62 1.1 jruoho *
63 1.1 jruoho * FUNCTION: AcpiUtInitStackPtrTrace
64 1.1 jruoho *
65 1.1 jruoho * PARAMETERS: None
66 1.1 jruoho *
67 1.1 jruoho * RETURN: None
68 1.1 jruoho *
69 1.1 jruoho * DESCRIPTION: Save the current CPU stack pointer at subsystem startup
70 1.1 jruoho *
71 1.1 jruoho ******************************************************************************/
72 1.1 jruoho
73 1.1 jruoho void
74 1.1 jruoho AcpiUtInitStackPtrTrace (
75 1.1 jruoho void)
76 1.1 jruoho {
77 1.1 jruoho ACPI_SIZE CurrentSp;
78 1.1 jruoho
79 1.1 jruoho
80 1.1 jruoho AcpiGbl_EntryStackPointer = &CurrentSp;
81 1.1 jruoho }
82 1.1 jruoho
83 1.1 jruoho
84 1.1 jruoho /*******************************************************************************
85 1.1 jruoho *
86 1.1 jruoho * FUNCTION: AcpiUtTrackStackPtr
87 1.1 jruoho *
88 1.1 jruoho * PARAMETERS: None
89 1.1 jruoho *
90 1.1 jruoho * RETURN: None
91 1.1 jruoho *
92 1.1 jruoho * DESCRIPTION: Save the current CPU stack pointer
93 1.1 jruoho *
94 1.1 jruoho ******************************************************************************/
95 1.1 jruoho
96 1.1 jruoho void
97 1.1 jruoho AcpiUtTrackStackPtr (
98 1.1 jruoho void)
99 1.1 jruoho {
100 1.1 jruoho ACPI_SIZE CurrentSp;
101 1.1 jruoho
102 1.1 jruoho
103 1.1 jruoho if (&CurrentSp < AcpiGbl_LowestStackPointer)
104 1.1 jruoho {
105 1.1 jruoho AcpiGbl_LowestStackPointer = &CurrentSp;
106 1.1 jruoho }
107 1.1 jruoho
108 1.1 jruoho if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting)
109 1.1 jruoho {
110 1.1 jruoho AcpiGbl_DeepestNesting = AcpiGbl_NestingLevel;
111 1.1 jruoho }
112 1.1 jruoho }
113 1.1 jruoho
114 1.1 jruoho
115 1.1 jruoho /*******************************************************************************
116 1.1 jruoho *
117 1.1 jruoho * FUNCTION: AcpiUtTrimFunctionName
118 1.1 jruoho *
119 1.1 jruoho * PARAMETERS: FunctionName - Ascii string containing a procedure name
120 1.1 jruoho *
121 1.1 jruoho * RETURN: Updated pointer to the function name
122 1.1 jruoho *
123 1.1 jruoho * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
124 1.1 jruoho * This allows compiler macros such as __FUNCTION__ to be used
125 1.1 jruoho * with no change to the debug output.
126 1.1 jruoho *
127 1.1 jruoho ******************************************************************************/
128 1.1 jruoho
129 1.1 jruoho static const char *
130 1.1 jruoho AcpiUtTrimFunctionName (
131 1.1 jruoho const char *FunctionName)
132 1.1 jruoho {
133 1.1 jruoho
134 1.1 jruoho /* All Function names are longer than 4 chars, check is safe */
135 1.1 jruoho
136 1.1 jruoho if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_MIXED)
137 1.1 jruoho {
138 1.1 jruoho /* This is the case where the original source has not been modified */
139 1.1 jruoho
140 1.1 jruoho return (FunctionName + 4);
141 1.1 jruoho }
142 1.1 jruoho
143 1.1 jruoho if (*(ACPI_CAST_PTR (UINT32, FunctionName)) == ACPI_PREFIX_LOWER)
144 1.1 jruoho {
145 1.1 jruoho /* This is the case where the source has been 'linuxized' */
146 1.1 jruoho
147 1.1 jruoho return (FunctionName + 5);
148 1.1 jruoho }
149 1.1 jruoho
150 1.1 jruoho return (FunctionName);
151 1.1 jruoho }
152 1.1 jruoho
153 1.1 jruoho
154 1.1 jruoho /*******************************************************************************
155 1.1 jruoho *
156 1.1 jruoho * FUNCTION: AcpiDebugPrint
157 1.1 jruoho *
158 1.1 jruoho * PARAMETERS: RequestedDebugLevel - Requested debug print level
159 1.1 jruoho * LineNumber - Caller's line number (for error output)
160 1.1 jruoho * FunctionName - Caller's procedure name
161 1.1 jruoho * ModuleName - Caller's module name
162 1.1 jruoho * ComponentId - Caller's component ID
163 1.1 jruoho * Format - Printf format field
164 1.1 jruoho * ... - Optional printf arguments
165 1.1 jruoho *
166 1.1 jruoho * RETURN: None
167 1.1 jruoho *
168 1.1 jruoho * DESCRIPTION: Print error message with prefix consisting of the module name,
169 1.1 jruoho * line number, and component ID.
170 1.1 jruoho *
171 1.1 jruoho ******************************************************************************/
172 1.1 jruoho
173 1.1 jruoho void ACPI_INTERNAL_VAR_XFACE
174 1.1 jruoho AcpiDebugPrint (
175 1.1 jruoho UINT32 RequestedDebugLevel,
176 1.1 jruoho UINT32 LineNumber,
177 1.1 jruoho const char *FunctionName,
178 1.1 jruoho const char *ModuleName,
179 1.1 jruoho UINT32 ComponentId,
180 1.1 jruoho const char *Format,
181 1.1 jruoho ...)
182 1.1 jruoho {
183 1.1 jruoho ACPI_THREAD_ID ThreadId;
184 1.1 jruoho va_list args;
185 1.15 christos #ifdef ACPI_APPLICATION
186 1.15 christos int FillCount;
187 1.15 christos #endif
188 1.1 jruoho
189 1.5 christos /* Check if debug output enabled */
190 1.5 christos
191 1.5 christos if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId))
192 1.1 jruoho {
193 1.1 jruoho return;
194 1.1 jruoho }
195 1.1 jruoho
196 1.1 jruoho /*
197 1.1 jruoho * Thread tracking and context switch notification
198 1.1 jruoho */
199 1.1 jruoho ThreadId = AcpiOsGetThreadId ();
200 1.10 christos if (ThreadId != AcpiGbl_PreviousThreadId)
201 1.1 jruoho {
202 1.1 jruoho if (ACPI_LV_THREADS & AcpiDbgLevel)
203 1.1 jruoho {
204 1.1 jruoho AcpiOsPrintf (
205 1.3 jruoho "\n**** Context Switch from TID %u to TID %u ****\n\n",
206 1.10 christos (UINT32) AcpiGbl_PreviousThreadId, (UINT32) ThreadId);
207 1.1 jruoho }
208 1.1 jruoho
209 1.10 christos AcpiGbl_PreviousThreadId = ThreadId;
210 1.5 christos AcpiGbl_NestingLevel = 0;
211 1.1 jruoho }
212 1.1 jruoho
213 1.1 jruoho /*
214 1.1 jruoho * Display the module name, current line number, thread ID (if requested),
215 1.1 jruoho * current procedure nesting level, and the current procedure name
216 1.1 jruoho */
217 1.17 christos AcpiOsPrintf ("%9s-%04d ", ModuleName, LineNumber);
218 1.1 jruoho
219 1.5 christos #ifdef ACPI_APPLICATION
220 1.5 christos /*
221 1.5 christos * For AcpiExec/iASL only, emit the thread ID and nesting level.
222 1.5 christos * Note: nesting level is really only useful during a single-thread
223 1.5 christos * execution. Otherwise, multiple threads will keep resetting the
224 1.5 christos * level.
225 1.5 christos */
226 1.1 jruoho if (ACPI_LV_THREADS & AcpiDbgLevel)
227 1.1 jruoho {
228 1.3 jruoho AcpiOsPrintf ("[%u] ", (UINT32) ThreadId);
229 1.1 jruoho }
230 1.1 jruoho
231 1.15 christos FillCount = 48 - AcpiGbl_NestingLevel -
232 1.15 christos strlen (AcpiUtTrimFunctionName (FunctionName));
233 1.15 christos if (FillCount < 0)
234 1.15 christos {
235 1.15 christos FillCount = 0;
236 1.15 christos }
237 1.15 christos
238 1.17 christos AcpiOsPrintf ("[%02d] %*s",
239 1.15 christos AcpiGbl_NestingLevel, AcpiGbl_NestingLevel + 1, " ");
240 1.15 christos AcpiOsPrintf ("%s%*s: ",
241 1.15 christos AcpiUtTrimFunctionName (FunctionName), FillCount, " ");
242 1.5 christos
243 1.15 christos #else
244 1.5 christos AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName));
245 1.15 christos #endif
246 1.1 jruoho
247 1.1 jruoho va_start (args, Format);
248 1.1 jruoho AcpiOsVprintf (Format, args);
249 1.1 jruoho va_end (args);
250 1.1 jruoho }
251 1.1 jruoho
252 1.1 jruoho ACPI_EXPORT_SYMBOL (AcpiDebugPrint)
253 1.1 jruoho
254 1.1 jruoho
255 1.1 jruoho /*******************************************************************************
256 1.1 jruoho *
257 1.1 jruoho * FUNCTION: AcpiDebugPrintRaw
258 1.1 jruoho *
259 1.1 jruoho * PARAMETERS: RequestedDebugLevel - Requested debug print level
260 1.1 jruoho * LineNumber - Caller's line number
261 1.1 jruoho * FunctionName - Caller's procedure name
262 1.1 jruoho * ModuleName - Caller's module name
263 1.1 jruoho * ComponentId - Caller's component ID
264 1.1 jruoho * Format - Printf format field
265 1.1 jruoho * ... - Optional printf arguments
266 1.1 jruoho *
267 1.1 jruoho * RETURN: None
268 1.1 jruoho *
269 1.5 christos * DESCRIPTION: Print message with no headers. Has same interface as
270 1.1 jruoho * DebugPrint so that the same macros can be used.
271 1.1 jruoho *
272 1.1 jruoho ******************************************************************************/
273 1.1 jruoho
274 1.1 jruoho void ACPI_INTERNAL_VAR_XFACE
275 1.1 jruoho AcpiDebugPrintRaw (
276 1.1 jruoho UINT32 RequestedDebugLevel,
277 1.1 jruoho UINT32 LineNumber,
278 1.1 jruoho const char *FunctionName,
279 1.1 jruoho const char *ModuleName,
280 1.1 jruoho UINT32 ComponentId,
281 1.1 jruoho const char *Format,
282 1.1 jruoho ...)
283 1.1 jruoho {
284 1.1 jruoho va_list args;
285 1.1 jruoho
286 1.1 jruoho
287 1.5 christos /* Check if debug output enabled */
288 1.5 christos
289 1.5 christos if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId))
290 1.1 jruoho {
291 1.1 jruoho return;
292 1.1 jruoho }
293 1.1 jruoho
294 1.1 jruoho va_start (args, Format);
295 1.1 jruoho AcpiOsVprintf (Format, args);
296 1.1 jruoho va_end (args);
297 1.1 jruoho }
298 1.1 jruoho
299 1.1 jruoho ACPI_EXPORT_SYMBOL (AcpiDebugPrintRaw)
300 1.1 jruoho
301 1.1 jruoho
302 1.1 jruoho /*******************************************************************************
303 1.1 jruoho *
304 1.1 jruoho * FUNCTION: AcpiUtTrace
305 1.1 jruoho *
306 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
307 1.1 jruoho * FunctionName - Caller's procedure name
308 1.1 jruoho * ModuleName - Caller's module name
309 1.1 jruoho * ComponentId - Caller's component ID
310 1.1 jruoho *
311 1.1 jruoho * RETURN: None
312 1.1 jruoho *
313 1.5 christos * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
314 1.1 jruoho * set in DebugLevel
315 1.1 jruoho *
316 1.1 jruoho ******************************************************************************/
317 1.1 jruoho
318 1.1 jruoho void
319 1.1 jruoho AcpiUtTrace (
320 1.1 jruoho UINT32 LineNumber,
321 1.1 jruoho const char *FunctionName,
322 1.1 jruoho const char *ModuleName,
323 1.1 jruoho UINT32 ComponentId)
324 1.1 jruoho {
325 1.1 jruoho
326 1.1 jruoho AcpiGbl_NestingLevel++;
327 1.1 jruoho AcpiUtTrackStackPtr ();
328 1.1 jruoho
329 1.5 christos /* Check if enabled up-front for performance */
330 1.5 christos
331 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
332 1.5 christos {
333 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
334 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
335 1.10 christos "%s\n", AcpiGbl_FunctionEntryPrefix);
336 1.5 christos }
337 1.1 jruoho }
338 1.1 jruoho
339 1.1 jruoho ACPI_EXPORT_SYMBOL (AcpiUtTrace)
340 1.1 jruoho
341 1.1 jruoho
342 1.1 jruoho /*******************************************************************************
343 1.1 jruoho *
344 1.1 jruoho * FUNCTION: AcpiUtTracePtr
345 1.1 jruoho *
346 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
347 1.1 jruoho * FunctionName - Caller's procedure name
348 1.1 jruoho * ModuleName - Caller's module name
349 1.1 jruoho * ComponentId - Caller's component ID
350 1.1 jruoho * Pointer - Pointer to display
351 1.1 jruoho *
352 1.1 jruoho * RETURN: None
353 1.1 jruoho *
354 1.5 christos * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
355 1.1 jruoho * set in DebugLevel
356 1.1 jruoho *
357 1.1 jruoho ******************************************************************************/
358 1.1 jruoho
359 1.1 jruoho void
360 1.1 jruoho AcpiUtTracePtr (
361 1.1 jruoho UINT32 LineNumber,
362 1.1 jruoho const char *FunctionName,
363 1.1 jruoho const char *ModuleName,
364 1.1 jruoho UINT32 ComponentId,
365 1.10 christos const void *Pointer)
366 1.1 jruoho {
367 1.5 christos
368 1.1 jruoho AcpiGbl_NestingLevel++;
369 1.1 jruoho AcpiUtTrackStackPtr ();
370 1.1 jruoho
371 1.5 christos /* Check if enabled up-front for performance */
372 1.5 christos
373 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
374 1.5 christos {
375 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
376 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
377 1.10 christos "%s %p\n", AcpiGbl_FunctionEntryPrefix, Pointer);
378 1.5 christos }
379 1.1 jruoho }
380 1.1 jruoho
381 1.1 jruoho
382 1.1 jruoho /*******************************************************************************
383 1.1 jruoho *
384 1.1 jruoho * FUNCTION: AcpiUtTraceStr
385 1.1 jruoho *
386 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
387 1.1 jruoho * FunctionName - Caller's procedure name
388 1.1 jruoho * ModuleName - Caller's module name
389 1.1 jruoho * ComponentId - Caller's component ID
390 1.1 jruoho * String - Additional string to display
391 1.1 jruoho *
392 1.1 jruoho * RETURN: None
393 1.1 jruoho *
394 1.5 christos * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
395 1.1 jruoho * set in DebugLevel
396 1.1 jruoho *
397 1.1 jruoho ******************************************************************************/
398 1.1 jruoho
399 1.1 jruoho void
400 1.1 jruoho AcpiUtTraceStr (
401 1.1 jruoho UINT32 LineNumber,
402 1.1 jruoho const char *FunctionName,
403 1.1 jruoho const char *ModuleName,
404 1.1 jruoho UINT32 ComponentId,
405 1.4 jruoho const char *String)
406 1.1 jruoho {
407 1.1 jruoho
408 1.1 jruoho AcpiGbl_NestingLevel++;
409 1.1 jruoho AcpiUtTrackStackPtr ();
410 1.1 jruoho
411 1.5 christos /* Check if enabled up-front for performance */
412 1.5 christos
413 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
414 1.5 christos {
415 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
416 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
417 1.10 christos "%s %s\n", AcpiGbl_FunctionEntryPrefix, String);
418 1.5 christos }
419 1.1 jruoho }
420 1.1 jruoho
421 1.1 jruoho
422 1.1 jruoho /*******************************************************************************
423 1.1 jruoho *
424 1.1 jruoho * FUNCTION: AcpiUtTraceU32
425 1.1 jruoho *
426 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
427 1.1 jruoho * FunctionName - Caller's procedure name
428 1.1 jruoho * ModuleName - Caller's module name
429 1.1 jruoho * ComponentId - Caller's component ID
430 1.1 jruoho * Integer - Integer to display
431 1.1 jruoho *
432 1.1 jruoho * RETURN: None
433 1.1 jruoho *
434 1.5 christos * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
435 1.1 jruoho * set in DebugLevel
436 1.1 jruoho *
437 1.1 jruoho ******************************************************************************/
438 1.1 jruoho
439 1.1 jruoho void
440 1.1 jruoho AcpiUtTraceU32 (
441 1.1 jruoho UINT32 LineNumber,
442 1.1 jruoho const char *FunctionName,
443 1.1 jruoho const char *ModuleName,
444 1.1 jruoho UINT32 ComponentId,
445 1.1 jruoho UINT32 Integer)
446 1.1 jruoho {
447 1.1 jruoho
448 1.1 jruoho AcpiGbl_NestingLevel++;
449 1.1 jruoho AcpiUtTrackStackPtr ();
450 1.1 jruoho
451 1.5 christos /* Check if enabled up-front for performance */
452 1.5 christos
453 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
454 1.5 christos {
455 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
456 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
457 1.10 christos "%s %08X\n", AcpiGbl_FunctionEntryPrefix, Integer);
458 1.5 christos }
459 1.1 jruoho }
460 1.1 jruoho
461 1.1 jruoho
462 1.1 jruoho /*******************************************************************************
463 1.1 jruoho *
464 1.1 jruoho * FUNCTION: AcpiUtExit
465 1.1 jruoho *
466 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
467 1.1 jruoho * FunctionName - Caller's procedure name
468 1.1 jruoho * ModuleName - Caller's module name
469 1.1 jruoho * ComponentId - Caller's component ID
470 1.1 jruoho *
471 1.1 jruoho * RETURN: None
472 1.1 jruoho *
473 1.5 christos * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
474 1.1 jruoho * set in DebugLevel
475 1.1 jruoho *
476 1.1 jruoho ******************************************************************************/
477 1.1 jruoho
478 1.1 jruoho void
479 1.1 jruoho AcpiUtExit (
480 1.1 jruoho UINT32 LineNumber,
481 1.1 jruoho const char *FunctionName,
482 1.1 jruoho const char *ModuleName,
483 1.1 jruoho UINT32 ComponentId)
484 1.1 jruoho {
485 1.1 jruoho
486 1.5 christos /* Check if enabled up-front for performance */
487 1.5 christos
488 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
489 1.5 christos {
490 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
491 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
492 1.10 christos "%s\n", AcpiGbl_FunctionExitPrefix);
493 1.5 christos }
494 1.1 jruoho
495 1.5 christos if (AcpiGbl_NestingLevel)
496 1.5 christos {
497 1.5 christos AcpiGbl_NestingLevel--;
498 1.5 christos }
499 1.1 jruoho }
500 1.1 jruoho
501 1.1 jruoho ACPI_EXPORT_SYMBOL (AcpiUtExit)
502 1.1 jruoho
503 1.1 jruoho
504 1.1 jruoho /*******************************************************************************
505 1.1 jruoho *
506 1.1 jruoho * FUNCTION: AcpiUtStatusExit
507 1.1 jruoho *
508 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
509 1.1 jruoho * FunctionName - Caller's procedure name
510 1.1 jruoho * ModuleName - Caller's module name
511 1.1 jruoho * ComponentId - Caller's component ID
512 1.1 jruoho * Status - Exit status code
513 1.1 jruoho *
514 1.1 jruoho * RETURN: None
515 1.1 jruoho *
516 1.5 christos * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
517 1.5 christos * set in DebugLevel. Prints exit status also.
518 1.1 jruoho *
519 1.1 jruoho ******************************************************************************/
520 1.1 jruoho
521 1.1 jruoho void
522 1.1 jruoho AcpiUtStatusExit (
523 1.1 jruoho UINT32 LineNumber,
524 1.1 jruoho const char *FunctionName,
525 1.1 jruoho const char *ModuleName,
526 1.1 jruoho UINT32 ComponentId,
527 1.1 jruoho ACPI_STATUS Status)
528 1.1 jruoho {
529 1.1 jruoho
530 1.5 christos /* Check if enabled up-front for performance */
531 1.5 christos
532 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
533 1.1 jruoho {
534 1.5 christos if (ACPI_SUCCESS (Status))
535 1.5 christos {
536 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
537 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
538 1.10 christos "%s %s\n", AcpiGbl_FunctionExitPrefix,
539 1.5 christos AcpiFormatException (Status));
540 1.5 christos }
541 1.5 christos else
542 1.5 christos {
543 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
544 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
545 1.10 christos "%s ****Exception****: %s\n", AcpiGbl_FunctionExitPrefix,
546 1.5 christos AcpiFormatException (Status));
547 1.5 christos }
548 1.1 jruoho }
549 1.5 christos
550 1.5 christos if (AcpiGbl_NestingLevel)
551 1.1 jruoho {
552 1.5 christos AcpiGbl_NestingLevel--;
553 1.1 jruoho }
554 1.1 jruoho }
555 1.1 jruoho
556 1.1 jruoho ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
557 1.1 jruoho
558 1.1 jruoho
559 1.1 jruoho /*******************************************************************************
560 1.1 jruoho *
561 1.1 jruoho * FUNCTION: AcpiUtValueExit
562 1.1 jruoho *
563 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
564 1.1 jruoho * FunctionName - Caller's procedure name
565 1.1 jruoho * ModuleName - Caller's module name
566 1.1 jruoho * ComponentId - Caller's component ID
567 1.1 jruoho * Value - Value to be printed with exit msg
568 1.1 jruoho *
569 1.1 jruoho * RETURN: None
570 1.1 jruoho *
571 1.5 christos * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
572 1.5 christos * set in DebugLevel. Prints exit value also.
573 1.1 jruoho *
574 1.1 jruoho ******************************************************************************/
575 1.1 jruoho
576 1.1 jruoho void
577 1.1 jruoho AcpiUtValueExit (
578 1.1 jruoho UINT32 LineNumber,
579 1.1 jruoho const char *FunctionName,
580 1.1 jruoho const char *ModuleName,
581 1.1 jruoho UINT32 ComponentId,
582 1.1 jruoho UINT64 Value)
583 1.1 jruoho {
584 1.1 jruoho
585 1.5 christos /* Check if enabled up-front for performance */
586 1.5 christos
587 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
588 1.5 christos {
589 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
590 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
591 1.10 christos "%s %8.8X%8.8X\n", AcpiGbl_FunctionExitPrefix,
592 1.5 christos ACPI_FORMAT_UINT64 (Value));
593 1.5 christos }
594 1.1 jruoho
595 1.5 christos if (AcpiGbl_NestingLevel)
596 1.5 christos {
597 1.5 christos AcpiGbl_NestingLevel--;
598 1.5 christos }
599 1.1 jruoho }
600 1.1 jruoho
601 1.1 jruoho ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
602 1.1 jruoho
603 1.1 jruoho
604 1.1 jruoho /*******************************************************************************
605 1.1 jruoho *
606 1.1 jruoho * FUNCTION: AcpiUtPtrExit
607 1.1 jruoho *
608 1.1 jruoho * PARAMETERS: LineNumber - Caller's line number
609 1.1 jruoho * FunctionName - Caller's procedure name
610 1.1 jruoho * ModuleName - Caller's module name
611 1.1 jruoho * ComponentId - Caller's component ID
612 1.1 jruoho * Ptr - Pointer to display
613 1.1 jruoho *
614 1.1 jruoho * RETURN: None
615 1.1 jruoho *
616 1.5 christos * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
617 1.5 christos * set in DebugLevel. Prints exit value also.
618 1.1 jruoho *
619 1.1 jruoho ******************************************************************************/
620 1.1 jruoho
621 1.1 jruoho void
622 1.1 jruoho AcpiUtPtrExit (
623 1.1 jruoho UINT32 LineNumber,
624 1.1 jruoho const char *FunctionName,
625 1.1 jruoho const char *ModuleName,
626 1.1 jruoho UINT32 ComponentId,
627 1.1 jruoho UINT8 *Ptr)
628 1.1 jruoho {
629 1.1 jruoho
630 1.5 christos /* Check if enabled up-front for performance */
631 1.1 jruoho
632 1.5 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
633 1.1 jruoho {
634 1.5 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
635 1.5 christos LineNumber, FunctionName, ModuleName, ComponentId,
636 1.10 christos "%s %p\n", AcpiGbl_FunctionExitPrefix, Ptr);
637 1.1 jruoho }
638 1.1 jruoho
639 1.5 christos if (AcpiGbl_NestingLevel)
640 1.1 jruoho {
641 1.5 christos AcpiGbl_NestingLevel--;
642 1.1 jruoho }
643 1.1 jruoho }
644 1.1 jruoho
645 1.8 christos
646 1.8 christos /*******************************************************************************
647 1.8 christos *
648 1.11 christos * FUNCTION: AcpiUtStrExit
649 1.11 christos *
650 1.11 christos * PARAMETERS: LineNumber - Caller's line number
651 1.11 christos * FunctionName - Caller's procedure name
652 1.11 christos * ModuleName - Caller's module name
653 1.11 christos * ComponentId - Caller's component ID
654 1.11 christos * String - String to display
655 1.11 christos *
656 1.11 christos * RETURN: None
657 1.11 christos *
658 1.11 christos * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
659 1.11 christos * set in DebugLevel. Prints exit value also.
660 1.11 christos *
661 1.11 christos ******************************************************************************/
662 1.11 christos
663 1.11 christos void
664 1.11 christos AcpiUtStrExit (
665 1.11 christos UINT32 LineNumber,
666 1.11 christos const char *FunctionName,
667 1.11 christos const char *ModuleName,
668 1.11 christos UINT32 ComponentId,
669 1.11 christos const char *String)
670 1.11 christos {
671 1.11 christos
672 1.11 christos /* Check if enabled up-front for performance */
673 1.11 christos
674 1.11 christos if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
675 1.11 christos {
676 1.11 christos AcpiDebugPrint (ACPI_LV_FUNCTIONS,
677 1.11 christos LineNumber, FunctionName, ModuleName, ComponentId,
678 1.11 christos "%s %s\n", AcpiGbl_FunctionExitPrefix, String);
679 1.11 christos }
680 1.11 christos
681 1.11 christos if (AcpiGbl_NestingLevel)
682 1.11 christos {
683 1.11 christos AcpiGbl_NestingLevel--;
684 1.11 christos }
685 1.11 christos }
686 1.11 christos
687 1.11 christos
688 1.11 christos /*******************************************************************************
689 1.11 christos *
690 1.8 christos * FUNCTION: AcpiTracePoint
691 1.8 christos *
692 1.8 christos * PARAMETERS: Type - Trace event type
693 1.8 christos * Begin - TRUE if before execution
694 1.8 christos * Aml - Executed AML address
695 1.8 christos * Pathname - Object path
696 1.8 christos * Pointer - Pointer to the related object
697 1.8 christos *
698 1.8 christos * RETURN: None
699 1.8 christos *
700 1.8 christos * DESCRIPTION: Interpreter execution trace.
701 1.8 christos *
702 1.8 christos ******************************************************************************/
703 1.8 christos
704 1.8 christos void
705 1.8 christos AcpiTracePoint (
706 1.8 christos ACPI_TRACE_EVENT_TYPE Type,
707 1.8 christos BOOLEAN Begin,
708 1.8 christos UINT8 *Aml,
709 1.8 christos char *Pathname)
710 1.8 christos {
711 1.8 christos
712 1.8 christos ACPI_FUNCTION_ENTRY ();
713 1.8 christos
714 1.8 christos AcpiExTracePoint (Type, Begin, Aml, Pathname);
715 1.8 christos
716 1.8 christos #ifdef ACPI_USE_SYSTEM_TRACER
717 1.8 christos AcpiOsTracePoint (Type, Begin, Aml, Pathname);
718 1.8 christos #endif
719 1.8 christos }
720 1.8 christos
721 1.8 christos ACPI_EXPORT_SYMBOL (AcpiTracePoint)
722 1.8 christos
723 1.14 christos
724 1.5 christos #endif
725