提交 1fe684e3 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

perf/x86/intel: Remove pointless tests

Both intel_commit_scheduling() and intel_get_excl_contraints() test
for cntr < 0.

The only way that can happen (aside from a bug) is through
validate_event(), however that is already captured by the
cpuc->is_fake test.

So remove these test and simplify the code.
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: NIngo Molnar <mingo@kernel.org>
上级 0c41e756
......@@ -1954,12 +1954,10 @@ static void intel_commit_scheduling(struct cpu_hw_events *cpuc, int idx, int cnt
lockdep_assert_held(&excl_cntrs->lock);
if (cntr >= 0) {
if (c->flags & PERF_X86_EVENT_EXCL)
xl->init_state[cntr] = INTEL_EXCL_EXCLUSIVE;
else
xl->init_state[cntr] = INTEL_EXCL_SHARED;
}
if (c->flags & PERF_X86_EVENT_EXCL)
xl->init_state[cntr] = INTEL_EXCL_EXCLUSIVE;
else
xl->init_state[cntr] = INTEL_EXCL_SHARED;
}
static void
......@@ -2027,10 +2025,6 @@ intel_get_excl_constraints(struct cpu_hw_events *cpuc, struct perf_event *event,
if (!(c->flags & PERF_X86_EVENT_DYNAMIC)) {
struct event_constraint *cx;
/* sanity check */
if (idx < 0)
return &emptyconstraint;
/*
* grab pre-allocated constraint entry
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册