Lines Matching refs:task_ctx
249 return this_cpu_ptr(&perf_cpu_context)->task_ctx; in perf_cpu_task_ctx()
286 struct perf_event_context *task_ctx = cpuctx->task_ctx; in event_function() local
291 perf_ctx_lock(cpuctx, task_ctx); in event_function()
314 WARN_ON_ONCE(task_ctx != ctx); in event_function()
321 perf_ctx_unlock(cpuctx, task_ctx); in event_function()
388 struct perf_event_context *task_ctx = NULL; in event_function_local() local
396 task_ctx = ctx; in event_function_local()
399 perf_ctx_lock(cpuctx, task_ctx); in event_function_local()
415 if (WARN_ON_ONCE(cpuctx->task_ctx != ctx)) in event_function_local()
424 perf_ctx_unlock(cpuctx, task_ctx); in event_function_local()
1059 guard(perf_ctx_lock)(cpuctx, cpuctx->task_ctx); in perf_cgroup_switch()
2624 WARN_ON_ONCE(cpuctx->task_ctx != ctx); in __perf_remove_from_context()
2625 cpuctx->task_ctx = NULL; in __perf_remove_from_context()
2949 if (!cpuctx->task_ctx) in task_ctx_sched_out()
2952 if (WARN_ON_ONCE(ctx != cpuctx->task_ctx)) in task_ctx_sched_out()
2987 struct perf_event_context *task_ctx, in ctx_resched() argument
3005 if (task_ctx) { in ctx_resched()
3006 for_each_epc(epc, task_ctx, pmu, 0) in ctx_resched()
3009 task_ctx_sched_out(task_ctx, pmu, event_type); in ctx_resched()
3024 perf_event_sched_in(cpuctx, task_ctx, pmu, 0); in ctx_resched()
3029 if (task_ctx) { in ctx_resched()
3030 for_each_epc(epc, task_ctx, pmu, 0) in ctx_resched()
3038 struct perf_event_context *task_ctx = cpuctx->task_ctx; in perf_pmu_resched() local
3040 perf_ctx_lock(cpuctx, task_ctx); in perf_pmu_resched()
3041 ctx_resched(cpuctx, task_ctx, pmu, EVENT_ALL|EVENT_CPU); in perf_pmu_resched()
3042 perf_ctx_unlock(cpuctx, task_ctx); in perf_pmu_resched()
3056 struct perf_event_context *task_ctx = cpuctx->task_ctx; in __perf_install_in_context() local
3063 task_ctx = ctx; in __perf_install_in_context()
3079 WARN_ON_ONCE(reprogram && cpuctx->task_ctx && cpuctx->task_ctx != ctx); in __perf_install_in_context()
3080 } else if (task_ctx) { in __perf_install_in_context()
3081 raw_spin_lock(&task_ctx->lock); in __perf_install_in_context()
3099 ctx_resched(cpuctx, task_ctx, event->pmu_ctx->pmu, in __perf_install_in_context()
3106 perf_ctx_unlock(cpuctx, task_ctx); in __perf_install_in_context()
3237 struct perf_event_context *task_ctx; in __perf_event_enable() local
3261 task_ctx = cpuctx->task_ctx; in __perf_event_enable()
3263 WARN_ON_ONCE(task_ctx != ctx); in __perf_event_enable()
3265 ctx_resched(cpuctx, task_ctx, event->pmu_ctx->pmu, get_event_type(event)); in __perf_event_enable()
3592 WARN_ON_ONCE(cpuctx->task_ctx); in ctx_sched_out()
3627 WARN_ON_ONCE(cpuctx->task_ctx != ctx); in ctx_sched_out()
3629 cpuctx->task_ctx = NULL; in ctx_sched_out()
3906 perf_ctx_lock(cpuctx, cpuctx->task_ctx); in __perf_pmu_sched_task()
3912 perf_ctx_unlock(cpuctx, cpuctx->task_ctx); in __perf_pmu_sched_task()
3923 if (prev == next || cpuctx->task_ctx) in perf_pmu_sched_task()
4208 cpuctx->task_ctx = ctx; in ctx_sched_in()
4210 WARN_ON_ONCE(cpuctx->task_ctx != ctx); in ctx_sched_in()
4257 if (cpuctx->task_ctx == ctx) { in perf_event_context_sched_in()
4292 perf_ctx_sched_task_cb(cpuctx->task_ctx, task, true); in perf_event_context_sched_in()
4610 perf_ctx_lock(cpuctx, cpuctx->task_ctx); in perf_rotate_context()
4641 perf_ctx_unlock(cpuctx, cpuctx->task_ctx); in perf_rotate_context()
4825 if (ctx->task && cpuctx->task_ctx != ctx) in __perf_event_read()
6421 guard(perf_ctx_lock)(cpuctx, cpuctx->task_ctx); in perf_load_guest_context()
6428 if (cpuctx->task_ctx) { in perf_load_guest_context()
6429 perf_ctx_disable(cpuctx->task_ctx, EVENT_GUEST); in perf_load_guest_context()
6430 task_ctx_sched_out(cpuctx->task_ctx, NULL, EVENT_GUEST); in perf_load_guest_context()
6434 if (cpuctx->task_ctx) in perf_load_guest_context()
6435 perf_ctx_enable(cpuctx->task_ctx, EVENT_GUEST); in perf_load_guest_context()
6447 guard(perf_ctx_lock)(cpuctx, cpuctx->task_ctx); in perf_put_guest_context()
6453 if (cpuctx->task_ctx) in perf_put_guest_context()
6454 perf_ctx_disable(cpuctx->task_ctx, EVENT_GUEST); in perf_put_guest_context()
6456 perf_event_sched_in(cpuctx, cpuctx->task_ctx, NULL, EVENT_GUEST); in perf_put_guest_context()
6458 if (cpuctx->task_ctx) in perf_put_guest_context()
6459 perf_ctx_enable(cpuctx->task_ctx, EVENT_GUEST); in perf_put_guest_context()
8934 struct perf_event_context *task_ctx) in perf_iterate_sb() argument
8946 if (task_ctx) { in perf_iterate_sb()
8947 perf_iterate_ctx(task_ctx, output, data, false); in perf_iterate_sb()
9055 if (cpuctx->task_ctx) in __perf_pmu_output_stop()
9056 perf_iterate_ctx(cpuctx->task_ctx, __perf_event_output_stop, in __perf_pmu_output_stop()
9101 struct perf_event_context *task_ctx; member
9165 struct perf_event_context *task_ctx, in perf_event_task() argument
9177 .task_ctx = task_ctx, in perf_event_task()
9194 task_ctx); in perf_event_task()