diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-18 19:52:46 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-18 19:52:46 -0400 |
| commit | f82c37e7bb4c4d9b6a476c642d5c2d2efbd6f240 (patch) | |
| tree | 09fc553c2fb6f527962048d139159dc139e04afc | |
| parent | c6b9e73f2fee8bb86058f296de808b326473456b (diff) | |
| parent | dcd5c1662db59a6b82942f47fb6ac9dd63f6d3dd (diff) | |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (35 commits)
perf: Fix unexported generic perf_arch_fetch_caller_regs
perf record: Don't try to find buildids in a zero sized file
perf: export perf_trace_regs and perf_arch_fetch_caller_regs
perf, x86: Fix hw_perf_enable() event assignment
perf, ppc: Fix compile error due to new cpu notifiers
perf: Make the install relative to DESTDIR if specified
kprobes: Calculate the index correctly when freeing the out-of-line execution slot
perf tools: Fix sparse CPU numbering related bugs
perf_event: Fix oops triggered by cpu offline/online
perf: Drop the obsolete profile naming for trace events
perf: Take a hot regs snapshot for trace events
perf: Introduce new perf_fetch_caller_regs() for hot regs snapshot
perf/x86-64: Use frame pointer to walk on irq and process stacks
lockdep: Move lock events under lockdep recursion protection
perf report: Print the map table just after samples for which no map was found
perf report: Add multiple event support
perf session: Change perf_session post processing functions to take histogram tree
perf session: Add storage for seperating event types in report
perf session: Change add_hist_entry to take the tree root instead of session
perf record: Add ID and to recorded event data when recording multiple events
...
39 files changed, 741 insertions, 398 deletions
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c index 5120bd44f69a..08460a2e9f41 100644 --- a/arch/powerpc/kernel/perf_event.c +++ b/arch/powerpc/kernel/perf_event.c | |||
| @@ -1287,7 +1287,7 @@ static void perf_event_interrupt(struct pt_regs *regs) | |||
| 1287 | irq_exit(); | 1287 | irq_exit(); |
| 1288 | } | 1288 | } |
| 1289 | 1289 | ||
| 1290 | void hw_perf_event_setup(int cpu) | 1290 | static void power_pmu_setup(int cpu) |
| 1291 | { | 1291 | { |
| 1292 | struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); | 1292 | struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); |
| 1293 | 1293 | ||
| @@ -1297,6 +1297,23 @@ void hw_perf_event_setup(int cpu) | |||
| 1297 | cpuhw->mmcr[0] = MMCR0_FC; | 1297 | cpuhw->mmcr[0] = MMCR0_FC; |
| 1298 | } | 1298 | } |
| 1299 | 1299 | ||
| 1300 | static int __cpuinit | ||
| 1301 | power_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) | ||
| 1302 | { | ||
| 1303 | unsigned int cpu = (long)hcpu; | ||
| 1304 | |||
| 1305 | switch (action & ~CPU_TASKS_FROZEN) { | ||
| 1306 | case CPU_UP_PREPARE: | ||
| 1307 | power_pmu_setup(cpu); | ||
| 1308 | break; | ||
| 1309 | |||
| 1310 | default: | ||
| 1311 | break; | ||
| 1312 | } | ||
| 1313 | |||
| 1314 | return NOTIFY_OK; | ||
| 1315 | } | ||
| 1316 | |||
| 1300 | int register_power_pmu(struct power_pmu *pmu) | 1317 | int register_power_pmu(struct power_pmu *pmu) |
| 1301 | { | 1318 | { |
| 1302 | if (ppmu) | 1319 | if (ppmu) |
| @@ -1314,5 +1331,7 @@ int register_power_pmu(struct power_pmu *pmu) | |||
| 1314 | freeze_events_kernel = MMCR0_FCHV; | 1331 | freeze_events_kernel = MMCR0_FCHV; |
| 1315 | #endif /* CONFIG_PPC64 */ | 1332 | #endif /* CONFIG_PPC64 */ |
| 1316 | 1333 | ||
| 1334 | perf_cpu_notifier(power_pmu_notifier); | ||
| 1335 | |||
| 1317 | return 0; | 1336 | return 0; |
| 1318 | } | 1337 | } |
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 7ff0943e7a08..9f253e9cce01 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c | |||
| @@ -275,13 +275,30 @@ const struct pmu *hw_perf_event_init(struct perf_event *event) | |||
| 275 | return &pmu; | 275 | return &pmu; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | void hw_perf_event_setup(int cpu) | 278 | static void sh_pmu_setup(int cpu) |
| 279 | { | 279 | { |
| 280 | struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); | 280 | struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu); |
| 281 | 281 | ||
| 282 | memset(cpuhw, 0, sizeof(struct cpu_hw_events)); | 282 | memset(cpuhw, 0, sizeof(struct cpu_hw_events)); |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | static int __cpuinit | ||
| 286 | sh_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) | ||
| 287 | { | ||
| 288 | unsigned int cpu = (long)hcpu; | ||
| 289 | |||
| 290 | switch (action & ~CPU_TASKS_FROZEN) { | ||
| 291 | case CPU_UP_PREPARE: | ||
| 292 | sh_pmu_setup(cpu); | ||
| 293 | break; | ||
| 294 | |||
| 295 | default: | ||
| 296 | break; | ||
| 297 | } | ||
| 298 | |||
| 299 | return NOTIFY_OK; | ||
| 300 | } | ||
| 301 | |||
| 285 | void hw_perf_enable(void) | 302 | void hw_perf_enable(void) |
| 286 | { | 303 | { |
| 287 | if (!sh_pmu_initialized()) | 304 | if (!sh_pmu_initialized()) |
| @@ -308,5 +325,6 @@ int register_sh_pmu(struct sh_pmu *pmu) | |||
| 308 | 325 | ||
| 309 | WARN_ON(pmu->num_events > MAX_HWEVENTS); | 326 | WARN_ON(pmu->num_events > MAX_HWEVENTS); |
| 310 | 327 | ||
| 328 | perf_cpu_notifier(sh_pmu_notifier); | ||
| 311 | return 0; | 329 | return 0; |
| 312 | } | 330 | } |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 42aafd11e170..60398a0d947c 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -133,8 +133,8 @@ struct x86_pmu { | |||
| 133 | int (*handle_irq)(struct pt_regs *); | 133 | int (*handle_irq)(struct pt_regs *); |
| 134 | void (*disable_all)(void); | 134 | void (*disable_all)(void); |
| 135 | void (*enable_all)(void); | 135 | void (*enable_all)(void); |
| 136 | void (*enable)(struct hw_perf_event *, int); | 136 | void (*enable)(struct perf_event *); |
| 137 | void (*disable)(struct hw_perf_event *, int); | 137 | void (*disable)(struct perf_event *); |
| 138 | unsigned eventsel; | 138 | unsigned eventsel; |
| 139 | unsigned perfctr; | 139 | unsigned perfctr; |
| 140 | u64 (*event_map)(int); | 140 | u64 (*event_map)(int); |
| @@ -157,6 +157,11 @@ struct x86_pmu { | |||
| 157 | void (*put_event_constraints)(struct cpu_hw_events *cpuc, | 157 | void (*put_event_constraints)(struct cpu_hw_events *cpuc, |
| 158 | struct perf_event *event); | 158 | struct perf_event *event); |
| 159 | struct event_constraint *event_constraints; | 159 | struct event_constraint *event_constraints; |
| 160 | |||
| 161 | void (*cpu_prepare)(int cpu); | ||
| 162 | void (*cpu_starting)(int cpu); | ||
| 163 | void (*cpu_dying)(int cpu); | ||
| 164 | void (*cpu_dead)(int cpu); | ||
| 160 | }; | 165 | }; |
| 161 | 166 | ||
| 162 | static struct x86_pmu x86_pmu __read_mostly; | 167 | static struct x86_pmu x86_pmu __read_mostly; |
| @@ -165,8 +170,7 @@ static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { | |||
| 165 | .enabled = 1, | ||
