Bug 203921 - [Proposal] Expose contents of FPDT through sysfs
Summary: [Proposal] Expose contents of FPDT through sysfs
Status: RESOLVED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Config-Tables (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-17 21:39 UTC by Joe Konno
Modified: 2019-12-30 09:47 UTC (History)
3 users (show)

See Also:
Kernel Version: 5.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Joe Konno 2019-06-17 21:39:19 UTC
Proposal: add sysfs nodes for retrieving information contained in ACPI 'Firmware Basic Boot Performance Data Record' as well as 'S3 Performance Table'. This will provide performance tools-- like systemd or pm-graph-- with a common interface to access the information contained in these ACPI tables.

Backing up: The Firmware Performance Data Table (FPDT) is documented in the ACPI Spec v6.3[1] on page 209 (Section 5.2.23). The Spec records two "record types" for FPDT: 'Firmware Basic Boot Performance Pointer Record' and 'S3 Performance Table Pointer Record'. Mind that these are "pointer" records, meaning it's a layer of indirection-- the actual data is stored in other tables.

Today, as of kernel v5.1, the platform's ACPI FPDT (if it exists) is exposed in sysfs under:
    /sys/firmware/acpi/tables/FPDT

However, retrieval of the actual Firmware Boot and S3 data is left as an exercise to the user: e.g. systemd[2], pm-graph, or other like tools. The tool/user has to roll their own method for getting at the actual information, often requiring a trip into /dev/mem.


[1] ACPI v6.3 Spec: https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
[2] Example: how systemd gets at FPDT: https://github.com/systemd/systemd/blob/1e5d2d656420d0e755dbcf72aeba3c3aba54e956/src/shared/acpi-fpdt.c#L64
Comment 1 Todd Brandt 2019-06-20 15:47:03 UTC
The S3PT and FBPT records are what we need to get via sysfs. Right now the FPDT data includes pointers to these records which the user has to get manually from /dev/mem, so in theory if the kernel could read them for us and present them in sysfs that would be great.

S3PT = S3 suspend performance table (firmware suspend/resume perf)
FCPT = firmware boot performance table (firmware boot perf)
Comment 2 Todd Brandt 2019-06-20 15:47:56 UTC
(In reply to Todd Brandt from comment #1)
> The S3PT and FBPT records are what we need to get via sysfs. Right now the
> FPDT data includes pointers to these records which the user has to get
> manually from /dev/mem, so in theory if the kernel could read them for us
> and present them in sysfs that would be great.
> 
> S3PT = S3 suspend performance table (firmware suspend/resume perf)
> FCPT = firmware boot performance table (firmware boot perf)

s/FCPT/FBPT/
Comment 3 Zhang Rui 2019-12-30 09:47:07 UTC
Patch reposted at https://patchwork.kernel.org/patch/11312819/
Mark bug as Resolved.

Note You need to log in before you can comment on or make changes to this bug.