aboutsummaryrefslogtreecommitdiffstats
path: root/tools/misc/xenpm.c
Commit message (Collapse)AuthorAgeFilesLines
* cpufreq, xenpm: fix cpufreq and xenpm mismatchJacob Shin2013-07-021-11/+3
| | | | | | | | Currently cpufreq and xenpm are out of sync. Fix cpufreq reporting of if turbo mode is enabled or not. Fix xenpm to not decode for tristate, but a boolean. Signed-off-by: Jacob Shin <jacob.shin@amd.com>
* xenpm: make argument parsing and error handling more consistentJan Beulich2012-09-171-170/+149
| | | | | | | | | | | | | | | Specifically, what values are or aren't accepted as CPU identifier, and how the values get interpreted should be consistent across sub-commands (intended behavior now: non-negative values are okay, and along with omitting the argument, specifying "all" will also be accepted). For error handling, error messages should get consistently issued to stderr, and the tool should now (hopefully) produce an exit code of zero only in the (partial) success case (there may still be a small number of questionable cases). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xenpm, x86: Fix reporting of idle state average residency timesBoris Ostrovsky2012-06-061-1/+8
| | | | | | | | | | | | If CPU stays in the same idle state for the full duration of xenpm sample then average residency may not be reported correctly since usage counter will not be incremented. In addition, in order to calculate averages correctly residence time and usage counter should be read and written atomically. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Committed-by: Keir Fraser <keir@xen.org>
* xenpm: Fix reporting of C0 residence timesBoris Ostrovsky2012-05-301-4/+10
| | | | | | | | | | | Idle state residence times as provided by pmstat_get_cx_stat() are not reported precisely since remote core may be in idle state and therefore has not updated its statistics at the time local core collected them. This causes C0 residencies as calculated by xenpm to sometimes become negative. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Committed-by: Keir Fraser <keir@xen.org>
* xenpm: assorted adjustmentsJan Beulich2012-01-101-42/+31
| | | | | | | | | | | | | | | | | - use consistent error values (stop mixing of [positive] errno values with literal -E... ones) - properly format output - don't use leading zeros in decimal output - move printing of average frequency into P-state conditional (rather than a C-state one) - don't print some C-state related info when CPU idle management is disabled in the hypervisor - use calloc() for array allocations that also got cleared via memset() so far Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* x86 pm: provide CC7/PC2 residencyYang Zhang2011-10-251-4/+14
| | | | | | | | | Sandy bridge introduces new MSR to get cc7/pc2 residency (core C-state 7/package C-state 2). Print the cc7/pc2 residency when on sandy bridge platform. Signed-off-by: Yang Zhang <yang.z.zhang@intel.com> Committed-by: Keir Fraser <keir@xen.org>
* xenpm: clean up print messagesKevin Tian2011-07-081-2/+9
| | | | Signed-off-by Kevin Tian <kevin.tian@intel.com>
* libxc: finalise transition to hypercall buffers.Ian Campbell2010-10-221-6/+6
| | | | | | | | | | | | | | | | | | | | | Rename xc_set_xen_guest_handle to set_xen_guest_handle[0] and remove now unused functions: - xc_memalign - lock_pages - unlock_pages - hcall_buf_prep - hcall_buf_release [0] sed -i -e 's/xc_set_xen_guest_handle/set_xen_guest_handle/g' \ tools/libxc/*.[ch] \ tools/python/xen/lowlevel/xc/xc.c \ tools/python/xen/lowlevel/acm/acm.c \ tools/libxc/ia64/xc_ia64_stubs.c \ tools/security/secpol_tool.c \ tools/misc/xenpm.c Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* xenpm: use hypercall buffers.Ian Campbell2010-10-221-14/+42
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* tools/misc/xenpm: provide core/package cstate residenciesIan Jackson2010-07-141-3/+100
| | | | | | | | | | | | According to Intel 64 and IA32 Architectures SDM 3B Appendix B, Intel Nehalem/Westmere processors provide h/w MSR to report the core/package cstate residencies.Extend sysctl_get_pmstat interface to pass the core/package cstate residencies, and modify xenpm to output those information. [tools part of the patch] Signed-off-by: Wei Gang <gang.wei@intel.com>
* tools/misc/xenpm: fix get-cpu-topologyIan Jackson2010-07-131-1/+1
| | | | | | fix get-cpu-topology Signed-off-by: Wei Gang <gang.wei@intel.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-61/+61
| | | | | | | | | | | | | | | | | | | | This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xenpm: remove wrong and pointless "current" indicatorKeir Fraser2010-05-071-4/+1
| | | | | | | | | Using the CPU number to compare with an index into an array containing only a subset of CPUs isn't valid. And indicator isn't necessary here at all since the CPU number being dealt with gets printed right before this line. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Topology-info sysctl cleanups.Keir Fraser2010-04-131-22/+22
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Refactor Xen Support for Intel Turbo BoostKeir Fraser2010-04-091-4/+14
| | | | | | | | | | Refactor the existing code that supports the Intel Turbo feature to move all the driver specific bits in the cpufreq driver. Create a tri-state interface for the Turbo feature that can distinguish amongst enabled Turbo, disabled Turbo, and processors that don't support Turbo at all. Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
* xenpm: Allow user to enable/disable dbs governor turbo mode.Keir Fraser2010-02-081-0/+50
| | | | Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
* xenpm: Set scheduler vcpu_migration_delay by xenpmKeir Fraser2009-04-061-0/+52
| | | | | Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
* xenpm: add cmd set-max-cstateKeir Fraser2009-03-311-1/+34
| | | | Signed-off-by: Wei Gang <gang.wei@intel.com>
* xenpm: Add a small scheduler knob "sched_smt_power_savings"Keir Fraser2009-03-201-0/+32
| | | | | | | | | Current scheduler only care performance, thus always picks pCPU from the most idle package. This knob provides another option to pick pCPU from least idle package, for user who want performance power balance. Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Tian Kevin <kevin.tian@intel.com>
* Add cpufreq actual average freq information to xenpm toolsKeir Fraser2009-03-201-0/+32
| | | | Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
* cpuidle and xenpm small cleanups.Keir Fraser2009-03-191-3/+0
| | | | Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
* xenpm: add timeout option to 'xenpm start' command.Keir Fraser2009-03-191-3/+27
| | | | | | Thus we can sample a fixed time of period without manual interruption. Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
* xenpm: Add CPU topology info (thread/core/socket)Keir Fraser2009-03-131-0/+36
| | | | | | | | | | | | CPU topology info is necessary for power management analysis. For example, to analysis the effect of Px state coordination, Cx package/core coordination, the thread/core/socket topology information is needed. This patch add new command "get-cpu-topology" in xenpm to print the CPU topology info: Signed-off-by: Yu Ke <ke.yu@intel.com>
* xenpm tool: add average C state residencyKeir Fraser2009-02-171-19/+19
| | | | Signed-off-by: Yu Ke <ke.yu@intel.com>
* xenpm: build fixKeir Fraser2009-01-141-0/+1
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* xenpm tool enhancementsKeir Fraser2009-01-081-243/+454
| | | | | | | | | | | | | | | | | | | Two enhancements are made in this patch: 1. Make cpuid in command line optional: if user does not provide cpuid, xenpm will operate on all the CPUs. this will easy the xenpm usage. e.g. to set the cpufreq governor, user usually want to set the governor on all CPUs. User can accomplish this easily with this enhancement. 2. Add another option "xenpm start" to calculate the Cx/Px state residency percentage during specified period. when user issue "xenpm start", xenpm will start to record the Cx/Px state residency. when user issue CTRL-C, xenpm will stop and show the Cx/Px state residency and percentage of this period. this is helpful to measure the xenpm effect for speficied workload. Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>Signed-off-by: Ke Yu <ke.yu@intel.com>
* CPUIDLE: adjust cstate statistic interfaceKeir Fraser2008-12-191-1/+1
| | | | | | | | 1. change unit of residency, PM ticks -> ns. 2. output C0 usage & residency. Signed-off-by: Wei Gang <gang.wei@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xenpm: add cpu frequency control interface, through which user canKeir Fraser2008-12-161-142/+534
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tune the parameters manually. Now, xenpm can be invoked with the following options: Usage: xenpm get-cpuidle-states [cpuid]: list cpu idle information on CPU cpuid or all CPUs. xenpm get-cpufreq-states [cpuid]: list cpu frequency information on CPU cpuid or all CPUs. xenpm get-cpufreq-para [cpuid]: list cpu frequency information on CPU cpuid or all CPUs. xenpm set-scaling-maxfreq <cpuid> <HZ>: set max cpu frequency <HZ> on CPU <cpuid>. xenpm set-scaling-minfreq <cpuid> <HZ>: set min cpu frequency <HZ> on CPU <cpuid>. xenpm set-scaling-governor <cpuid> <name>: set scaling governor on CPU <cpuid>. xenpm set-scaling-speed <cpuid> <num>: set scaling speed on CPU <cpuid>. xenpm set-sampling-rate <cpuid> <num>: set sampling rate on CPU <cpuid>. xenpm set-up-threshold <cpuid> <num>: set up threshold on CPU <cpuid>. To ease the use of this tool, the shortcut option is supported, i.e. `xenpm get-cpui' is equal to `xenpm get-cpuidle-states'. Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
* xenpm: Fix an error path.Keir Fraser2008-11-071-1/+1
| | | | Signed-off-by: Jinsong Liu <jinsong.liu@intel.com>
* xenpm: Fix logic when Hyperthreading is enabled.Keir Fraser2008-10-131-19/+38
| | | | Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
* xenpm: Fix typo bug.Keir Fraser2008-10-091-1/+1
| | | | | From: Guanqun Lu <guanqun.lu@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Add xenpm utility to list CPU power info.Keir Fraser2008-09-251-0/+197
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>