diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-03-12 04:20:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-12 04:20:59 -0500 |
commit | 937779db13fb6cb621e28d9ae0a6cf1d05b57d05 (patch) | |
tree | 6c27402677c347c4dc01980de78c270630588847 /arch | |
parent | 6230f2c7ef01a69e2ba9370326572c287209d32a (diff) | |
parent | 9f591fd76afdc0e5192e9ed00a36f8efc0b4dfe6 (diff) |
Merge branch 'perf/urgent' into perf/core
Merge reason: We want to queue up a dependent patch.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/perf_event.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 25 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack.h | 15 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 4 |
4 files changed, 34 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c index fbe101d7505d..08460a2e9f41 100644 --- a/arch/powerpc/kernel/perf_event.c +++ b/arch/powerpc/kernel/perf_event.c | |||
@@ -1298,7 +1298,7 @@ static void power_pmu_setup(int cpu) | |||
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | static int __cpuinit | 1300 | static int __cpuinit |
1301 | power_pmu_notify(struct notifier_block *self, unsigned long action, void *hcpu) | 1301 | power_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu) |
1302 | { | 1302 | { |
1303 | unsigned int cpu = (long)hcpu; | 1303 | unsigned int cpu = (long)hcpu; |
1304 | 1304 | ||
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index e24f6374f9f5..a6d92c34135c 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -787,7 +787,6 @@ void hw_perf_enable(void) | |||
787 | * step2: reprogram moved events into new counters | 787 | * step2: reprogram moved events into new counters |
788 | */ | 788 | */ |
789 | for (i = 0; i < n_running; i++) { | 789 | for (i = 0; i < n_running; i++) { |
790 | |||
791 | event = cpuc->event_list[i]; | 790 | event = cpuc->event_list[i]; |
792 | hwc = &event->hw; | 791 | hwc = &event->hw; |
793 | 792 | ||
@@ -802,21 +801,16 @@ void hw_perf_enable(void) | |||
802 | continue; | 801 | continue; |
803 | 802 | ||
804 | x86_pmu_stop(event); | 803 | x86_pmu_stop(event); |
805 | |||
806 | hwc->idx = -1; | ||
807 | } | 804 | } |
808 | 805 | ||
809 | for (i = 0; i < cpuc->n_events; i++) { | 806 | for (i = 0; i < cpuc->n_events; i++) { |
810 | |||
811 | event = cpuc->event_list[i]; | 807 | event = cpuc->event_list[i]; |
812 | hwc = &event->hw; | 808 | hwc = &event->hw; |
813 | 809 | ||
814 | if (i < n_running && | 810 | if (!match_prev_assignment(hwc, cpuc, i)) |
815 | match_prev_assignment(hwc, cpuc, i)) | ||
816 | continue; | ||
817 | |||
818 | if (hwc->idx == -1) | ||
819 | x86_assign_hw_event(event, cpuc, i); | 811 | x86_assign_hw_event(event, cpuc, i); |
812 | else if (i < n_running) | ||
813 | continue; | ||
820 | 814 | ||
821 | x86_pmu_start(event); | 815 | x86_pmu_start(event); |
822 | } | 816 | } |
@@ -1685,3 +1679,16 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs) | |||
1685 | 1679 | ||
1686 | return entry; | 1680 | return entry; |
1687 | } | 1681 | } |
1682 | |||
1683 | void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip) | ||
1684 | { | ||
1685 | regs->ip = ip; | ||
1686 | /* | ||
1687 | * perf_arch_fetch_caller_regs adds another call, we need to increment | ||
1688 | * the skip level | ||
1689 | */ | ||
1690 | regs->bp = rewind_frame_pointer(skip + 1); | ||
1691 | regs->cs = __KERNEL_CS; | ||
1692 | local_save_flags(regs->flags); | ||
1693 | } | ||
1694 | EXPORT_SYMBOL_GPL(perf_arch_fetch_caller_regs); | ||
diff --git a/arch/x86/kernel/dumpstack.h b/arch/x86/kernel/dumpstack.h index 4fd1420faffa..29e5f7c845b2 100644 --- a/arch/x86/kernel/dumpstack.h +++ b/arch/x86/kernel/dumpstack.h | |||
@@ -29,4 +29,19 @@ struct stack_frame { | |||
29 | struct stack_frame *next_frame; | 29 | struct stack_frame *next_frame; |
30 | unsigned long return_address; | 30 | unsigned long return_address; |
31 | }; | 31 | }; |
32 | |||
33 | static inline unsigned long rewind_frame_pointer(int n) | ||
34 | { | ||
35 | struct stack_frame *frame; | ||
36 | |||
37 | get_bp(frame); | ||
38 | |||
39 | #ifdef CONFIG_FRAME_POINTER | ||
40 | while (n--) | ||
41 | frame = frame->next_frame; | ||
32 | #endif | 42 | #endif |
43 | |||
44 | return (unsigned long)frame; | ||
45 | } | ||
46 | |||
47 | #endif /* DUMPSTACK_H */ | ||
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index d5e2a2ebb627..272c9f1f05f3 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -208,7 +208,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
208 | if (in_irq_stack(stack, irq_stack, irq_stack_end)) { | 208 | if (in_irq_stack(stack, irq_stack, irq_stack_end)) { |
209 | if (ops->stack(data, "IRQ") < 0) | 209 | if (ops->stack(data, "IRQ") < 0) |
210 | break; | 210 | break; |
211 | bp = print_context_stack(tinfo, stack, bp, | 211 | bp = ops->walk_stack(tinfo, stack, bp, |
212 | ops, data, irq_stack_end, &graph); | 212 | ops, data, irq_stack_end, &graph); |
213 | /* | 213 | /* |
214 | * We link to the next stack (which would be | 214 | * We link to the next stack (which would be |
@@ -229,7 +229,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
229 | /* | 229 | /* |
230 | * This handles the process stack: | 230 | * This handles the process stack: |
231 | */ | 231 | */ |
232 | bp = print_context_stack(tinfo, stack, bp, ops, data, NULL, &graph); | 232 | bp = ops->walk_stack(tinfo, stack, bp, ops, data, NULL, &graph); |
233 | put_cpu(); | 233 | put_cpu(); |
234 | } | 234 | } |
235 | EXPORT_SYMBOL(dump_trace); | 235 | EXPORT_SYMBOL(dump_trace); |