forked from Minki/linux
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "Three fixlets and two small (and low risk) hw-enablement changes" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix event group context move x86/perf: Add IvyBridge EP support perf/x86: Fix P6 driver section warning arch/x86/tools/insn_sanity.c: Identify source of messages perf/x86: Enable Intel Lincroft/Penwell/Cloverview Atom support
This commit is contained in:
commit
51c1abb95f
@ -2019,7 +2019,10 @@ __init int intel_pmu_init(void)
|
||||
break;
|
||||
|
||||
case 28: /* Atom */
|
||||
case 54: /* Cedariew */
|
||||
case 38: /* Lincroft */
|
||||
case 39: /* Penwell */
|
||||
case 53: /* Cloverview */
|
||||
case 54: /* Cedarview */
|
||||
memcpy(hw_cache_event_ids, atom_hw_cache_event_ids,
|
||||
sizeof(hw_cache_event_ids));
|
||||
|
||||
@ -2084,6 +2087,7 @@ __init int intel_pmu_init(void)
|
||||
pr_cont("SandyBridge events, ");
|
||||
break;
|
||||
case 58: /* IvyBridge */
|
||||
case 62: /* IvyBridge EP */
|
||||
memcpy(hw_cache_event_ids, snb_hw_cache_event_ids,
|
||||
sizeof(hw_cache_event_ids));
|
||||
memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs,
|
||||
|
@ -19,7 +19,7 @@ static const u64 p6_perfmon_event_map[] =
|
||||
|
||||
};
|
||||
|
||||
static __initconst u64 p6_hw_cache_event_ids
|
||||
static u64 p6_hw_cache_event_ids
|
||||
[PERF_COUNT_HW_CACHE_MAX]
|
||||
[PERF_COUNT_HW_CACHE_OP_MAX]
|
||||
[PERF_COUNT_HW_CACHE_RESULT_MAX] =
|
||||
|
@ -55,7 +55,7 @@ static FILE *input_file; /* Input file name */
|
||||
static void usage(const char *err)
|
||||
{
|
||||
if (err)
|
||||
fprintf(stderr, "Error: %s\n\n", err);
|
||||
fprintf(stderr, "%s: Error: %s\n\n", prog, err);
|
||||
fprintf(stderr, "Usage: %s [-y|-n|-v] [-s seed[,no]] [-m max] [-i input]\n", prog);
|
||||
fprintf(stderr, "\t-y 64bit mode\n");
|
||||
fprintf(stderr, "\t-n 32bit mode\n");
|
||||
@ -269,7 +269,13 @@ int main(int argc, char **argv)
|
||||
insns++;
|
||||
}
|
||||
|
||||
fprintf(stdout, "%s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n", (errors) ? "Failure" : "Success", insns, (input_file) ? "given" : "random", errors, seed);
|
||||
fprintf(stdout, "%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n",
|
||||
prog,
|
||||
(errors) ? "Failure" : "Success",
|
||||
insns,
|
||||
(input_file) ? "given" : "random",
|
||||
errors,
|
||||
seed);
|
||||
|
||||
return errors ? 1 : 0;
|
||||
}
|
||||
|
@ -907,6 +907,15 @@ list_add_event(struct perf_event *event, struct perf_event_context *ctx)
|
||||
ctx->nr_stat++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize event state based on the perf_event_attr::disabled.
|
||||
*/
|
||||
static inline void perf_event__state_init(struct perf_event *event)
|
||||
{
|
||||
event->state = event->attr.disabled ? PERF_EVENT_STATE_OFF :
|
||||
PERF_EVENT_STATE_INACTIVE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called at perf_event creation and when events are attached/detached from a
|
||||
* group.
|
||||
@ -6179,8 +6188,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
|
||||
event->overflow_handler = overflow_handler;
|
||||
event->overflow_handler_context = context;
|
||||
|
||||
if (attr->disabled)
|
||||
event->state = PERF_EVENT_STATE_OFF;
|
||||
perf_event__state_init(event);
|
||||
|
||||
pmu = NULL;
|
||||
|
||||
@ -6609,9 +6617,17 @@ SYSCALL_DEFINE5(perf_event_open,
|
||||
|
||||
mutex_lock(&gctx->mutex);
|
||||
perf_remove_from_context(group_leader);
|
||||
|
||||
/*
|
||||
* Removing from the context ends up with disabled
|
||||
* event. What we want here is event in the initial
|
||||
* startup state, ready to be add into new context.
|
||||
*/
|
||||
perf_event__state_init(group_leader);
|
||||
list_for_each_entry(sibling, &group_leader->sibling_list,
|
||||
group_entry) {
|
||||
perf_remove_from_context(sibling);
|
||||
perf_event__state_init(sibling);
|
||||
put_ctx(gctx);
|
||||
}
|
||||
mutex_unlock(&gctx->mutex);
|
||||
|
Loading…
Reference in New Issue
Block a user