diff options
Diffstat (limited to 'source/components/debugger/dbcmds.c')
-rw-r--r-- | source/components/debugger/dbcmds.c | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index 4a2c4e850107..d22bf4ca79e2 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -86,6 +86,8 @@ AcpiDbDoOneSleepState ( UINT8 SleepState); +static char *AcpiDbTraceMethodName = NULL; + /******************************************************************************* * * FUNCTION: AcpiDbConvertToNode @@ -1226,4 +1228,88 @@ AcpiDbGenerateSci ( #endif /* !ACPI_REDUCED_HARDWARE */ + +/******************************************************************************* + * + * FUNCTION: AcpiDbTrace + * + * PARAMETERS: EnableArg - ENABLE/AML to enable tracer + * DISABLE to disable tracer + * MethodArg - Method to trace + * OnceArg - Whether trace once + * + * RETURN: None + * + * DESCRIPTION: Control method tracing facility + * + ******************************************************************************/ + +void +AcpiDbTrace ( + char *EnableArg, + char *MethodArg, + char *OnceArg) +{ + UINT32 DebugLevel = 0; + UINT32 DebugLayer = 0; + UINT32 Flags = 0; + + + if (EnableArg) + { + AcpiUtStrupr (EnableArg); + } + if (OnceArg) + { + AcpiUtStrupr (OnceArg); + } + if (MethodArg) + { + if (AcpiDbTraceMethodName) + { + ACPI_FREE (AcpiDbTraceMethodName); + AcpiDbTraceMethodName = NULL; + } + AcpiDbTraceMethodName = ACPI_ALLOCATE (strlen (MethodArg) + 1); + if (!AcpiDbTraceMethodName) + { + AcpiOsPrintf ("Failed to allocate method name (%s)\n", MethodArg); + return; + } + strcpy (AcpiDbTraceMethodName, MethodArg); + } + if (!strcmp (EnableArg, "ENABLE") || + !strcmp (EnableArg, "METHOD") || + !strcmp (EnableArg, "OPCODE")) + { + if (!strcmp (EnableArg, "ENABLE")) + { + /* Inherit current console settings */ + + DebugLevel = AcpiGbl_DbConsoleDebugLevel; + DebugLayer = AcpiDbgLayer; + } + else + { + /* Restrict console output to trace points only */ + + DebugLevel = ACPI_LV_TRACE_POINT; + DebugLayer = ACPI_EXECUTER; + } + + Flags = ACPI_TRACE_ENABLED; + if (!strcmp (EnableArg, "OPCODE")) + { + Flags |= ACPI_TRACE_OPCODE; + } + if (OnceArg && !strcmp (OnceArg, "ONCE")) + { + Flags |= ACPI_TRACE_ONESHOT; + } + } + + (void) AcpiDebugTrace (AcpiDbTraceMethodName, + DebugLevel, DebugLayer, Flags); +} + #endif /* ACPI_DEBUGGER */ |