Skip to content

Commit 00e8976

Browse files
author
Ingo Molnar
committed
Merge branch 'perf/urgent' into perf/core
Conflicts: tools/perf/util/ui/browsers/hists.c Merge reason: fix the conflict and merge in changes for dependent patch. Signed-off-by: Ingo Molnar <mingo@elte.hu>
2 parents 540804b + 0f940cb commit 00e8976

7 files changed

Lines changed: 27 additions & 7 deletions

File tree

‎arch/arm/oprofile/common.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ static int op_create_counter(int cpu, int event)
102102
if (IS_ERR(pevent)) {
103103
ret = PTR_ERR(pevent);
104104
} else if (pevent->state != PERF_EVENT_STATE_ACTIVE) {
105+
perf_event_release_kernel(pevent);
105106
pr_warning("oprofile: failed to enable event %d "
106107
"on CPU %d\n", event, cpu);
107108
ret = -EBUSY;
@@ -365,6 +366,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
365366
ret = init_driverfs();
366367
if (ret) {
367368
kfree(counter_config);
369+
counter_config = NULL;
368370
return ret;
369371
}
370372

@@ -402,7 +404,6 @@ void oprofile_arch_exit(void)
402404
struct perf_event *event;
403405

404406
if (*perf_events) {
405-
exit_driverfs();
406407
for_each_possible_cpu(cpu) {
407408
for (id = 0; id < perf_num_counters; ++id) {
408409
event = perf_events[cpu][id];
@@ -413,8 +414,10 @@ void oprofile_arch_exit(void)
413414
}
414415
}
415416

416-
if (counter_config)
417+
if (counter_config) {
417418
kfree(counter_config);
419+
exit_driverfs();
420+
}
418421
}
419422
#else
420423
int __init oprofile_arch_init(struct oprofile_operations *ops)

‎arch/x86/kernel/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ifdef CONFIG_FUNCTION_TRACER
1111
CFLAGS_REMOVE_tsc.o = -pg
1212
CFLAGS_REMOVE_rtc.o = -pg
1313
CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
14+
CFLAGS_REMOVE_pvclock.o = -pg
15+
CFLAGS_REMOVE_kvmclock.o = -pg
1416
CFLAGS_REMOVE_ftrace.o = -pg
1517
CFLAGS_REMOVE_early_printk.o = -pg
1618
endif

‎arch/x86/kernel/cpu/perf_event.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ struct cpu_hw_events {
102102
*/
103103
struct perf_event *events[X86_PMC_IDX_MAX]; /* in counter order */
104104
unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
105+
unsigned long running[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
105106
int enabled;
106107

107108
int n_events;
@@ -1034,6 +1035,7 @@ static void x86_pmu_start(struct perf_event *event, int flags)
10341035

10351036
cpuc->events[idx] = event;
10361037
__set_bit(idx, cpuc->active_mask);
1038+
__set_bit(idx, cpuc->running);
10371039
x86_pmu.enable(event);
10381040
perf_event_update_userpage(event);
10391041
}
@@ -1159,8 +1161,16 @@ static int x86_pmu_handle_irq(struct pt_regs *regs)
11591161
cpuc = &__get_cpu_var(cpu_hw_events);
11601162

11611163
for (idx = 0; idx < x86_pmu.num_counters; idx++) {
1162-
if (!test_bit(idx, cpuc->active_mask))
1164+
if (!test_bit(idx, cpuc->active_mask)) {
1165+
/*
1166+
* Though we deactivated the counter some cpus
1167+
* might still deliver spurious interrupts still
1168+
* in flight. Catch them:
1169+
*/
1170+
if (__test_and_clear_bit(idx, cpuc->running))
1171+
handled++;
11631172
continue;
1173+
}
11641174

11651175
event = cpuc->events[idx];
11661176
hwc = &event->hw;

‎arch/x86/kernel/cpu/perf_event_p4.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,12 @@ static int p4_pmu_handle_irq(struct pt_regs *regs)
904904
for (idx = 0; idx < x86_pmu.num_counters; idx++) {
905905
int overflow;
906906

907-
if (!test_bit(idx, cpuc->active_mask))
907+
if (!test_bit(idx, cpuc->active_mask)) {
908+
/* catch in-flight IRQs */
909+
if (__test_and_clear_bit(idx, cpuc->running))
910+
handled++;
908911
continue;
912+
}
909913

910914
event = cpuc->events[idx];
911915
hwc = &event->hw;

‎arch/x86/oprofile/nmi_int.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ static int __init ppro_init(char **cpu_type)
674674
case 0x0f:
675675
case 0x16:
676676
case 0x17:
677+
case 0x1d:
677678
*cpu_type = "i386/core_2";
678679
break;
679680
case 0x1a:

‎tools/perf/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ builtin-revert.o wt-status.o: wt-status.h
10351035
# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
10361036
# we depend the various files onto their directories.
10371037
DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
1038-
$(DIRECTORY_DEPS): $(sort $(dir $(DIRECTORY_DEPS)))
1038+
$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
10391039
# In the second step, we make a rule to actually create these directories
10401040
$(sort $(dir $(DIRECTORY_DEPS))):
10411041
$(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null

‎tools/perf/util/trace-event-scripting.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void setup_python_scripting(void)
9797
register_python_scripting(&python_scripting_unsupported_ops);
9898
}
9999
#else
100-
struct scripting_ops python_scripting_ops;
100+
extern struct scripting_ops python_scripting_ops;
101101

102102
void setup_python_scripting(void)
103103
{
@@ -158,7 +158,7 @@ void setup_perl_scripting(void)
158158
register_perl_scripting(&perl_scripting_unsupported_ops);
159159
}
160160
#else
161-
struct scripting_ops perl_scripting_ops;
161+
extern struct scripting_ops perl_scripting_ops;
162162

163163
void setup_perl_scripting(void)
164164
{

0 commit comments

Comments
 (0)