Re: [PATCH v2 03/14] perf: Add persistent event facilities

From: Peter Zijlstra
Date: Mon Jun 24 2013 - 05:32:17 EST


On Tue, Jun 11, 2013 at 06:42:29PM +0200, Robert Richter wrote:
> +static struct perf_event *
> +add_persistent_event_on_cpu(unsigned int cpu, struct perf_event_attr *attr,
> + unsigned nr_pages)
> +{
> + struct perf_event *event = ERR_PTR(-ENOMEM);
> + struct pers_event_desc *desc;
> + struct ring_buffer *buf;
> +
> + desc = kzalloc(sizeof(*desc), GFP_KERNEL);
> + if (!desc)
> + goto out;
> +
> + buf = rb_alloc(nr_pages, 0, cpu, 0);
> + if (!buf)
> + goto err_rb;
> +
> + event = perf_event_create_kernel_counter(attr, cpu, NULL, NULL, NULL);
> + if (IS_ERR(event))
> + goto err_event;
> +
> + rcu_assign_pointer(event->rb, buf);
> +
> + desc->event = event;
> + desc->attr = attr;
> +
> + INIT_LIST_HEAD(&desc->plist);
> + list_add_tail(&desc->plist, &per_cpu(pers_events, cpu));
> +
> + /* All workie, enable event now */
> + perf_event_enable(event);
> +
> + goto out;
> +
> + err_event:
> + rb_put(buf);
> +
> + err_rb:
> + kfree(desc);
> +
> + out:
> + return event;
> +}

I generally disapprove of indented labels. None of the perf code has
that and the tools are easy to 'fix'.

My quiltrc contains:

QUILT_DIFF_OPTS="-F ^[[:alpha:]\$_].*[^:]\$"

my .gitconfig contains:

[diff "default"]
xfuncname = "^[[:alpha:]$_].*[^:]$"

Both avoid diff thinking labels are function names.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/