2005-04-17 05:20:36 +07:00
|
|
|
#
|
2008-12-03 16:39:53 +07:00
|
|
|
# Makefile for x86-compatible CPU details, features and quirks
|
2005-04-17 05:20:36 +07:00
|
|
|
#
|
|
|
|
|
2008-12-25 05:30:02 +07:00
|
|
|
# Don't trace early stages of a secondary CPU boot
|
|
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
|
|
CFLAGS_REMOVE_common.o = -pg
|
2009-11-23 16:19:20 +07:00
|
|
|
CFLAGS_REMOVE_perf_event.o = -pg
|
2008-12-25 05:30:02 +07:00
|
|
|
endif
|
|
|
|
|
2009-08-18 02:25:41 +07:00
|
|
|
# Make sure load_percpu_segment has no stackprotector
|
|
|
|
nostackp := $(call cc-option, -fno-stack-protector)
|
|
|
|
CFLAGS_common.o := $(nostackp)
|
|
|
|
|
2010-07-20 08:32:04 +07:00
|
|
|
obj-y := intel_cacheinfo.o scattered.o topology.o
|
2013-10-30 22:09:45 +07:00
|
|
|
obj-y += common.o
|
2011-08-01 04:02:19 +07:00
|
|
|
obj-y += rdrand.o
|
2012-01-26 06:09:05 +07:00
|
|
|
obj-y += match.o
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2013-10-30 21:21:53 +07:00
|
|
|
obj-$(CONFIG_PROC_FS) += proc.o
|
2013-10-30 22:09:45 +07:00
|
|
|
obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o
|
2013-10-30 21:21:53 +07:00
|
|
|
|
2010-07-29 06:53:49 +07:00
|
|
|
obj-$(CONFIG_X86_32) += bugs.o
|
2008-09-05 10:09:14 +07:00
|
|
|
obj-$(CONFIG_X86_64) += bugs_64.o
|
2008-08-05 16:45:19 +07:00
|
|
|
|
2008-09-10 06:40:37 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_INTEL) += intel.o
|
2008-09-08 07:58:56 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_AMD) += amd.o
|
2008-08-05 16:45:19 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o
|
2009-03-14 18:24:02 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o
|
2008-08-05 16:45:19 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o
|
|
|
|
obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2011-08-31 06:41:05 +07:00
|
|
|
ifdef CONFIG_PERF_EVENTS
|
2016-02-08 23:09:05 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_uncore.o
|
2013-06-06 04:11:49 +07:00
|
|
|
ifdef CONFIG_AMD_IOMMU
|
|
|
|
obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_iommu.o
|
|
|
|
endif
|
2012-09-27 01:12:52 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o
|
2012-06-15 13:31:34 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o
|
2015-02-27 01:47:00 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_rapl.o perf_event_intel_cqm.o
|
2015-01-30 17:40:35 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_pt.o perf_event_intel_bts.o
|
perf/x86: Add Intel cstate PMUs support
This patch adds new PMUs to support cstate related free running
(read-only) counters. These counters may be used simultaneously by other
tools, such as turbostat. However, it still make sense to implement them
in perf. Because we can conveniently collect them together with other
events, and allow to use them from tools without special MSR access
code.
These counters include CORE_C*_RESIDENCY and PKG_C*_RESIDENCY.
According to counters' scope and category, two PMUs are registered with
the perf_event core subsystem.
- 'cstate_core': The counter is available for each physical core. The
counters include CORE_C*_RESIDENCY.
- 'cstate_pkg': The counter is available for each physical package. The
counters include PKG_C*_RESIDENCY.
The events are exposed in sysfs for use by perf stat and other tools.
The files are:
/sys/devices/cstate_core/events/c*-residency
/sys/devices/cstate_pkg/events/c*-residency
These events only support system-wide mode counting.
The /sys/devices/cstate_*/cpumask file can be used by tools to figure
out which CPUs to monitor by default.
The PMU type (attr->type) is dynamically allocated and is available from
/sys/devices/core_misc/type and /sys/device/cstate_*/type.
Sampling is not supported.
Here is an example.
- To caculate the fraction of time when the core is running in C6 state
CORE_C6_time% = CORE_C6_RESIDENCY / TSC
# perf stat -x, -e"cstate_core/c6-residency/,msr/tsc/" -C0 -- taskset -c 0 sleep 5
11838820015,,cstate_core/c6-residency/,5175919658,100.00
11877130740,,msr/tsc/,5175922010,100.00
For sleep, 99.7% of time we ran in C6 state.
# perf stat -x, -e"cstate_core/c6-residency/,msr/tsc/" -C0 -- taskset -c 0 busyloop
1253316,,cstate_core/c6-residency/,4360969154,100.00
10012635248,,msr/tsc/,4360972366,100.00
For busyloop, 0.01% of time we ran in C6 state.
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: acme@kernel.org
Cc: eranian@google.com
Link: http://lkml.kernel.org/r/1443443404-8581-1-git-send-email-kan.liang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-09-28 19:30:04 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_cstate.o
|
2014-10-24 14:12:35 +07:00
|
|
|
|
|
|
|
obj-$(CONFIG_PERF_EVENTS_INTEL_UNCORE) += perf_event_intel_uncore.o \
|
|
|
|
perf_event_intel_uncore_snb.o \
|
|
|
|
perf_event_intel_uncore_snbep.o \
|
|
|
|
perf_event_intel_uncore_nhmex.o
|
2015-07-20 22:49:06 +07:00
|
|
|
obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_msr.o
|
|
|
|
obj-$(CONFIG_CPU_SUP_AMD) += perf_event_msr.o
|
2011-08-31 06:41:05 +07:00
|
|
|
endif
|
|
|
|
|
2013-06-06 04:11:49 +07:00
|
|
|
|
2008-12-03 16:39:53 +07:00
|
|
|
obj-$(CONFIG_X86_MCE) += mcheck/
|
|
|
|
obj-$(CONFIG_MTRR) += mtrr/
|
2013-12-02 00:09:58 +07:00
|
|
|
obj-$(CONFIG_MICROCODE) += microcode/
|
2008-12-03 16:39:53 +07:00
|
|
|
|
2011-09-21 16:30:18 +07:00
|
|
|
obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o perf_event_amd_ibs.o
|
2008-08-28 07:56:44 +07:00
|
|
|
|
2013-03-05 03:20:21 +07:00
|
|
|
obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
|
|
|
|
|
2013-10-30 22:09:45 +07:00
|
|
|
ifdef CONFIG_X86_FEATURE_NAMES
|
2008-08-28 07:56:44 +07:00
|
|
|
quiet_cmd_mkcapflags = MKCAP $@
|
2013-04-30 05:05:53 +07:00
|
|
|
cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $< $@
|
2008-08-28 07:56:44 +07:00
|
|
|
|
2008-08-18 08:05:42 +07:00
|
|
|
cpufeature = $(src)/../../include/asm/cpufeature.h
|
2008-08-28 07:56:44 +07:00
|
|
|
|
|
|
|
targets += capflags.c
|
2013-04-30 05:05:53 +07:00
|
|
|
$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE
|
2008-08-28 07:56:44 +07:00
|
|
|
$(call if_changed,mkcapflags)
|
2013-10-30 22:09:45 +07:00
|
|
|
endif
|
2014-12-23 18:57:43 +07:00
|
|
|
clean-files += capflags.c
|