/* * Add/remove the given breakpoint in our constraint table */ static void toggle_bp_slot(struct perf_event *bp, bool enable, enum bp_type_idx type, int weight) { int cpu = bp->cpu; struct task_struct *tsk = bp->ctx->task; /* Pinned counter task profiling */ if (tsk) { if (cpu >= 0) { toggle_bp_task_slot(tsk, cpu, enable, type, weight); return; } for_each_online_cpu(cpu) toggle_bp_task_slot(tsk, cpu, enable, type, weight); return; } /* Pinned counter cpu profiling */ if (enable) per_cpu(nr_cpu_bp_pinned[type], bp->cpu) += weight; else per_cpu(nr_cpu_bp_pinned[type], bp->cpu) -= weight; }
/* * Add/remove the given breakpoint in our constraint table */ static void toggle_bp_slot(struct perf_event *bp, bool enable) { int cpu = bp->cpu; struct task_struct *tsk = bp->ctx->task; /* Pinned counter task profiling */ if (tsk) { if (cpu >= 0) { toggle_bp_task_slot(tsk, cpu, enable); return; } for_each_online_cpu(cpu) toggle_bp_task_slot(tsk, cpu, enable); return; } /* Pinned counter cpu profiling */ if (enable) per_cpu(nr_cpu_bp_pinned, bp->cpu)++; else per_cpu(nr_cpu_bp_pinned, bp->cpu)--; }