/*
* Cross CPU call to install and enable a performance counter
+ *
+ * Must be called with ctx->mutex held
*/
static void __perf_install_in_context(void *info)
{
struct perf_counter_context *ctx = counter->ctx;
struct perf_counter *sibling;
- spin_lock_irq(&ctx->lock);
+ mutex_lock(&ctx->mutex);
counter = counter->group_leader;
func(counter);
list_for_each_entry(sibling, &counter->sibling_list, list_entry)
func(sibling);
- spin_unlock_irq(&ctx->lock);
+ mutex_unlock(&ctx->mutex);
}
static void perf_counter_for_each_child(struct perf_counter *counter,
struct perf_counter *parent_counter;
update_counter_times(child_counter);
+
+ spin_lock_irq(&child_ctx->lock);
list_del_counter(child_counter, child_ctx);
+ spin_unlock_irq(&child_ctx->lock);
parent_counter = child_counter->parent;
/*