summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/utilities/utdebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/components/utilities/utdebug.c')
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdebug.c121
1 files changed, 97 insertions, 24 deletions
diff --git a/sys/contrib/dev/acpica/components/utilities/utdebug.c b/sys/contrib/dev/acpica/components/utilities/utdebug.c
index 544450d..7e03b22 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdebug.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acinterp.h>
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utdebug")
@@ -52,15 +53,9 @@
#ifdef ACPI_DEBUG_OUTPUT
-static ACPI_THREAD_ID AcpiGbl_PrevThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF;
-static char *AcpiGbl_FnEntryStr = "----Entry";
-static char *AcpiGbl_FnExitStr = "----Exit-";
-
-/* Local prototypes */
-
-static const char *
-AcpiUtTrimFunctionName (
- const char *FunctionName);
+static ACPI_THREAD_ID AcpiGbl_PreviousThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF;
+static const char *AcpiGbl_FunctionEntryPrefix = "----Entry";
+static const char *AcpiGbl_FunctionExitPrefix = "----Exit-";
/*******************************************************************************
@@ -200,16 +195,16 @@ AcpiDebugPrint (
* Thread tracking and context switch notification
*/
ThreadId = AcpiOsGetThreadId ();
- if (ThreadId != AcpiGbl_PrevThreadId)
+ if (ThreadId != AcpiGbl_PreviousThreadId)
{
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf (
"\n**** Context Switch from TID %u to TID %u ****\n\n",
- (UINT32) AcpiGbl_PrevThreadId, (UINT32) ThreadId);
+ (UINT32) AcpiGbl_PreviousThreadId, (UINT32) ThreadId);
}
- AcpiGbl_PrevThreadId = ThreadId;
+ AcpiGbl_PreviousThreadId = ThreadId;
AcpiGbl_NestingLevel = 0;
}
@@ -324,7 +319,7 @@ AcpiUtTrace (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s\n", AcpiGbl_FnEntryStr);
+ "%s\n", AcpiGbl_FunctionEntryPrefix);
}
}
@@ -354,7 +349,7 @@ AcpiUtTracePtr (
const char *FunctionName,
const char *ModuleName,
UINT32 ComponentId,
- void *Pointer)
+ const void *Pointer)
{
AcpiGbl_NestingLevel++;
@@ -366,7 +361,7 @@ AcpiUtTracePtr (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s %p\n", AcpiGbl_FnEntryStr, Pointer);
+ "%s %p\n", AcpiGbl_FunctionEntryPrefix, Pointer);
}
}
@@ -394,7 +389,7 @@ AcpiUtTraceStr (
const char *FunctionName,
const char *ModuleName,
UINT32 ComponentId,
- char *String)
+ const char *String)
{
AcpiGbl_NestingLevel++;
@@ -406,7 +401,7 @@ AcpiUtTraceStr (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s %s\n", AcpiGbl_FnEntryStr, String);
+ "%s %s\n", AcpiGbl_FunctionEntryPrefix, String);
}
}
@@ -446,7 +441,7 @@ AcpiUtTraceU32 (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s %08X\n", AcpiGbl_FnEntryStr, Integer);
+ "%s %08X\n", AcpiGbl_FunctionEntryPrefix, Integer);
}
}
@@ -481,7 +476,7 @@ AcpiUtExit (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s\n", AcpiGbl_FnExitStr);
+ "%s\n", AcpiGbl_FunctionExitPrefix);
}
if (AcpiGbl_NestingLevel)
@@ -527,14 +522,14 @@ AcpiUtStatusExit (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s %s\n", AcpiGbl_FnExitStr,
+ "%s %s\n", AcpiGbl_FunctionExitPrefix,
AcpiFormatException (Status));
}
else
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s ****Exception****: %s\n", AcpiGbl_FnExitStr,
+ "%s ****Exception****: %s\n", AcpiGbl_FunctionExitPrefix,
AcpiFormatException (Status));
}
}
@@ -580,7 +575,7 @@ AcpiUtValueExit (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr,
+ "%s %8.8X%8.8X\n", AcpiGbl_FunctionExitPrefix,
ACPI_FORMAT_UINT64 (Value));
}
@@ -625,7 +620,49 @@ AcpiUtPtrExit (
{
AcpiDebugPrint (ACPI_LV_FUNCTIONS,
LineNumber, FunctionName, ModuleName, ComponentId,
- "%s %p\n", AcpiGbl_FnExitStr, Ptr);
+ "%s %p\n", AcpiGbl_FunctionExitPrefix, Ptr);
+ }
+
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtStrExit
+ *
+ * PARAMETERS: LineNumber - Caller's line number
+ * FunctionName - Caller's procedure name
+ * ModuleName - Caller's module name
+ * ComponentId - Caller's component ID
+ * String - String to display
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
+ * set in DebugLevel. Prints exit value also.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtStrExit (
+ UINT32 LineNumber,
+ const char *FunctionName,
+ const char *ModuleName,
+ UINT32 ComponentId,
+ const char *String)
+{
+
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
+ {
+ AcpiDebugPrint (ACPI_LV_FUNCTIONS,
+ LineNumber, FunctionName, ModuleName, ComponentId,
+ "%s %s\n", AcpiGbl_FunctionExitPrefix, String);
}
if (AcpiGbl_NestingLevel)
@@ -634,6 +671,42 @@ AcpiUtPtrExit (
}
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTracePoint
+ *
+ * PARAMETERS: Type - Trace event type
+ * Begin - TRUE if before execution
+ * Aml - Executed AML address
+ * Pathname - Object path
+ * Pointer - Pointer to the related object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Interpreter execution trace.
+ *
+ ******************************************************************************/
+
+void
+AcpiTracePoint (
+ ACPI_TRACE_EVENT_TYPE Type,
+ BOOLEAN Begin,
+ UINT8 *Aml,
+ char *Pathname)
+{
+
+ ACPI_FUNCTION_ENTRY ();
+
+ AcpiExTracePoint (Type, Begin, Aml, Pathname);
+
+#ifdef ACPI_USE_SYSTEM_TRACER
+ AcpiOsTracePoint (Type, Begin, Aml, Pathname);
+#endif
+}
+
+ACPI_EXPORT_SYMBOL (AcpiTracePoint)
+
#endif
OpenPOWER on IntegriCloud