Merge tag 'pm-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "These make hibernation on 32-bit x86 systems work in all of the cases in which it works on 64-bit x86 ones, update the menu cpuidle governor and the "polling" state to make them more efficient, add more hardware support to cpufreq drivers and fix issues with some of them, fix a bug in the conservative cpufreq governor, fix the operating performance points (OPP) framework and make it more stable, update the devfreq subsystem to take changes in the APIs used by into account and clean up some things all over. Specifics: - Backport hibernation bug fixes from x86-64 to x86-32 and consolidate hibernation handling on x86 to allow 32-bit systems to work in all of the cases in which 64-bit ones work (Zhimin Gu, Chen Yu). - Fix hibernation documentation (Vladimir D. Seleznev). - Update the menu cpuidle governor to fix a couple of issues with it, make it more efficient in some cases and clean it up (Rafael Wysocki). - Rework the cpuidle polling state implementation to make it more efficient (Rafael Wysocki). - Clean up the cpuidle core somewhat (Fieah Lim). - Fix the cpufreq conservative governor to take policy limits into account properly in some cases (Rafael Wysocki). - Add support for retrieving guaranteed performance information to the ACPI CPPC library and make the intel_pstate driver use it to expose the CPU base frequency via sysfs on systems with the hardware-managed P-states (HWP) feature enabled (Srinivas Pandruvada). - Fix clang warning in the CPPC cpufreq driver (Nathan Chancellor). - Get rid of device_node.name printing from cpufreq (Rob Herring). - Remove unnecessary unlikely() from the cpufreq core (Igor Stoppa). - Add support for the r8a7744 SoC to the cpufreq-dt driver (Biju Das). - Update the dt-platdev cpufreq driver to allow RK3399 to have separate tunables per cluster (Dmitry Torokhov). - Fix the dma_alloc_coherent() usage in the tegra186 cpufreq driver (Christoph Hellwig). - Make the imx6q cpufreq driver read OCOTP through nvmem for imx6ul/imx6ull (Anson Huang). - Fix several bugs in the operating performance points (OPP) framework and make it more stable (Viresh Kumar, Dave Gerlach). - Update the devfreq subsystem to take changes in the APIs used by into account, fix some issues with it and make it stop print device_node.name directly (Bjorn Andersson, Enric Balletbo i Serra, Matthias Kaehlcke, Rob Herring, Vincent Donnefort, zhong jiang). - Prepare the generic power domains (genpd) framework for dealing with domains containing CPUs (Ulf Hansson). - Prevent sysfs attributes representing low-power S0 residency counters from being exposed if low-power S0 support is not indicated in ACPI FADT (Rajneesh Bhardwaj). - Get rid of custom CPU features macros for Intel CPUs from the intel_idle and RAPL drivers (Andy Shevchenko). - Update the tasks freezer to list tasks that refused to freeze and caused a system transition to a sleep state to be aborted (Todd Brandt). - Update the pm-graph set of tools to v5.2 (Todd Brandt). - Fix some issues in the cpupower utility (Anders Roxell, Prarit Bhargava)" * tag 'pm-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (73 commits) PM / Domains: Document flags for genpd PM / Domains: Deal with multiple states but no governor in genpd PM / Domains: Don't treat zero found compatible idle states as an error cpuidle: menu: Avoid computations when result will be discarded cpuidle: menu: Drop redundant comparison cpufreq: tegra186: don't pass GFP_DMA32 to dma_alloc_coherent() cpufreq: conservative: Take limits changes into account properly Documentation: intel_pstate: Add base_frequency information cpufreq: intel_pstate: Add base_frequency attribute ACPI / CPPC: Add support for guaranteed performance cpuidle: menu: Simplify checks related to the polling state PM / tools: sleepgraph and bootgraph: upgrade to v5.2 PM / tools: sleepgraph: first batch of v5.2 changes cpupower: Fix coredump on VMWare cpupower: Fix AMD Family 0x17 msr_pstate size cpufreq: imx6q: read OCOTP through nvmem for imx6ul/imx6ull cpufreq: dt-platdev: allow RK3399 to have separate tunables per cluster cpuidle: poll_state: Revise loop termination condition cpuidle: menu: Move the latency_req == 0 special case check cpuidle: menu: Avoid computations for very close timers ...
This commit is contained in:
@@ -145,7 +145,7 @@ struct config *prepare_default_config()
|
||||
config->cpu = 0;
|
||||
config->prio = SCHED_HIGH;
|
||||
config->verbose = 0;
|
||||
strncpy(config->governor, "ondemand", 8);
|
||||
strncpy(config->governor, "ondemand", sizeof(config->governor));
|
||||
|
||||
config->output = stdout;
|
||||
|
||||
|
@@ -200,6 +200,8 @@ static int get_boost_mode(unsigned int cpu)
|
||||
printf(_(" Boost States: %d\n"), b_states);
|
||||
printf(_(" Total States: %d\n"), pstate_no);
|
||||
for (i = 0; i < pstate_no; i++) {
|
||||
if (!pstates[i])
|
||||
continue;
|
||||
if (i < b_states)
|
||||
printf(_(" Pstate-Pb%d: %luMHz (boost state)"
|
||||
"\n"), i, pstates[i]);
|
||||
|
@@ -33,7 +33,7 @@ union msr_pstate {
|
||||
unsigned vid:8;
|
||||
unsigned iddval:8;
|
||||
unsigned idddiv:2;
|
||||
unsigned res1:30;
|
||||
unsigned res1:31;
|
||||
unsigned en:1;
|
||||
} fam17h_bits;
|
||||
unsigned long long val;
|
||||
@@ -119,6 +119,11 @@ int decode_pstates(unsigned int cpu, unsigned int cpu_family,
|
||||
}
|
||||
if (read_msr(cpu, MSR_AMD_PSTATE + i, &pstate.val))
|
||||
return -1;
|
||||
if ((cpu_family == 0x17) && (!pstate.fam17h_bits.en))
|
||||
continue;
|
||||
else if (!pstate.bits.en)
|
||||
continue;
|
||||
|
||||
pstates[i] = get_cof(cpu_family, pstate);
|
||||
}
|
||||
*no = i;
|
||||
|
@@ -23,8 +23,8 @@ install : uninstall
|
||||
install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
|
||||
|
||||
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
|
||||
ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph
|
||||
ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph
|
||||
|
||||
install -d $(DESTDIR)$(PREFIX)/share/man/man8
|
||||
install bootgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
|
||||
|
@@ -34,6 +34,10 @@ from datetime import datetime, timedelta
|
||||
from subprocess import call, Popen, PIPE
|
||||
import sleepgraph as aslib
|
||||
|
||||
def pprint(msg):
|
||||
print(msg)
|
||||
sys.stdout.flush()
|
||||
|
||||
# ----------------- CLASSES --------------------
|
||||
|
||||
# Class: SystemValues
|
||||
@@ -157,11 +161,11 @@ class SystemValues(aslib.SystemValues):
|
||||
return cmdline
|
||||
def manualRebootRequired(self):
|
||||
cmdline = self.kernelParams()
|
||||
print 'To generate a new timeline manually, follow these steps:\n'
|
||||
print '1. Add the CMDLINE string to your kernel command line.'
|
||||
print '2. Reboot the system.'
|
||||
print '3. After reboot, re-run this tool with the same arguments but no command (w/o -reboot or -manual).\n'
|
||||
print 'CMDLINE="%s"' % cmdline
|
||||
pprint('To generate a new timeline manually, follow these steps:\n\n'\
|
||||
'1. Add the CMDLINE string to your kernel command line.\n'\
|
||||
'2. Reboot the system.\n'\
|
||||
'3. After reboot, re-run this tool with the same arguments but no command (w/o -reboot or -manual).\n\n'\
|
||||
'CMDLINE="%s"' % cmdline)
|
||||
sys.exit()
|
||||
def blGrub(self):
|
||||
blcmd = ''
|
||||
@@ -431,7 +435,7 @@ def parseTraceLog(data):
|
||||
if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
|
||||
continue
|
||||
if(not cg.postProcess()):
|
||||
print('Sanity check failed for %s-%d' % (proc, pid))
|
||||
pprint('Sanity check failed for %s-%d' % (proc, pid))
|
||||
continue
|
||||
# match cg data to devices
|
||||
devname = data.deviceMatch(pid, cg)
|
||||
@@ -442,8 +446,8 @@ def parseTraceLog(data):
|
||||
sysvals.vprint('%s callgraph found for %s %s-%d [%f - %f]' %\
|
||||
(kind, cg.name, proc, pid, cg.start, cg.end))
|
||||
elif len(cg.list) > 1000000:
|
||||
print 'WARNING: the callgraph found for %s is massive! (%d lines)' %\
|
||||
(devname, len(cg.list))
|
||||
pprint('WARNING: the callgraph found for %s is massive! (%d lines)' %\
|
||||
(devname, len(cg.list)))
|
||||
|
||||
# Function: retrieveLogs
|
||||
# Description:
|
||||
@@ -528,7 +532,7 @@ def createBootGraph(data):
|
||||
tMax = data.end
|
||||
tTotal = tMax - t0
|
||||
if(tTotal == 0):
|
||||
print('ERROR: No timeline data')
|
||||
pprint('ERROR: No timeline data')
|
||||
return False
|
||||
user_mode = '%.0f'%(data.tUserMode*1000)
|
||||
last_init = '%.0f'%(tTotal*1000)
|
||||
@@ -734,7 +738,7 @@ def updateCron(restore=False):
|
||||
op.close()
|
||||
res = call([cmd, cronfile])
|
||||
except Exception, e:
|
||||
print 'Exception: %s' % str(e)
|
||||
pprint('Exception: %s' % str(e))
|
||||
shutil.move(backfile, cronfile)
|
||||
res = -1
|
||||
if res != 0:
|
||||
@@ -750,7 +754,7 @@ def updateGrub(restore=False):
|
||||
call(sysvals.blexec, stderr=PIPE, stdout=PIPE,
|
||||
env={'PATH': '.:/sbin:/usr/sbin:/usr/bin:/sbin:/bin'})
|
||||
except Exception, e:
|
||||
print 'Exception: %s\n' % str(e)
|
||||
pprint('Exception: %s\n' % str(e))
|
||||
return
|
||||
# extract the option and create a grub config without it
|
||||
sysvals.rootUser(True)
|
||||
@@ -797,7 +801,7 @@ def updateGrub(restore=False):
|
||||
res = call(sysvals.blexec)
|
||||
os.remove(grubfile)
|
||||
except Exception, e:
|
||||
print 'Exception: %s' % str(e)
|
||||
pprint('Exception: %s' % str(e))
|
||||
res = -1
|
||||
# cleanup
|
||||
shutil.move(tempfile, grubfile)
|
||||
@@ -821,7 +825,7 @@ def updateKernelParams(restore=False):
|
||||
def doError(msg, help=False):
|
||||
if help == True:
|
||||
printHelp()
|
||||
print 'ERROR: %s\n' % msg
|
||||
pprint('ERROR: %s\n' % msg)
|
||||
sysvals.outputResult({'error':msg})
|
||||
sys.exit()
|
||||
|
||||
@@ -829,52 +833,51 @@ def doError(msg, help=False):
|
||||
# Description:
|
||||
# print out the help text
|
||||
def printHelp():
|
||||
print('')
|
||||
print('%s v%s' % (sysvals.title, sysvals.version))
|
||||
print('Usage: bootgraph <options> <command>')
|
||||
print('')
|
||||
print('Description:')
|
||||
print(' This tool reads in a dmesg log of linux kernel boot and')
|
||||
print(' creates an html representation of the boot timeline up to')
|
||||
print(' the start of the init process.')
|
||||
print('')
|
||||
print(' If no specific command is given the tool reads the current dmesg')
|
||||
print(' and/or ftrace log and creates a timeline')
|
||||
print('')
|
||||
print(' Generates output files in subdirectory: boot-yymmdd-HHMMSS')
|
||||
print(' HTML output: <hostname>_boot.html')
|
||||
print(' raw dmesg output: <hostname>_boot_dmesg.txt')
|
||||
print(' raw ftrace output: <hostname>_boot_ftrace.txt')
|
||||
print('')
|
||||
print('Options:')
|
||||
print(' -h Print this help text')
|
||||
print(' -v Print the current tool version')
|
||||
print(' -verbose Print extra information during execution and analysis')
|
||||
print(' -addlogs Add the dmesg log to the html output')
|
||||
print(' -result fn Export a results table to a text file for parsing.')
|
||||
print(' -o name Overrides the output subdirectory name when running a new test')
|
||||
print(' default: boot-{date}-{time}')
|
||||
print(' [advanced]')
|
||||
print(' -fstat Use ftrace to add function detail and statistics (default: disabled)')
|
||||
print(' -f/-callgraph Add callgraph detail, can be very large (default: disabled)')
|
||||
print(' -maxdepth N limit the callgraph data to N call levels (default: 2)')
|
||||
print(' -mincg ms Discard all callgraphs shorter than ms milliseconds (e.g. 0.001 for us)')
|
||||
print(' -timeprec N Number of significant digits in timestamps (0:S, 3:ms, [6:us])')
|
||||
print(' -expandcg pre-expand the callgraph data in the html output (default: disabled)')
|
||||
print(' -func list Limit ftrace to comma-delimited list of functions (default: do_one_initcall)')
|
||||
print(' -cgfilter S Filter the callgraph output in the timeline')
|
||||
print(' -cgskip file Callgraph functions to skip, off to disable (default: cgskip.txt)')
|
||||
print(' -bl name Use the following boot loader for kernel params (default: grub)')
|
||||
print(' -reboot Reboot the machine automatically and generate a new timeline')
|
||||
print(' -manual Show the steps to generate a new timeline manually (used with -reboot)')
|
||||
print('')
|
||||
print('Other commands:')
|
||||
print(' -flistall Print all functions capable of being captured in ftrace')
|
||||
print(' -sysinfo Print out system info extracted from BIOS')
|
||||
print(' [redo]')
|
||||
print(' -dmesg file Create HTML output using dmesg input (used with -ftrace)')
|
||||
print(' -ftrace file Create HTML output using ftrace input (used with -dmesg)')
|
||||
print('')
|
||||
pprint('\n%s v%s\n'\
|
||||
'Usage: bootgraph <options> <command>\n'\
|
||||
'\n'\
|
||||
'Description:\n'\
|
||||
' This tool reads in a dmesg log of linux kernel boot and\n'\
|
||||
' creates an html representation of the boot timeline up to\n'\
|
||||
' the start of the init process.\n'\
|
||||
'\n'\
|
||||
' If no specific command is given the tool reads the current dmesg\n'\
|
||||
' and/or ftrace log and creates a timeline\n'\
|
||||
'\n'\
|
||||
' Generates output files in subdirectory: boot-yymmdd-HHMMSS\n'\
|
||||
' HTML output: <hostname>_boot.html\n'\
|
||||
' raw dmesg output: <hostname>_boot_dmesg.txt\n'\
|
||||
' raw ftrace output: <hostname>_boot_ftrace.txt\n'\
|
||||
'\n'\
|
||||
'Options:\n'\
|
||||
' -h Print this help text\n'\
|
||||
' -v Print the current tool version\n'\
|
||||
' -verbose Print extra information during execution and analysis\n'\
|
||||
' -addlogs Add the dmesg log to the html output\n'\
|
||||
' -result fn Export a results table to a text file for parsing.\n'\
|
||||
' -o name Overrides the output subdirectory name when running a new test\n'\
|
||||
' default: boot-{date}-{time}\n'\
|
||||
' [advanced]\n'\
|
||||
' -fstat Use ftrace to add function detail and statistics (default: disabled)\n'\
|
||||
' -f/-callgraph Add callgraph detail, can be very large (default: disabled)\n'\
|
||||
' -maxdepth N limit the callgraph data to N call levels (default: 2)\n'\
|
||||
' -mincg ms Discard all callgraphs shorter than ms milliseconds (e.g. 0.001 for us)\n'\
|
||||
' -timeprec N Number of significant digits in timestamps (0:S, 3:ms, [6:us])\n'\
|
||||
' -expandcg pre-expand the callgraph data in the html output (default: disabled)\n'\
|
||||
' -func list Limit ftrace to comma-delimited list of functions (default: do_one_initcall)\n'\
|
||||
' -cgfilter S Filter the callgraph output in the timeline\n'\
|
||||
' -cgskip file Callgraph functions to skip, off to disable (default: cgskip.txt)\n'\
|
||||
' -bl name Use the following boot loader for kernel params (default: grub)\n'\
|
||||
' -reboot Reboot the machine automatically and generate a new timeline\n'\
|
||||
' -manual Show the steps to generate a new timeline manually (used with -reboot)\n'\
|
||||
'\n'\
|
||||
'Other commands:\n'\
|
||||
' -flistall Print all functions capable of being captured in ftrace\n'\
|
||||
' -sysinfo Print out system info extracted from BIOS\n'\
|
||||
' [redo]\n'\
|
||||
' -dmesg file Create HTML output using dmesg input (used with -ftrace)\n'\
|
||||
' -ftrace file Create HTML output using ftrace input (used with -dmesg)\n'\
|
||||
'' % (sysvals.title, sysvals.version))
|
||||
return True
|
||||
|
||||
# ----------------- MAIN --------------------
|
||||
@@ -895,7 +898,7 @@ if __name__ == '__main__':
|
||||
printHelp()
|
||||
sys.exit()
|
||||
elif(arg == '-v'):
|
||||
print("Version %s" % sysvals.version)
|
||||
pprint("Version %s" % sysvals.version)
|
||||
sys.exit()
|
||||
elif(arg == '-verbose'):
|
||||
sysvals.verbose = True
|
||||
@@ -1016,7 +1019,7 @@ if __name__ == '__main__':
|
||||
print f
|
||||
elif cmd == 'checkbl':
|
||||
sysvals.getBootLoader()
|
||||
print 'Boot Loader: %s\n%s' % (sysvals.bootloader, sysvals.blexec)
|
||||
pprint('Boot Loader: %s\n%s' % (sysvals.bootloader, sysvals.blexec))
|
||||
elif(cmd == 'sysinfo'):
|
||||
sysvals.printSystemInfo(True)
|
||||
sys.exit()
|
||||
|
@@ -27,6 +27,7 @@ ktime_get
|
||||
# console calls
|
||||
printk
|
||||
dev_printk
|
||||
__dev_printk
|
||||
console_unlock
|
||||
|
||||
# memory handling
|
||||
|
@@ -105,7 +105,7 @@ override-dev-timeline-functions: true
|
||||
# example: [color=#CC00CC]
|
||||
#
|
||||
# arglist: A list of arguments from registers/stack addresses. See URL:
|
||||
# https://www.kernel.org/doc/Documentation/trace/kprobetrace.rst
|
||||
# https://www.kernel.org/doc/Documentation/trace/kprobetrace.txt
|
||||
#
|
||||
# example: cpu=%di:s32
|
||||
#
|
||||
@@ -170,7 +170,7 @@ pm_restore_console:
|
||||
# example: [color=#CC00CC]
|
||||
#
|
||||
# arglist: A list of arguments from registers/stack addresses. See URL:
|
||||
# https://www.kernel.org/doc/Documentation/trace/kprobetrace.rst
|
||||
# https://www.kernel.org/doc/Documentation/trace/kprobetrace.txt
|
||||
#
|
||||
# example: port=+36(%di):s32
|
||||
#
|
||||
|
@@ -65,9 +65,9 @@ During test, enable/disable runtime suspend for all devices. The test is delayed
|
||||
by 5 seconds to allow runtime suspend changes to occur. The settings are restored
|
||||
after the test is complete.
|
||||
.TP
|
||||
\fB-display \fIon/off\fR
|
||||
Turn the display on or off for the test using the xset command. This helps
|
||||
maintain the consistecy of test data for better comparison.
|
||||
\fB-display \fIon/off/standby/suspend\fR
|
||||
Switch the display to the requested mode for the test using the xset command.
|
||||
This helps maintain the consistency of test data for better comparison.
|
||||
.TP
|
||||
\fB-skiphtml\fR
|
||||
Run the test and capture the trace logs, but skip the timeline generation.
|
||||
@@ -183,6 +183,13 @@ Print out the contents of the ACPI Firmware Performance Data Table.
|
||||
\fB-battery\fR
|
||||
Print out battery status and current charge.
|
||||
.TP
|
||||
\fB-xon/-xoff/-xstandby/-xsuspend\fR
|
||||
Test xset by attempting to switch the display to the given mode. This
|
||||
is the same command which will be issued by \fB-display \fImode\fR.
|
||||
.TP
|
||||
\fB-xstat\fR
|
||||
Get the current DPMS display mode.
|
||||
.TP
|
||||
\fB-sysinfo\fR
|
||||
Print out system info extracted from BIOS. Reads /dev/mem directly instead of going through dmidecode.
|
||||
.TP
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user