[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130624093204.GN28407@twins.programming.kicks-ass.net>
Date: Mon, 24 Jun 2013 11:32:04 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Robert Richter <rric@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...nel.org>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org,
Borislav Petkov <bp@...e.de>,
Robert Richter <robert.richter@...aro.org>
Subject: Re: [PATCH v2 03/14] perf: Add persistent event facilities
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists