提交 2c2366c7 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

perf/core: Remove 'struct sched_in_data'

We can deduce the ctx and cpuctx from the event, no need to pass them
along. Remove the structure and pass in can_add_hw directly.
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: NIngo Molnar <mingo@kernel.org>
上级 ab6f824c
...@@ -3423,17 +3423,11 @@ static int visit_groups_merge(struct perf_event_groups *groups, int cpu, ...@@ -3423,17 +3423,11 @@ static int visit_groups_merge(struct perf_event_groups *groups, int cpu,
return 0; return 0;
} }
struct sched_in_data {
struct perf_event_context *ctx;
struct perf_cpu_context *cpuctx;
int can_add_hw;
};
static int merge_sched_in(struct perf_event *event, void *data) static int merge_sched_in(struct perf_event *event, void *data)
{ {
struct sched_in_data *sid = data; struct perf_event_context *ctx = event->ctx;
struct perf_cpu_context *cpuctx = __get_cpu_context(ctx);
WARN_ON_ONCE(event->ctx != sid->ctx); int *can_add_hw = data;
if (event->state <= PERF_EVENT_STATE_OFF) if (event->state <= PERF_EVENT_STATE_OFF)
return 0; return 0;
...@@ -3441,8 +3435,8 @@ static int merge_sched_in(struct perf_event *event, void *data) ...@@ -3441,8 +3435,8 @@ static int merge_sched_in(struct perf_event *event, void *data)
if (!event_filter_match(event)) if (!event_filter_match(event))
return 0; return 0;
if (group_can_go_on(event, sid->cpuctx, sid->can_add_hw)) { if (group_can_go_on(event, cpuctx, *can_add_hw)) {
if (!group_sched_in(event, sid->cpuctx, sid->ctx)) if (!group_sched_in(event, cpuctx, ctx))
list_add_tail(&event->active_list, get_event_list(event)); list_add_tail(&event->active_list, get_event_list(event));
} }
...@@ -3450,8 +3444,8 @@ static int merge_sched_in(struct perf_event *event, void *data) ...@@ -3450,8 +3444,8 @@ static int merge_sched_in(struct perf_event *event, void *data)
if (event->attr.pinned) if (event->attr.pinned)
perf_event_set_state(event, PERF_EVENT_STATE_ERROR); perf_event_set_state(event, PERF_EVENT_STATE_ERROR);
sid->can_add_hw = 0; *can_add_hw = 0;
sid->ctx->rotate_necessary = 1; ctx->rotate_necessary = 1;
} }
return 0; return 0;
...@@ -3461,30 +3455,22 @@ static void ...@@ -3461,30 +3455,22 @@ static void
ctx_pinned_sched_in(struct perf_event_context *ctx, ctx_pinned_sched_in(struct perf_event_context *ctx,
struct perf_cpu_context *cpuctx) struct perf_cpu_context *cpuctx)
{ {
struct sched_in_data sid = { int can_add_hw = 1;
.ctx = ctx,
.cpuctx = cpuctx,
.can_add_hw = 1,
};
visit_groups_merge(&ctx->pinned_groups, visit_groups_merge(&ctx->pinned_groups,
smp_processor_id(), smp_processor_id(),
merge_sched_in, &sid); merge_sched_in, &can_add_hw);
} }
static void static void
ctx_flexible_sched_in(struct perf_event_context *ctx, ctx_flexible_sched_in(struct perf_event_context *ctx,
struct perf_cpu_context *cpuctx) struct perf_cpu_context *cpuctx)
{ {
struct sched_in_data sid = { int can_add_hw = 1;
.ctx = ctx,
.cpuctx = cpuctx,
.can_add_hw = 1,
};
visit_groups_merge(&ctx->flexible_groups, visit_groups_merge(&ctx->flexible_groups,
smp_processor_id(), smp_processor_id(),
merge_sched_in, &sid); merge_sched_in, &can_add_hw);
} }
static void static void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册