13 Feb, 2019
1 commit
-
[ Upstream commit 663546903c835fe46308b1b1e53d32d1f2b33da9 ]
This script is supposed to be allowed to run with regular user
privileges if a previously captured trace is being post processed.Commit fbe313884d7d (tools/power/x86/intel_pstate_tracer: Free the
trace buffer memory) introduced a bug that breaks that option.Commit 35459105deb2 (tools/power/x86/intel_pstate_tracer: Add
optional setting of trace buffer memory allocation) moved the code
but kept the bug.This patch fixes the issue.
Fixes: 35459105deb2 (tools/power/x86/intel_pstate_tracer: Add optional ...)
Signed-off-by: Doug Smythies
Signed-off-by: Rafael J. Wysocki
Signed-off-by: Sasha Levin
01 Dec, 2018
1 commit
-
commit 9de9aa45e9bd67232e000cca42ceb134b8ae51b6 upstream.
Rename duplicate sysfs_read_file into cpupower_read_sysfs and fix linking.
Signed-off-by: Konstantin Khlebnikov
Acked-by: Thomas Renninger
Cc:
Signed-off-by: Shuah Khan (Samsung OSG)
Signed-off-by: Greg Kroah-Hartman
14 Nov, 2018
2 commits
-
[ Upstream commit 8c22e2f695920ebd94f9a53bcf2a65eb36d4dba1 ]
The msr_pstate data is only 63 bits long and should be 64 bits.
Add in the missing bit from res1 for AMD Family 0x17.
Reference: https://www.amd.com/system/files/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf, page 138.
Signed-off-by: Prarit Bhargava
Cc: Shuah Khan
Cc: Stafford Horne
Signed-off-by: Shuah Khan (Samsung OSG)
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman -
[ Upstream commit f69ffc5d3db8f1f03fd6d1df5930f9a1fbd787b6 ]
cpupower crashes on VMWare guests. The guests have the AMD PStateDef MSR
(0xC0010064 + state number) set to zero. As a result fid and did are zero
and the crash occurs because of a divide by zero (cof = fid/did). This
can be prevented by checking the enable bit in the PStateDef MSR before
calculating cof. By doing this the value of pstate[i] remains zero and
the value can be tested before displaying the active Pstates.Check the enable bit in the PstateDef register for all supported families
and only print out enabled Pstates.Signed-off-by: Prarit Bhargava
Cc: Shuah Khan
Cc: Stafford Horne
Signed-off-by: Shuah Khan (Samsung OSG)
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
24 Aug, 2018
1 commit
-
Almost all files in the kernel are either plain text or UTF-8 encoded. A
couple however are ISO_8859-1, usually just a few characters in a C
comments, for historic reasons.This converts them all to UTF-8 for consistency.
Link: http://lkml.kernel.org/r/20180724111600.4158975-1-arnd@arndb.de
Signed-off-by: Arnd Bergmann
Acked-by: Simon Horman [IPVS portion]
Acked-by: Jonathan Cameron [IIO]
Acked-by: Michael Ellerman [powerpc]
Acked-by: Rob Herring
Cc: Joe Perches
Cc: Arnd Bergmann
Cc: Samuel Ortiz
Cc: "David S. Miller"
Cc: Rob Herring
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Jul, 2018
1 commit
-
Pull turbostat utility fixes for 4.18 from Len Brown:
"Three of them are for regressions since Linux-4.17"
* 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
tools/power turbostat: version 18.07.27
tools/power turbostat: Read extended processor family from CPUID
tools/power turbostat: Fix logical node enumeration to allow for non-sequential physical nodes
tools/power turbostat: fix x2apic debug message output file
tools/power turbostat: fix bogus summary values
tools/power turbostat: fix -S on UP systems
tools/power turbostat: Update turbostat(8) RAPL throttling column description
28 Jul, 2018
2 commits
-
Signed-off-by: Len Brown
-
This fixes the reported family on modern AMD processors (e.g. Ryzen,
which is family 0x17). Previously these processors all showed up as
family 0xf.See the document
https://support.amd.com/TechDocs/56255_OSRR.pdf
section CPUID_Fn00000001_EAX for how to calculate the family
from the BaseFamily and ExtFamily values.This matches the code in arch/x86/lib/cpu.c
Signed-off-by: Calvin Walton
Signed-off-by: Len Brown
27 Jul, 2018
3 commits
-
turbostat fails on some multi-package topologies because the logical node
enumeration assumes that the nodes are sequentially numbered,
which causes the logical numa nodes to not be enumerated, or enumerated incorrectly.Use a more robust enumeration algorithm which allows for non-seqential physical nodes.
Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
A recently added x2apic debug message was hard-coded to stderr.
That doesn't work with "-o outfile".Signed-off-by: Len Brown
-
This patch fixes a regression introduced in
commit 8cb48b32a5de ("tools/power turbostat: track thread ID in cpu_topology")
Turbostat uses incorrect cores number ('topo.num_cores') - its value is count
of logical CPUs, instead of count of physical cores. So it is twice as large as
it should be on a typical Intel system. For example, on a 6 core Xeon system
'topo.num_cores' is 12, and on a 52 core Xeon system 'topo.num_cores' is 104.And interestingly, on a 68-core Knights Landing Intel system 'topo.num_cores'
is 272, because this system has 4 logical CPUs per core.As a result, some of the turbostat calculations are incorrect. For example,
on idle 52-core Xeon system when all cores are ~99% in Core C6 (CPU%c6), the
summary (very first) line shows ~48% Core C6, while it should be ~99%.This patch fixes the problem by fixing 'topo.num_cores' calculation.
Was:
1. Init 'thread_id' for all CPUs to -1
2. Run 'get_thread_siblings()' which sets it to 0 or 1
3. Increment 'topo.num_cores' when thread_id != -1 (bug!)Now:
1. Init 'thread_id' for all CPUs to -1
2. Run 'get_thread_siblings()' which sets it to 0 or 1
3. Increment 'topo.num_cores' when thread_id is not 0I did not have a chance to test this on an AMD machine, and only tested on a
couple of Intel Xeons (6 and 52 cores).Reported-by: Vladislav Govtva
Signed-off-by: Artem Bityutskiy
Signed-off-by: Len Brown
21 Jul, 2018
1 commit
-
The -S (system summary) option failed to print any data on a 1-processor system.
Reported-by: Artem Bityutskiy
Signed-off-by: Len Brown
18 Jul, 2018
1 commit
-
Explain that this column may increment for some throttling causes,
and may not increment for others.Signed-off-by: Len Brown
21 Jun, 2018
9 commits
-
Pull turbostat utility changes for 4.18-rc2 from Len Brown.
"This includes two regression fixes, plus a couple more random, but
worthy, patches."* 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
tools/power turbostat: version 18.06.20
tools/power turbostat: add the missing command line switches
tools/power turbostat: add single character tokens to help
tools/power turbostat: alphabetize the help output
tools/power turbostat: fix segfault on 'no node' machines
tools/power turbostat: add optional APIC X2APIC columns
tools/power turbostat: decode cpuid.1.HT
tools/power turbostat: fix show/hide issues resulting from mis-merge -
Signed-off-by: Len Brown
-
Document the missing command line tokens in the help() function.
Signed-off-by: Nathan Ciobanu
Signed-off-by: Len Brown -
Improve the help() output by adding the single character
tokens (e.g -a).Signed-off-by: Nathan Ciobanu
Signed-off-by: Len Brown -
Sort the command line arguments output of help() in
alphabetical order in line with other linux tools.Signed-off-by: Nathan Ciobanu
Signed-off-by: Len Brown -
Running turbostat on machines that don't expose nodes
in sysfs (no /sys/bus/node) causes a segfault or a -nan
value diesplayed in the log. This is caused by
physical_node_id being reported as -1 and logical_node_id
being calculated as a negative number resulting in the new
GET_THREAD/GET_CORE returning an incorrect address.Signed-off-by: Nathan Ciobanu
Signed-off-by: Len Brown -
Add APIC and X2APIC columns to the topology section.
They are disabled-by-default -- enable like so:
--debug
or
--enable APIC,X2APICSigned-off-by: Len Brown
-
eg. the "HT" here:
CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TMSigned-off-by: Len Brown
-
The --show and --hide options failed on "Node", which was listed as "Node%".
The --show and --hide options were generally fouled-up do due to come
content merges that scrambled the list of column name indexes.Signed-off-by: Len Brown
16 Jun, 2018
1 commit
-
As we move stuff around, some doc references are broken. Fix some of
them via this script:
./scripts/documentation-file-ref-check --fixManually checked if the produced result is valid, removing a few
false-positives.Acked-by: Takashi Iwai
Acked-by: Masami Hiramatsu
Acked-by: Stephen Boyd
Acked-by: Charles Keepax
Acked-by: Mathieu Poirier
Reviewed-by: Coly Li
Signed-off-by: Mauro Carvalho Chehab
Acked-by: Jonathan Corbet
06 Jun, 2018
1 commit
-
Pull cpupower updates for v4.18-rc1 from Shuah Khan:
"This cpupower update for 4.18-rc1 consists of two minor fixes."
* tag 'linux-cpupower-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
cpupower : Fix header name to read idle state name
cpupower: fix spelling mistake: "logilename" -> "logfilename"
03 Jun, 2018
1 commit
02 Jun, 2018
15 commits
-
Signed-off-by: Len Brown
-
Output a Node column if there is more than one node/socket.
Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
The previous patches have added node information to turbostat, but the
counters code does not take it into account.Add node information from cpu_topology calculations to turbostat
counters.Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
Cleanup, remove num_ from num_nodes_per_pkg, num_cores_per_node, and
num_threads_per_node.Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
turbostat incorrectly assumes that there is one node per package. As a
result num_cores_per_pkg is not correctly named and is actually
num_cores_per_node.Rename num_cores_per_pkg to num_cores_per_node.
Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
The code can be simplified if the cpu_topology *cpus tracks the thread
IDs. This removes an additional file lookup and simplifies the counter
initialization code.Add thread ID to cpu_topology information and cleanup the counter
initialization code.v2: prevent thread_id from being overwritten
Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
The code currently assumes each package has exactly one node. This is not
the case for AMD systems and Intel systems with COD. AMD systems also
may re-enumerate each node's core IDs starting at 0 (for example, an AMD
processor may have two nodes, each with core IDs from 0 to 7). In order
to properly enumerate the cores we need to track both the physical and
logical node IDs.Add physical_node_id to track the node ID assigned by the kernel, and
logical_node_id used by turbostat to track the nodes per package ie) a
0-based count within the package.Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
The turbostat code only looks at thread_siblings_list to determine if
processing units/threads are on the same the core. This works well on
Intel systems which have a shared L1 instruction and data cache. This
does not work on AMD systems which have shared L1 instruction cache but
separate L1 data caches. Other utilities also check sibling's core ID
to determine if the processing unit shares the same core.Additionally, the cpu_topology *cpus list used in topology_probe() can
be used elsewhere in the code to simplify things.Export *cpus to the entire turbostat code, and add Processing Unit/Thread
IDs information to each cpu_topology struct. Confirm that the thread
is on the same core as indicated by thread_siblings_list.[v2]: Fixup CPU_* usage that caused gcc malloc error.
Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
Future fixes will use sysfs files that contain cpumask output. The code
needs to know the length of the cpumask in order to determine which cpus
are set in a cpumask. Currently topo.max_cpu_num is the maximum cpu
number. It can be increased the the maximum value of cpus represented in
cpumasks.Set max_num_cpus to the length of a cpumask.
Signed-off-by: Prarit Bhargava
Signed-off-by: Len Brown -
There's a use case during test to only print specific round of iterations
if --num_iterations is specified, for example, with this patch applied:turbostat -i 5 -n 4
will capture 4 samples with 5 seconds interval.[lenb: renamed to --num_iterations from --iterations]
Reviewed-by: Rafael J. Wysocki
Signed-off-by: Chen Yu
Reviewed-by: Artem Bityutskiy
Signed-off-by: Len Brown -
All MSRs related to turbostat are same as Kabylake.
Even though SDM claims that core C3 residency can be read from MSR 0x662,
the read on this MSR fails on CNL platform. Hence disabled C3 MSR read
and display.Signed-off-by: Srinivas Pandruvada
Signed-off-by: Len Brown -
The SNB_C1_AUTO_UNDEMOTE definition should have been deleted once
it was copied into msr-index.h. One copy of the truth is better --
particularly when Matt needs to fix it:-)Signed-off-by: Len Brown
-
According to the Intel Software Developers' Manual, Vol. 4, Order No.
335592, these macros have been reversed since they were added.Fixes: 889facbee3e6 ("tools/power turbostat: v3.0: monitor Watts and Temperature")
Signed-off-by: Matt Turner
Signed-off-by: Len Brown -
Like the "C1" and "C1%" column, the new POLL and POLL% columns
show invocations and residency% during the measurement interval.While it didn't seem important to track in the past,
we've recently found some Linux cpuidle bugs related to POLL%.Signed-off-by: Len Brown
-
The column header for PC10 residency is "Pk%pc10"
This is missing the 'g' that others have, eg Pkg%pc6,
to allow tab-delimited columns to fit into 8-columns.However, --hide Pk%pc10 did not work, it was still looking for the 'g'.
This was confusing, because --list shows the correct "Pk%pc10"Reported-by: Wendy Wang
Signed-off-by: Len Brown