Lines Matching defs:task_ctx
250 return this_cpu_ptr(&perf_cpu_context)->task_ctx;
269 * If ctx->nr_events, then ctx->is_active and cpuctx->task_ctx are set.
287 struct perf_event_context *task_ctx = cpuctx->task_ctx;
292 perf_ctx_lock(cpuctx, task_ctx);
312 * And since we have ctx->is_active, cpuctx->task_ctx must
315 WARN_ON_ONCE(task_ctx != ctx);
322 perf_ctx_unlock(cpuctx, task_ctx);
389 struct perf_event_context *task_ctx = NULL;
397 task_ctx = ctx;
400 perf_ctx_lock(cpuctx, task_ctx);
416 if (WARN_ON_ONCE(cpuctx->task_ctx != ctx))
425 perf_ctx_unlock(cpuctx, task_ctx);
1060 guard(perf_ctx_lock)(cpuctx, cpuctx->task_ctx);
2625 WARN_ON_ONCE(cpuctx->task_ctx != ctx);
2626 cpuctx->task_ctx = NULL;
2950 if (!cpuctx->task_ctx)
2953 if (WARN_ON_ONCE(ctx != cpuctx->task_ctx))
2988 struct perf_event_context *task_ctx,
3006 if (task_ctx) {
3007 for_each_epc(epc, task_ctx, pmu, 0)
3010 task_ctx_sched_out(task_ctx, pmu, event_type);
3025 perf_event_sched_in(cpuctx, task_ctx, pmu, 0);
3030 if (task_ctx) {
3031 for_each_epc(epc, task_ctx, pmu, 0)
3039 struct perf_event_context *task_ctx = cpuctx->task_ctx;
3041 perf_ctx_lock(cpuctx, task_ctx);
3042 ctx_resched(cpuctx, task_ctx, pmu, EVENT_ALL|EVENT_CPU);
3043 perf_ctx_unlock(cpuctx, task_ctx);
3050 * things like ctx->is_active and cpuctx->task_ctx are set.
3057 struct perf_event_context *task_ctx = cpuctx->task_ctx;
3064 task_ctx = ctx;
3080 WARN_ON_ONCE(reprogram && cpuctx->task_ctx && cpuctx->task_ctx != ctx);
3081 } else if (task_ctx) {
3082 raw_spin_lock(&task_ctx->lock);
3100 ctx_resched(cpuctx, task_ctx, event->pmu_ctx->pmu,
3107 perf_ctx_unlock(cpuctx, task_ctx);
3238 struct perf_event_context *task_ctx;
3262 task_ctx = cpuctx->task_ctx;
3264 WARN_ON_ONCE(task_ctx != ctx);
3266 ctx_resched(cpuctx, task_ctx, event->pmu_ctx->pmu, get_event_type(event));
3593 WARN_ON_ONCE(cpuctx->task_ctx);
3628 WARN_ON_ONCE(cpuctx->task_ctx != ctx);
3630 cpuctx->task_ctx = NULL;
3907 perf_ctx_lock(cpuctx, cpuctx->task_ctx);
3913 perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
3923 /* cpuctx->task_ctx will be handled in perf_event_context_sched_in/out */
3924 if (prev == next || cpuctx->task_ctx)
4209 cpuctx->task_ctx = ctx;
4211 WARN_ON_ONCE(cpuctx->task_ctx != ctx);
4258 if (cpuctx->task_ctx == ctx) {
4293 perf_ctx_sched_task_cb(cpuctx->task_ctx, task, true);
4611 perf_ctx_lock(cpuctx, cpuctx->task_ctx);
4642 perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
4826 if (ctx->task && cpuctx->task_ctx != ctx)
6420 guard(perf_ctx_lock)(cpuctx, cpuctx->task_ctx);
6427 if (cpuctx->task_ctx) {
6428 perf_ctx_disable(cpuctx->task_ctx, EVENT_GUEST);
6429 task_ctx_sched_out(cpuctx->task_ctx, NULL, EVENT_GUEST);
6433 if (cpuctx->task_ctx)
6434 perf_ctx_enable(cpuctx->task_ctx, EVENT_GUEST);
6446 guard(perf_ctx_lock)(cpuctx, cpuctx->task_ctx);
6452 if (cpuctx->task_ctx)
6453 perf_ctx_disable(cpuctx->task_ctx, EVENT_GUEST);
6455 perf_event_sched_in(cpuctx, cpuctx->task_ctx, NULL, EVENT_GUEST);
6457 if (cpuctx->task_ctx)
6458 perf_ctx_enable(cpuctx->task_ctx, EVENT_GUEST);
9001 struct perf_event_context *task_ctx)
9009 * If we have task_ctx != NULL we only notify the task context itself.
9010 * The task_ctx is set only for EXIT events before releasing task
9013 if (task_ctx) {
9014 perf_iterate_ctx(task_ctx, output, data, false);
9122 if (cpuctx->task_ctx)
9123 perf_iterate_ctx(cpuctx->task_ctx, __perf_event_output_stop,
9168 struct perf_event_context *task_ctx;
9232 struct perf_event_context *task_ctx,
9244 .task_ctx = task_ctx,
9261 task_ctx);
14699 * with task's task_ctx, which generates EXIT events for