Lines Matching refs:task_ctx
221 return this_cpu_ptr(&perf_cpu_context)->task_ctx; in perf_cpu_task_ctx()
258 struct perf_event_context *task_ctx = cpuctx->task_ctx; in event_function() local
263 perf_ctx_lock(cpuctx, task_ctx); in event_function()
286 WARN_ON_ONCE(task_ctx != ctx); in event_function()
293 perf_ctx_unlock(cpuctx, task_ctx); in event_function()
360 struct perf_event_context *task_ctx = NULL; in event_function_local() local
368 task_ctx = ctx; in event_function_local()
371 perf_ctx_lock(cpuctx, task_ctx); in event_function_local()
387 if (WARN_ON_ONCE(cpuctx->task_ctx != ctx)) in event_function_local()
396 perf_ctx_unlock(cpuctx, task_ctx); in event_function_local()
901 perf_ctx_lock(cpuctx, cpuctx->task_ctx); in perf_cgroup_switch()
919 perf_ctx_unlock(cpuctx, cpuctx->task_ctx); in perf_cgroup_switch()
2461 WARN_ON_ONCE(cpuctx->task_ctx != ctx); in __perf_remove_from_context()
2462 cpuctx->task_ctx = NULL; in __perf_remove_from_context()
2733 if (!cpuctx->task_ctx) in task_ctx_sched_out()
2736 if (WARN_ON_ONCE(ctx != cpuctx->task_ctx)) in task_ctx_sched_out()
2770 struct perf_event_context *task_ctx, in ctx_resched() argument
2788 if (task_ctx) { in ctx_resched()
2789 for_each_epc(epc, task_ctx, pmu, false) in ctx_resched()
2792 task_ctx_sched_out(task_ctx, pmu, event_type); in ctx_resched()
2807 perf_event_sched_in(cpuctx, task_ctx, pmu); in ctx_resched()
2812 if (task_ctx) { in ctx_resched()
2813 for_each_epc(epc, task_ctx, pmu, false) in ctx_resched()
2821 struct perf_event_context *task_ctx = cpuctx->task_ctx; in perf_pmu_resched() local
2823 perf_ctx_lock(cpuctx, task_ctx); in perf_pmu_resched()
2824 ctx_resched(cpuctx, task_ctx, pmu, EVENT_ALL|EVENT_CPU); in perf_pmu_resched()
2825 perf_ctx_unlock(cpuctx, task_ctx); in perf_pmu_resched()
2839 struct perf_event_context *task_ctx = cpuctx->task_ctx; in __perf_install_in_context() local
2846 task_ctx = ctx; in __perf_install_in_context()
2862 WARN_ON_ONCE(reprogram && cpuctx->task_ctx && cpuctx->task_ctx != ctx); in __perf_install_in_context()
2863 } else if (task_ctx) { in __perf_install_in_context()
2864 raw_spin_lock(&task_ctx->lock); in __perf_install_in_context()
2882 ctx_resched(cpuctx, task_ctx, event->pmu_ctx->pmu, in __perf_install_in_context()
2889 perf_ctx_unlock(cpuctx, task_ctx); in __perf_install_in_context()
3020 struct perf_event_context *task_ctx; in __perf_event_enable() local
3044 task_ctx = cpuctx->task_ctx; in __perf_event_enable()
3046 WARN_ON_ONCE(task_ctx != ctx); in __perf_event_enable()
3048 ctx_resched(cpuctx, task_ctx, event->pmu_ctx->pmu, get_event_type(event)); in __perf_event_enable()
3377 WARN_ON_ONCE(cpuctx->task_ctx); in ctx_sched_out()
3412 WARN_ON_ONCE(cpuctx->task_ctx != ctx); in ctx_sched_out()
3414 cpuctx->task_ctx = NULL; in ctx_sched_out()
3716 perf_ctx_lock(cpuctx, cpuctx->task_ctx); in __perf_pmu_sched_task()
3722 perf_ctx_unlock(cpuctx, cpuctx->task_ctx); in __perf_pmu_sched_task()
3733 if (prev == next || cpuctx->task_ctx) in perf_pmu_sched_task()
3995 cpuctx->task_ctx = ctx; in ctx_sched_in()
3997 WARN_ON_ONCE(cpuctx->task_ctx != ctx); in ctx_sched_in()
4028 if (cpuctx->task_ctx == ctx) { in perf_event_context_sched_in()
4063 perf_ctx_sched_task_cb(cpuctx->task_ctx, true); in perf_event_context_sched_in()
4385 perf_ctx_lock(cpuctx, cpuctx->task_ctx); in perf_rotate_context()
4416 perf_ctx_unlock(cpuctx, cpuctx->task_ctx); in perf_rotate_context()
4598 if (ctx->task && cpuctx->task_ctx != ctx) in __perf_event_read()
8210 struct perf_event_context *task_ctx) in perf_iterate_sb() argument
8222 if (task_ctx) { in perf_iterate_sb()
8223 perf_iterate_ctx(task_ctx, output, data, false); in perf_iterate_sb()
8330 if (cpuctx->task_ctx) in __perf_pmu_output_stop()
8331 perf_iterate_ctx(cpuctx->task_ctx, __perf_event_output_stop, in __perf_pmu_output_stop()
8376 struct perf_event_context *task_ctx; member
8440 struct perf_event_context *task_ctx, in perf_event_task() argument
8452 .task_ctx = task_ctx, in perf_event_task()
8469 task_ctx); in perf_event_task()