Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6fbdbb2 authored by Todd E Brandt's avatar Todd E Brandt Committed by Rafael J. Wysocki
Browse files

pm-graph: config files and installer



- name change: analyze_boot.py to bootgraph.py
- name change: analyze_suspend.py to sleepgraph.py
- added config files for easier sleepgraph usage
- added example.cfg which describes all config options
- added cgskip.txt definition for slimmer callgraphs

Signed-off-by: default avatarTodd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 91ab883e
Loading
Loading
Loading
Loading
+22 −7
Original line number Diff line number Diff line
@@ -7,11 +7,24 @@ all:

install : uninstall
	install -d  $(DESTDIR)$(PREFIX)/lib/pm-graph
	install analyze_suspend.py $(DESTDIR)$(PREFIX)/lib/pm-graph
	install analyze_boot.py $(DESTDIR)$(PREFIX)/lib/pm-graph
	install sleepgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph
	install bootgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph
	install -d  $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/cgskip.txt $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/freeze-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/freeze.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/freeze-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/standby-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/standby.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/standby-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/suspend-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/suspend.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/suspend-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
	install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config

	ln -s $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_boot.py $(DESTDIR)$(PREFIX)/bin/bootgraph
	ln -s $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_suspend.py $(DESTDIR)$(PREFIX)/bin/sleepgraph
	install -d  $(DESTDIR)$(PREFIX)/bin
	ln -s $(DESTDIR)$(PREFIX)/lib/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph
	ln -s $(DESTDIR)$(PREFIX)/lib/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph

	install -d  $(DESTDIR)$(PREFIX)/share/man/man8
	install bootgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
@@ -24,9 +37,11 @@ uninstall :
	rm -f $(DESTDIR)$(PREFIX)/bin/bootgraph
	rm -f $(DESTDIR)$(PREFIX)/bin/sleepgraph

	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_boot.py
	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/analyze_suspend.py
	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/*.pyc
	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/config/*
	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph/config ] ; then \
		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph/config; \
	fi;
	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/*
	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph ] ; then \
		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph; \
	fi;
+65 −0
Original line number Diff line number Diff line
# -----------------------------------------------
# CallGraph function skip list
#
# This file contains a list of functions which are
# meant to be skipped in the callgraph trace. It reduces
# the callgraph html file size by treating these functions
# as leaves with no child calls. It can be editted by
# adding or removing function symbol names.
#
# The sleepgraph tool automatically pulls this file in when
# it is found in the config folder. It can be ignored if
# the tool is called with "-cgskip off".
# -----------------------------------------------

# low level scheduling and timing
up
down_timeout
mutex_lock
down_read
complete_all
schedule_timeout
wake_up_process
msleep
__udelay
ktime_get

# console calls
printk
dev_printk
console_unlock

# memory handling
__kmalloc
__kmalloc_track_caller
kmem_cache_alloc
kmem_cache_alloc_trace
kmem_cache_free
kstrdup
kstrdup_const
kmalloc_slab
new_slab
__slab_alloc
__slab_free
raw_pci_read
pci_read
alloc_pages_current

# debugfs and sysfs setup
debugfs_remove_recursive
debugfs_create_dir
debugfs_create_files
debugfs_create_dir
debugfs_get_inode
sysfs_add_file_mode_ns
sysfs_add_file
sysfs_create_dir_ns
sysfs_create_link
sysfs_create_group
sysfs_create_groups
sysfs_create_bin_file
dpm_sysfs_add
sysfs_create_file_ns
sysfs_merge_group
sysfs_add_link_to_group
sysfs_create_link_sd
+205 −0
Original line number Diff line number Diff line
#
# This is the configuration file for sleepgraph. It contains
# all the tool arguments so that they don't have to be given on the
# command line. It also includes advanced settings for functions
# and kprobes. It is run like this
#
#    sudo ./sleepgraph.py -config thisfile.txt
#

[Settings]

# Verbosity
# print verbose messages (default: false)
verbose: false

# Suspend Mode
# e.g. standby, mem, freeze, disk (default: mem)
mode: mem

# Automatic Wakeup
# Use rtcwake to autoresume after X seconds, or off to disable (default: 15)
rtcwake: 15

# Add Logs
# add the dmesg and ftrace log to the html output (default: false)
addlogs: false

# Display function calls
# graph source functions in the timeline (default: false)
dev: true

# Callgraph
# gather detailed ftrace callgraph data on all timeline events (default: false)
callgraph: false

# Back to Back Suspend/Resume
# Run two suspend/resumes back to back (default: false)
x2: false

# Back to Back Suspend Delay
# Time delay between the two test runs in ms (default: 0 ms)
x2delay: 0

# Minimum Device Length
# graph only devices longer than min in the timeline (default: 0.001 ms)
mindev: 1

# Minimum Callgraph Length
# provide callgraph data for blocks longer than min (default: 0.001 ms)
mincg: 1

# Suspend/Resume Gap
# insert a small visible gap between suspend and resume on the timeline (default: false)
srgap: false

# Output Directory Format
# output folder for html, ftrace, and dmesg. Use {date} and {time} for current values
output-dir: suspend-{hostname}-{date}-{time}-custom

# Override default timeline entries
# Do not use the internal default functions for timeline entries (default: false)
# Set this to true if you intend to only use the ones defined in this config
override-timeline-functions: true

# Override default dev timeline entries
# Do not use the internal default functions for dev timeline entries (default: false)
# Set this to true if you intend to only use the ones defined in this config
override-dev-timeline-functions: true

[timeline_functions_x86_64]
#
# Function calls to display in the timeline alongside device callbacks.
# The tool has an internal set of these functions which should cover the
# whole of kernel execution, but you can append or override here.
#
# This is a list of kprobes which use both symbol data and function arg data.
# The function calls are displayed on the timeline alongside the device blocks.
# The args are pulled directly from the stack using this architecture's registers
# and stack formatting. Three pieces of info are required. The function name,
# a format string, and an argument list
#
# Entry format:
#
#   function: format{fn_arg1}_{fn_arg2} fn_arg1 fn_arg2 ... [color=purple]
#
# Required Arguments:
#
#   function: The symbol name for the function you want probed, this is the
#             minimum required for an entry, it will show up as the function
#             name with no arguments.
#
#       example: _cpu_up:
#
# Optional Arguments:
#
#   format: The format to display the data on the timeline in. Use braces to
#           enclose the arg names.
#
#       example: CPU_ON[{cpu}]
#
#   color: The color of the entry block in the timeline. The default color is
#          transparent, so the entry shares the phase color. The color is an
#          html color string, either a word, or an RGB.
#
#       example: [color=#CC00CC]
#
#   arglist: A list of arguments from registers/stack addresses. See URL:
#            https://www.kernel.org/doc/Documentation/trace/kprobetrace.txt
#
#       example: cpu=%di:s32
#
# Example: Display cpu resume in the timeline
#
#       _cpu_up: CPU_ON[{cpu}] cpu=%di:s32 [color=orange]
#
_cpu_down: CPU_OFF[{cpu}] cpu=%di:s32
_cpu_up: CPU_ON[{cpu}] cpu=%di:s32
sys_sync:
pm_prepare_console:
pm_notifier_call_chain:
freeze_processes:
freeze_kernel_threads:
pm_restrict_gfp_mask:
acpi_suspend_begin:
suspend_console:
acpi_pm_prepare:
syscore_suspend:
arch_enable_nonboot_cpus_end:
syscore_resume:
acpi_pm_finish:
resume_console:
acpi_pm_end:
pm_restore_gfp_mask:
thaw_processes:
pm_restore_console:

[dev_timeline_functions_x86_64]
#
# Dev mode function calls to display inside timeline entries
#
# This is a list of kprobes which use both symbol data and function arg data.
# The function calls are displayed on the timeline alongside the device blocks.
# The args are pulled directly from the stack using this architecture's registers
# and stack formatting. Three pieces of info are required. The function name,
# a format string, and an argument list
#
# Entry format:
#
#   function: format{fn_arg1}_{fn_arg2} fn_arg1 fn_arg2 ... [color=purple]
#
# Required Arguments:
#
#   function: The symbol name for the function you want probed, this is the
#             minimum required for an entry, it will show up as the function
#             name with no arguments.
#
#       example: ata_eh_recover:
#
# Optional Arguments:
#
#   format: The format to display the data on the timeline in. Use braces to
#           enclose the arg names.
#
#       example: ata{port}_port_reset
# 
#   color: The color of the entry block in the timeline. The default color is
#          transparent, so the entry shares the phase color. The color is an
#          html color string, either a word, or an RGB.
#
#       example: [color=#CC00CC]
#
#   arglist: A list of arguments from registers/stack addresses. See URL:
#            https://www.kernel.org/doc/Documentation/trace/kprobetrace.txt
#
#       example: port=+36(%di):s32
#
# Example: Display ATA port reset as ataN_port_reset in the timeline
#
#       ata_eh_recover: ata{port}_port_reset port=+36(%di):s32
#
msleep: msleep time=%di:s32
schedule_timeout_uninterruptible: schedule_timeout_uninterruptible timeout=%di:s32
schedule_timeout: schedule_timeout timeout=%di:s32
usleep_range: usleep_range min=%di:s32 max=%si:s32
__const_udelay: udelay loops=%di:s32
__mutex_lock_slowpath: mutex_lock_slowpath
ata_eh_recover: ata_eh_recover port=+36(%di):s32
acpi_os_stall:
acpi_resume_power_resources:
acpi_ps_parse_aml:
ext4_sync_fs:
i915_gem_resume:
i915_restore_state:
intel_opregion_setup:
g4x_pre_enable_dp:
vlv_pre_enable_dp:
chv_pre_enable_dp:
g4x_enable_dp:
vlv_enable_dp:
intel_hpd_init:
intel_opregion_register:
intel_dp_detect:
intel_hdmi_detect:
intel_opregion_init:
intel_fbdev_set_suspend:
+133 −0
Original line number Diff line number Diff line
#
# Generic S3 (Suspend to Mem) test
#
# This is the configuration file for sleepgraph. It contains
# all the tool arguments so that they don't have to be given on the
# command line. It also includes advanced settings for functions
# and kprobes. It is run like this
#
#    sudo ./sleepgraph.py -config config/example.cfg
#

[Settings]

# ---- General Options ----

# Verbosity
# print verbose messages (default: false)
verbose: false

# Suspend Mode
# e.g. standby, mem, freeze, disk (default: mem)
mode: mem

# Output Directory Format
# output folder for html, ftrace, and dmesg. Use {date} and {time} for current values
output-dir: suspend-{hostname}-{date}-{time}

# Automatic Wakeup
# Use rtcwake to autoresume after X seconds, or off to disable (default: 15)
rtcwake: 15

# Add Logs
# add the dmesg and ftrace log to the html output (default: false)
addlogs: true

# Suspend/Resume Gap
# insert a small visible gap between suspend and resume on the timeline (default: false)
srgap: false

# Skip HTML generation
# Only capture the logs, don't generate the html timeline (default: false)
skiphtml: false

# Sync filesystem before suspend
# run sync before the test, minimizes sys_sync call time (default: false)
sync: true

# Runtime suspend enable/disable
# Enable/disable runtime suspend for all devices, restore all after test (default: no-action)
# rs: disable

# Turn display on/off for test
# Switch the display on/off for the test using xset (default: no-action)
# display: on

# Print results to text file
# Print the status of the test run in the given file (default: no-action)
result: result.txt

# Gzip the log files to save space
# Gzip the generated log files, and read gzipped log files (default: false)
gzip: true

# ---- Advanced Options ----

# Command to execute in lieu of suspend (default: "")
# command: echo mem > /sys/power/state

# Display user processes
# graph user processes and cpu usage in the timeline (default: false)
proc: false

# Display function calls
# graph source functions in the timeline (default: false)
dev: false

# Multiple test runs
# Run N tests D seconds apart, generates separate outputs with a summary (default: false)
# multi: 3 5

# Back to Back Suspend/Resume
# Run two suspend/resumes back to back and display in the same timeline (default: false)
x2: false

# Back to Back Suspend Delay
# Time delay between the two test runs in ms (default: 0 ms)
x2delay: 0

# Pre Suspend Delay
# Include an N ms delay before (1st) suspend (default: 0 ms)
predelay: 0

# Post Resume Delay
# Include an N ms delay after (last) resume (default: 0 ms)
postdelay: 0

# Minimum Device Length
# graph only devices longer than min in the timeline (default: 0.001 ms)
mindev: 0.001

# ---- Debug Options ----

# Callgraph
# gather detailed ftrace callgraph data on all timeline events (default: false)
callgraph: false

# Callgraph phase filter
# Only enable callgraphs for one phase, i.e. resume_noirq (default: all)
cgphase: suspend

# Callgraph x2 test filter
# Only enable callgraphs test 0 or 1 when using -x2 (default: 1)
cgtest: 0

# Expand Callgraph
# pre-expand the callgraph data in the html output (default: disabled)
expandcg: false

# Minimum Callgraph Length
# provide callgraph data for blocks longer than min (default: 0.001 ms)
mincg: 1

# Timestamp Precision
# Number of significant digits in timestamps (0:S, [3:ms], 6:us)
timeprec: 6

# Device Filter
# show only devices whose name/driver includes one of these strings
# devicefilter: _cpu_up,_cpu_down,i915,usb

# Add kprobe functions to the timeline
# Add functions to the timeline from a text file (default: no-action)
# fadd: file.txt
Loading