ReactOS 0.4.15-dev-5664-g3bf4ef6
extrace.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "acinterp.h"
Include dependency graph for extrace.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_EXECUTER
 

Functions

static BOOLEAN AcpiExInterpreterTraceEnabled (char *Name)
 
void AcpiExTracePoint (ACPI_TRACE_EVENT_TYPE Type, BOOLEAN Begin, UINT8 *Aml, char *Pathname)
 
void AcpiExStartTraceMethod (ACPI_NAMESPACE_NODE *MethodNode, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState)
 
void AcpiExStopTraceMethod (ACPI_NAMESPACE_NODE *MethodNode, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState)
 
void AcpiExStartTraceOpcode (ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState)
 
void AcpiExStopTraceOpcode (ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState)
 

Variables

static ACPI_OPERAND_OBJECTAcpiGbl_TraceMethodObject = NULL
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_EXECUTER

Definition at line 50 of file extrace.c.

Function Documentation

◆ AcpiExInterpreterTraceEnabled()

static BOOLEAN AcpiExInterpreterTraceEnabled ( char Name)
static

Definition at line 80 of file extrace.c.

82{
83
84 /* Check if tracing is enabled */
85
86 if (!(AcpiGbl_TraceFlags & ACPI_TRACE_ENABLED))
87 {
88 return (FALSE);
89 }
90
91 /*
92 * Check if tracing is filtered:
93 *
94 * 1. If the tracer is started, AcpiGbl_TraceMethodObject should have
95 * been filled by the trace starter
96 * 2. If the tracer is not started, AcpiGbl_TraceMethodName should be
97 * matched if it is specified
98 * 3. If the tracer is oneshot style, AcpiGbl_TraceMethodName should
99 * not be cleared by the trace stopper during the first match
100 */
102 {
103 return (TRUE);
104 }
105
106 if (Name &&
107 (AcpiGbl_TraceMethodName &&
108 strcmp (AcpiGbl_TraceMethodName, Name)))
109 {
110 return (FALSE);
111 }
112
113 if ((AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT) &&
114 !AcpiGbl_TraceMethodName)
115 {
116 return (FALSE);
117 }
118
119 return (TRUE);
120}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define ACPI_TRACE_ENABLED
Definition: acoutput.h:197
#define ACPI_TRACE_ONESHOT
Definition: acoutput.h:198
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static ACPI_OPERAND_OBJECT * AcpiGbl_TraceMethodObject
Definition: extrace.c:54

Referenced by AcpiExStartTraceMethod(), AcpiExStartTraceOpcode(), AcpiExStopTraceMethod(), and AcpiExStopTraceOpcode().

◆ AcpiExStartTraceMethod()

void AcpiExStartTraceMethod ( ACPI_NAMESPACE_NODE MethodNode,
ACPI_OPERAND_OBJECT ObjDesc,
ACPI_WALK_STATE WalkState 
)

Definition at line 224 of file extrace.c.

228{
229 char *Pathname = NULL;
231
232
233 ACPI_FUNCTION_NAME (ExStartTraceMethod);
234
235
236 if (MethodNode)
237 {
239 }
240
243 {
245 AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
246 AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
247 AcpiDbgLevel = ACPI_TRACE_LEVEL_ALL;
248 AcpiDbgLayer = ACPI_TRACE_LAYER_ALL;
249
250 if (AcpiGbl_TraceDbgLevel)
251 {
252 AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
253 }
254
255 if (AcpiGbl_TraceDbgLayer)
256 {
257 AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
258 }
259 }
260
261 if (Enabled)
262 {
264 ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
265 }
266
267 if (Pathname)
268 {
270 }
271}
unsigned char BOOLEAN
char * AcpiNsGetNormalizedPathname(ACPI_NAMESPACE_NODE *Node, BOOLEAN NoTrailing)
Definition: nsnames.c:367
#define ACPI_TRACE_LEVEL_ALL
Definition: acoutput.h:203
#define ACPI_TRACE_POINT(a, b, c, d)
Definition: acoutput.h:491
#define ACPI_TRACE_LAYER_ALL
Definition: acoutput.h:204
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING Pathname
Definition: acpixf.h:704
#define ACPI_FREE(a)
Definition: actypes.h:386
@ ACPI_TRACE_AML_METHOD
Definition: actypes.h:1414
#define NULL
Definition: types.h:112
static BOOLEAN AcpiExInterpreterTraceEnabled(char *Name)
Definition: extrace.c:80
@ Enabled
Definition: mountmgr.h:159
UINT8 * AmlStart
Definition: acobject.h:221
ACPI_OBJECT_METHOD Method
Definition: acobject.h:525

Referenced by AcpiDsBeginMethodExecution().

◆ AcpiExStartTraceOpcode()

void AcpiExStartTraceOpcode ( ACPI_PARSE_OBJECT Op,
ACPI_WALK_STATE WalkState 
)

Definition at line 353 of file extrace.c.

356{
357
358 ACPI_FUNCTION_NAME (ExStartTraceOpcode);
359
360
362 (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
363 {
365 Op->Common.Aml, Op->Common.AmlOpName);
366 }
367}
#define ACPI_TRACE_OPCODE
Definition: acoutput.h:199
@ ACPI_TRACE_AML_OPCODE
Definition: actypes.h:1415
ACPI_PARSE_OBJ_COMMON Common
Definition: aclocal.h:1078

Referenced by AcpiPsParseLoop().

◆ AcpiExStopTraceMethod()

void AcpiExStopTraceMethod ( ACPI_NAMESPACE_NODE MethodNode,
ACPI_OPERAND_OBJECT ObjDesc,
ACPI_WALK_STATE WalkState 
)

Definition at line 290 of file extrace.c.

294{
295 char *Pathname = NULL;
297
298
299 ACPI_FUNCTION_NAME (ExStopTraceMethod);
300
301
302 if (MethodNode)
303 {
305 }
306
308
309 if (Enabled)
310 {
312 ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
313 }
314
315 /* Check whether the tracer should be stopped */
316
317 if (AcpiGbl_TraceMethodObject == ObjDesc)
318 {
319 /* Disable further tracing if type is one-shot */
320
321 if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)
322 {
323 AcpiGbl_TraceMethodName = NULL;
324 }
325
326 AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
327 AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
329 }
330
331 if (Pathname)
332 {
334 }
335}

Referenced by AcpiDsTerminateControlMethod().

◆ AcpiExStopTraceOpcode()

void AcpiExStopTraceOpcode ( ACPI_PARSE_OBJECT Op,
ACPI_WALK_STATE WalkState 
)

Definition at line 385 of file extrace.c.

388{
389
390 ACPI_FUNCTION_NAME (ExStopTraceOpcode);
391
392
394 (AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
395 {
397 Op->Common.Aml, Op->Common.AmlOpName);
398 }
399}

Referenced by AcpiPsCompleteThisOp().

◆ AcpiExTracePoint()

void AcpiExTracePoint ( ACPI_TRACE_EVENT_TYPE  Type,
BOOLEAN  Begin,
UINT8 Aml,
char Pathname 
)

Definition at line 181 of file extrace.c.

186{
187
188 ACPI_FUNCTION_NAME (ExTracePoint);
189
190
191 if (Pathname)
192 {
194 "%s %s [0x%p:%s] execution.\n",
195 AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
196 Aml, Pathname));
197 }
198 else
199 {
201 "%s %s [0x%p] execution.\n",
202 AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
203 Aml));
204 }
205}
Type
Definition: Type.h:7
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_DB_TRACE_POINT
Definition: acoutput.h:155
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN Begin
Definition: acpixf.h:1301
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1302

Variable Documentation

◆ AcpiGbl_TraceMethodObject

ACPI_OPERAND_OBJECT* AcpiGbl_TraceMethodObject = NULL
static