Skip to content

Commit

Permalink
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/tip/linux-2.6-tip

* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (146 commits)
  tools, perf: Documentation for the power events API
  perf: Add calls to suspend trace point
  perf script: Make some lists static
  perf script: Use the default lost event handler
  perf session: Warn about errors when processing pipe events too
  perf tools: Fix perf_event.h header usage
  perf test: Clarify some error reports in the open syscall test
  x86, NMI: Add touch_nmi_watchdog to io_check_error delay
  x86: Avoid calling arch_trigger_all_cpu_backtrace() at the same time
  x86: Only call smp_processor_id in non-preempt cases
  perf timechart: Adjust perf timechart to the new power events
  perf: Clean up power events by introducing new, more generic ones
  perf: Do not export power_frequency, but power_start event
  perf test: Add test for counting open syscalls
  perf evsel: Auto allocate resources needed for some methods
  perf evsel: Use {cpu,thread}_map to shorten list of parameters
  perf tools: Refactor all_tids to hold nr and the map
  perf tools: Refactor cpumap to hold nr and the map
  perf evsel: Introduce per cpu and per thread open helpers
  perf evsel: Steal the counter reading routines from stat
  ...
  • Loading branch information
torvalds committed Jan 6, 2011
2 parents f3b0cfa + 4b95f13 commit 28d9bfc
Show file tree
Hide file tree
Showing 207 changed files with 4,917 additions and 3,447 deletions.
2 changes: 0 additions & 2 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -2365,8 +2365,6 @@ E: acme@redhat.com
W: http://oops.ghostprotocols.net:81/blog/
P: 1024D/9224DF01 D5DF E3BB E3C8 BCBB F8AD 841A B6AB 4681 9224 DF01
D: IPX, LLC, DCCP, cyc2x, wl3501_cs, net/ hacks
S: R. Brasílio Itiberê, 4270/1010 - Água Verde
S: 80240-060 - Curitiba - Paraná
S: Brazil

N: Karsten Merker
Expand Down
10 changes: 1 addition & 9 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1579,20 +1579,12 @@ and is between 256 and 4096 characters. It is defined in the file

nmi_watchdog= [KNL,BUGS=X86] Debugging features for SMP kernels
Format: [panic,][num]
Valid num: 0,1,2
Valid num: 0
0 - turn nmi_watchdog off
1 - use the IO-APIC timer for the NMI watchdog
2 - use the local APIC for the NMI watchdog using
a performance counter. Note: This will use one
performance counter and the local APIC's performance
vector.
When panic is specified, panic when an NMI watchdog
timeout occurs.
This is useful when you use a panic=... timeout and
need the box quickly up again.
Instead of 1 and 2 it is possible to use the following
symbolic names: lapic and ioapic
Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic

netpoll.carrier_timeout=
[NET] Specifies amount of time (in seconds) that
Expand Down
90 changes: 90 additions & 0 deletions Documentation/trace/events-power.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

Subsystem Trace Points: power

The power tracing system captures events related to power transitions
within the kernel. Broadly speaking there are three major subheadings:

o Power state switch which reports events related to suspend (S-states),
cpuidle (C-states) and cpufreq (P-states)
o System clock related changes
o Power domains related changes and transitions

This document describes what each of the tracepoints is and why they
might be useful.

Cf. include/trace/events/power.h for the events definitions.

1. Power state switch events
============================

1.1 New trace API
-----------------

A 'cpu' event class gathers the CPU-related events: cpuidle and
cpufreq.

cpu_idle "state=%lu cpu_id=%lu"
cpu_frequency "state=%lu cpu_id=%lu"

A suspend event is used to indicate the system going in and out of the
suspend mode:

machine_suspend "state=%lu"


Note: the value of '-1' or '4294967295' for state means an exit from the current state,
i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
means that the system exits the previous idle state.

The event which has 'state=4294967295' in the trace is very important to the user
space tools which are using it to detect the end of the current state, and so to
correctly draw the states diagrams and to calculate accurate statistics etc.

1.2 DEPRECATED trace API
------------------------

A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
'y' has been created. This allows the legacy trace power API to be used conjointly
with the new trace API.
The Kconfig option, the old trace API (in include/trace/events/power.h) and the
old trace points will disappear in a future release (namely 2.6.41).

power_start "type=%lu state=%lu cpu_id=%lu"
power_frequency "type=%lu state=%lu cpu_id=%lu"
power_end "cpu_id=%lu"

The 'type' parameter takes one of those macros:
. POWER_NONE = 0,
. POWER_CSTATE = 1, /* C-State */
. POWER_PSTATE = 2, /* Fequency change or DVFS */

The 'state' parameter is set depending on the type:
. Target C-state for type=POWER_CSTATE,
. Target frequency for type=POWER_PSTATE,

power_end is used to indicate the exit of a state, corresponding to the latest
power_start event.

2. Clocks events
================
The clock events are used for clock enable/disable and for
clock rate change.

clock_enable "%s state=%lu cpu_id=%lu"
clock_disable "%s state=%lu cpu_id=%lu"
clock_set_rate "%s state=%lu cpu_id=%lu"

The first parameter gives the clock name (e.g. "gpio1_iclk").
The second parameter is '1' for enable, '0' for disable, the target
clock rate for set_rate.

3. Power domains events
=======================
The power domain events are used for power domains transitions

power_domain_target "%s state=%lu cpu_id=%lu"

The first parameter gives the power domain name (e.g. "mpu_pwrdm").
The second parameter is the power domain target state.

2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4627,7 +4627,7 @@ PERFORMANCE EVENTS SUBSYSTEM
M: Peter Zijlstra <a.p.zijlstra@chello.nl>
M: Paul Mackerras <paulus@samba.org>
M: Ingo Molnar <mingo@elte.hu>
M: Arnaldo Carvalho de Melo <acme@redhat.com>
M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
S: Supported
F: kernel/perf_event*.c
F: include/linux/perf_event.h
Expand Down
6 changes: 0 additions & 6 deletions arch/alpha/include/asm/perf_event.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#ifndef __ASM_ALPHA_PERF_EVENT_H
#define __ASM_ALPHA_PERF_EVENT_H

#ifdef CONFIG_PERF_EVENTS
extern void init_hw_perf_events(void);
#else
static inline void init_hw_perf_events(void) { }
#endif

#endif /* __ASM_ALPHA_PERF_EVENT_H */
2 changes: 0 additions & 2 deletions arch/alpha/kernel/irq_alpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ init_IRQ(void)
wrent(entInt, 0);

alpha_mv.init_irq();

init_hw_perf_events();
}

/*
Expand Down
11 changes: 7 additions & 4 deletions arch/alpha/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/kdebug.h>
#include <linux/mutex.h>
#include <linux/init.h>

#include <asm/hwrpb.h>
#include <asm/atomic.h>
Expand Down Expand Up @@ -863,13 +864,13 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,
/*
* Init call to initialise performance events at kernel startup.
*/
void __init init_hw_perf_events(void)
int __init init_hw_perf_events(void)
{
pr_info("Performance events: ");

if (!supported_cpu()) {
pr_cont("No support for your CPU.\n");
return;
return 0;
}

pr_cont("Supported CPU type!\n");
Expand All @@ -881,6 +882,8 @@ void __init init_hw_perf_events(void)
/* And set up PMU specification */
alpha_pmu = &ev67_pmu;

perf_pmu_register(&pmu);
}
perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);

return 0;
}
early_initcall(init_hw_perf_events);
4 changes: 2 additions & 2 deletions arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -3034,11 +3034,11 @@ init_hw_perf_events(void)
pr_info("no hardware support available\n");
}

perf_pmu_register(&pmu);
perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);

return 0;
}
arch_initcall(init_hw_perf_events);
early_initcall(init_hw_perf_events);

/*
* Callchain handling code.
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/perf_event_mipsxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,6 @@ init_hw_perf_events(void)

return 0;
}
arch_initcall(init_hw_perf_events);
early_initcall(init_hw_perf_events);

#endif /* defined(CONFIG_CPU_MIPS32)... */
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/e500-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ static int init_e500_pmu(void)
return register_fsl_emb_pmu(&e500_pmu);
}

arch_initcall(init_e500_pmu);
early_initcall(init_e500_pmu);
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/mpc7450-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,4 @@ static int init_mpc7450_pmu(void)
return register_power_pmu(&mpc7450_pmu);
}

arch_initcall(init_mpc7450_pmu);
early_initcall(init_mpc7450_pmu);
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ int register_power_pmu(struct power_pmu *pmu)
freeze_events_kernel = MMCR0_FCHV;
#endif /* CONFIG_PPC64 */

perf_pmu_register(&power_pmu);
perf_pmu_register(&power_pmu, "cpu", PERF_TYPE_RAW);
perf_cpu_notifier(power_pmu_notifier);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/perf_event_fsl_emb.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
pr_info("%s performance monitor hardware support registered\n",
pmu->name);

perf_pmu_register(&fsl_emb_pmu);
perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW);

return 0;
}
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/power4-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,4 @@ static int init_power4_pmu(void)
return register_power_pmu(&power4_pmu);
}

arch_initcall(init_power4_pmu);
early_initcall(init_power4_pmu);
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/power5+-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,4 @@ static int init_power5p_pmu(void)
return register_power_pmu(&power5p_pmu);
}

arch_initcall(init_power5p_pmu);
early_initcall(init_power5p_pmu);
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/power5-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,4 +621,4 @@ static int init_power5_pmu(void)
return register_power_pmu(&power5_pmu);
}

arch_initcall(init_power5_pmu);
early_initcall(init_power5_pmu);
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/power6-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,4 +544,4 @@ static int init_power6_pmu(void)
return register_power_pmu(&power6_pmu);
}

arch_initcall(init_power6_pmu);
early_initcall(init_power6_pmu);
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/power7-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,4 @@ static int init_power7_pmu(void)
return register_power_pmu(&power7_pmu);
}

arch_initcall(init_power7_pmu);
early_initcall(init_power7_pmu);
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/ppc970-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,4 +494,4 @@ static int init_ppc970_pmu(void)
return register_power_pmu(&ppc970_pmu);
}

arch_initcall(init_ppc970_pmu);
early_initcall(init_ppc970_pmu);
2 changes: 1 addition & 1 deletion arch/sh/kernel/cpu/sh4/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,4 @@ static int __init sh7750_pmu_init(void)

return register_sh_pmu(&sh7750_pmu);
}
arch_initcall(sh7750_pmu_init);
early_initcall(sh7750_pmu_init);
2 changes: 1 addition & 1 deletion arch/sh/kernel/cpu/sh4a/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,4 @@ static int __init sh4a_pmu_init(void)

return register_sh_pmu(&sh4a_pmu);
}
arch_initcall(sh4a_pmu_init);
early_initcall(sh4a_pmu_init);
2 changes: 1 addition & 1 deletion arch/sh/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ int __cpuinit register_sh_pmu(struct sh_pmu *_pmu)

WARN_ON(_pmu->num_events > MAX_HWEVENTS);

perf_pmu_register(&pmu);
perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);
perf_cpu_notifier(sh_pmu_notifier);
return 0;
}
4 changes: 0 additions & 4 deletions arch/sparc/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#ifdef CONFIG_PERF_EVENTS
#include <asm/ptrace.h>

extern void init_hw_perf_events(void);

#define perf_arch_fetch_caller_regs(regs, ip) \
do { \
unsigned long _pstate, _asi, _pil, _i7, _fp; \
Expand All @@ -26,8 +24,6 @@ do { \
(regs)->u_regs[UREG_I6] = _fp; \
(regs)->u_regs[UREG_I7] = _i7; \
} while (0)
#else
static inline void init_hw_perf_events(void) { }
#endif

#endif
2 changes: 0 additions & 2 deletions arch/sparc/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ int __init nmi_init(void)
atomic_set(&nmi_active, -1);
}
}
if (!err)
init_hw_perf_events();

return err;
}
Expand Down
9 changes: 6 additions & 3 deletions arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,20 +1307,23 @@ static bool __init supported_pmu(void)
return false;
}

void __init init_hw_perf_events(void)
int __init init_hw_perf_events(void)
{
pr_info("Performance events: ");

if (!supported_pmu()) {
pr_cont("No support for PMU type '%s'\n", sparc_pmu_type);
return;
return 0;
}

pr_cont("Supported PMU type is '%s'\n", sparc_pmu_type);

perf_pmu_register(&pmu);
perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);
register_die_notifier(&perf_event_nmi_notifier);

return 0;
}
early_initcall(init_hw_perf_events);

void perf_callchain_kernel(struct perf_callchain_entry *entry,
struct pt_regs *regs)
Expand Down
7 changes: 7 additions & 0 deletions arch/x86/include/asm/alternative.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,15 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len);
* On the local CPU you need to be protected again NMI or MCE handlers seeing an
* inconsistent instruction while you patch.
*/
struct text_poke_param {
void *addr;
const void *opcode;
size_t len;
};

extern void *text_poke(void *addr, const void *opcode, size_t len);
extern void *text_poke_smp(void *addr, const void *opcode, size_t len);
extern void text_poke_smp_batch(struct text_poke_param *params, int n);

#if defined(CONFIG_DYNAMIC_FTRACE) || defined(HAVE_JUMP_LABEL)
#define IDEAL_NOP_SIZE_5 5
Expand Down
4 changes: 0 additions & 4 deletions arch/x86/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ static inline int irq_canonicalize(int irq)
return ((irq == 2) ? 9 : irq);
}

#ifdef CONFIG_X86_LOCAL_APIC
# define ARCH_HAS_NMI_WATCHDOG
#endif

#ifdef CONFIG_X86_32
extern void irq_ctx_init(int cpu);
#else
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/kdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern void die(const char *, struct pt_regs *,long);
extern int __must_check __die(const char *, struct pt_regs *, long);
extern void show_registers(struct pt_regs *regs);
extern void show_trace(struct task_struct *t, struct pt_regs *regs,
unsigned long *sp, unsigned long bp);
unsigned long *sp);
extern void __show_regs(struct pt_regs *regs, int all);
extern void show_regs(struct pt_regs *regs);
extern unsigned long oops_begin(void);
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
#define MSR_AMD64_IBSCTL 0xc001103a
#define MSR_AMD64_IBSBRTARGET 0xc001103b

/* Fam 15h MSRs */
#define MSR_F15H_PERF_CTL 0xc0010200
#define MSR_F15H_PERF_CTR 0xc0010201

/* Fam 10h MSRs */
#define MSR_FAM10H_MMIO_CONF_BASE 0xc0010058
#define FAM10H_MMIO_CONF_ENABLE (1<<0)
Expand Down
Loading

0 comments on commit 28d9bfc

Please sign in to comment.