From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: "Zheng, Lv" <lv.zheng@intel.com>
Cc: "Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"Brown, Len" <len.brown@intel.com>, Lv Zheng <zetalog@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH 0/4] ACPI: Update method tracing facility.
Date: Fri, 24 Jul 2015 21:55:44 +0200 [thread overview]
Message-ID: <1562441.fPJgJEEk7h@vostro.rjw.lan> (raw)
In-Reply-To: <1AE640813FDE7649BE1B193DEA596E881EF10D85@SHSMSX101.ccr.corp.intel.com>
On Friday, July 24, 2015 02:02:33 AM Zheng, Lv wrote:
> Hi, Rafael
Hi,
> ACPICA logs contain details (trace logs) that may be useful for development.
> But the quantity of the trace logs are huge to be put into the kernel log buffer.
> Originally, we have a "trace log reducer" in /sys/modules/acpi/parameter, it is the method tracing facility.
> We can specify a method name, for example, "_PS0", and corresponding debug layer/level for the "trace log reducer".
> When the AML interpreter starts to execute the method, the tracing debug level/layer will be applied.
> When the AML interpreter stops to execute the method, the original debug level/layer is restored.
> Thus the ACPICA trace logs can only be enabled during the period the specified method is executed and its output thus can be reduced.
> The facility invokes acpi_debug_trace() to do the flexible settings.
> See Documentation/acpi/method-tracing.txt for reference.
>
> Actually, the "trace log reducer" facility is buggy and some of the shortcomings put us into the trouble in using it.
> 1. We cannot specify a full path for the tracing method. For example, though we only want to track \_SB,PCI0.I2C0._PS0, we can only specify "_PS0" and all _PS0 method execution logs will be dumped, the unwanted _PS0 execution trace logs may still blow the kernel log buffer up.
> 2. We can only specify a method that is passed to acpi_evaluate_object(). For example, if \_SB.LID0._LID invokes \_SB.PCI0.LPCB.H_EC.ECRD, since Linux never passes \_SB.PCI0.LPCB.H_EC.ECRD to acpi_evaluate_object(), specifying "ECRD" cannot match the start of the execution to enable the "trace log reducer".
>
> So during this ACPICA release, we re-implement the facility in the ACPICA dispatcher rather than implementing it in acpi_evaluate_object and allows the full path to be specified to precisely lock on a specific control method.
> It is achieved by doing the following improvements:
> 1. Re-implements the facility in the ACPICA dispatcher component.
> 1. Introduce a new AML path -> ASL path decoding facility to zap the trailing underscore. Originally ACPICA decodes AML path into such a format that the user must explicitly specify the trailing. And users are likely to forget to put the underscores and leave us with useless trace logs.
> 2. Move the exception stack walker from the ACPICA debugger component to the ACPICA dispatcher component. When an exception is encountered, AML interpreter just jumps to the top of the stack. Thus we need a facility to walk the stack so that the method can be matched to implement the "end of the tracing".
>
> And with the improvements, we now can do an exciting tracing:
> 1. When the trace is enabled, we add new log entries for the begin/end of each control method that is executed by the interpreter.
> 2. When the trace is enabled, we add new log entries for the begin/end of each opcode that is executed by the interpreter.
> 3. We allow the method virtual address and the opcode virtual address to be dumped along with the begin/end logs.
> This makes it possible to draw a AML call graph using the dumped log and we can calculate the execution time of a control method/opcode.
> We can use it either for performance tuning or remote debugging.
> The new feature is known as "AML execution tracer".
>
> All of above improvements are done to the acpi_debug_trace(), new features/parameters are added to this ACPICA interface.
> Now acpi_debug_trace() can be used not only as the "trace log reducer" but also the "AML execution tracer".
> As its user, /sys/modules/acpi/parameters/trace_xxx files need to be updated so that we can use the fixed/improved old feature and the new feature in the Linux kernel.
>
> There is an user experience example of the new feature (AML execution tracer) on the kernel Bugzilla:
> https://bugzilla.kernel.org/show_bug.cgi?id=70891
> The user reported a delay to the ACPICA developers mailing list and I helped to file a bug there.
> With the assistance of this debugging facility (see comment 29, 30, 31), I found the delay was caused by the EC driver (so this is really an effective debugging facility).
> This bug (erroneously reported as an ACPICA issue) motivated me to look at the Linux EC driver and offered the fixes to help to improve the quality of the EC/GPE implementations.
>
> Hope this explanation can help.
All of that is good information, so what about sending a documentation patch
with it?
Rafael
next prev parent reply other threads:[~2015-07-24 19:28 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 4:51 [PATCH 00/22] ACPICA: 20150717 Release Lv Zheng
2015-07-23 4:52 ` [PATCH 01/22] ACPICA: Parser: Reduce parser/namespace divergences for tracer support Lv Zheng
2015-07-23 4:52 ` [PATCH 02/22] ACPICA: Parser: Cleanup aml_offset in struct acpi_walk_state Lv Zheng
2015-07-23 4:52 ` [PATCH 03/22] ACPICA: Parser: Cleanup aml_offset in union acpi_operand_object Lv Zheng
2015-07-23 4:52 ` [PATCH 04/22] ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments Lv Zheng
2015-07-23 4:52 ` [PATCH 05/22] ACPICA: Executer: Add back pointing reference of method operand Lv Zheng
2015-07-23 4:52 ` [PATCH 06/22] ACPICA: Namespace: Add function to directly return normalized full path Lv Zheng
2015-07-23 4:52 ` [PATCH 07/22] ACPICA: Dispatcher: Move stack traversal code to dispatcher Lv Zheng
2015-07-23 4:52 ` [PATCH 08/22] ACPICA: Dispatcher: Add trace support for interpreter Lv Zheng
2015-07-23 4:52 ` [PATCH 09/22] ACPICA: Executer: Add interpreter tracing mode for method tracing facility Lv Zheng
2015-07-23 4:53 ` [PATCH 10/22] ACPICA: Executer: Add OSL trace hook support Lv Zheng
2015-07-23 4:53 ` [PATCH 11/22] ACPICA: Executer: Add option to bypass opcode tracing Lv Zheng
2015-07-23 4:53 ` [PATCH 12/22] ACPICA: Parser: Remove redundant opcode execution debugging output Lv Zheng
2015-07-23 4:53 ` [PATCH 13/22] ACPICA: Remove extraneous check for null walk_state Lv Zheng
2015-07-23 4:53 ` [PATCH 14/22] ACPICA: iASL: Add new warnings for method local_x and arg_x variables Lv Zheng
2015-07-23 4:53 ` [PATCH 15/22] ACPICA: MSVC: Fix inclusion order issue of <crtdbg.h> Lv Zheng
2015-07-23 4:53 ` [PATCH 16/22] ACPICA: Cleanup use of all non-ANSI local C library functions Lv Zheng
2015-07-23 4:53 ` [PATCH 17/22] ACPICA: Cleanup use of NEGATIVE and POSITIVE defines Lv Zheng
2015-07-23 4:54 ` [PATCH 18/22] ACPICA: iASL: Add support for TCPA Server Table Lv Zheng
2015-07-23 4:54 ` [PATCH 19/22] ACPICA: Debugger: Reduce structure size for debugger Lv Zheng
2015-07-23 4:54 ` [PATCH 20/22] ACPICA: Debugger: Move debugger specific APIs to debugger component Lv Zheng
2015-07-23 4:54 ` [PATCH 21/22] ACPICA: iASL/Disassembler: Add prototype verbose mode Lv Zheng
2015-07-23 4:54 ` [PATCH 22/22] ACPICA: Update version to 20150717 Lv Zheng
2015-07-23 5:06 ` [PATCH 0/4] ACPI: Update method tracing facility Lv Zheng
2015-07-23 5:06 ` [PATCH 1/4] ACPI / sysfs: Add ACPI_LV_REPAIR debug level Lv Zheng
2015-07-23 5:06 ` [PATCH 2/4] ACPI / sysfs: Update method tracing facility Lv Zheng
2015-07-23 5:06 ` [PATCH 3/4] ACPI / Documentation: Update method tracing documentation Lv Zheng
2015-07-23 5:07 ` [PATCH 4/4] ACPI / sysfs: Add support to allow leading "\" missing in trace_method_name Lv Zheng
2015-07-23 20:51 ` [PATCH 0/4] ACPI: Update method tracing facility Rafael J. Wysocki
2015-07-24 2:02 ` Zheng, Lv
2015-07-24 19:55 ` Rafael J. Wysocki [this message]
2015-07-27 0:42 ` Zheng, Lv
2015-07-29 0:58 ` [PATCH 00/22] ACPICA: 20150717 Release Rafael J. Wysocki
2015-07-29 1:41 ` Zheng, Lv
2015-08-05 8:23 ` [PATCH v2 0/4] ACPI: Update method tracing facility Lv Zheng
2015-08-05 8:23 ` [PATCH v2 1/4] ACPI / sysfs: Add ACPI_LV_REPAIR debug level Lv Zheng
2015-08-05 8:23 ` [PATCH v2 2/4] ACPI / sysfs: Update method tracing facility Lv Zheng
2015-08-05 8:23 ` [PATCH v2 3/4] ACPI / sysfs: Add support to allow leading "\" missing in trace_method_name Lv Zheng
2015-08-05 8:24 ` [PATCH v2 4/4] ACPI / Documentation: Update method tracing documentation Lv Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1562441.fPJgJEEk7h@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=zetalog@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®