lkml.org 
[lkml]   [2013]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/16] perf, persistent: Print error code on failure when adding events
On Fri, May 31, 2013 at 10:47:24AM +0200, Robert Richter wrote:
> From: Robert Richter <robert.richter@calxeda.com>
>
> Improve error reporting.
>
> Signed-off-by: Robert Richter <robert.richter@calxeda.com>
> ---
> kernel/events/persistent.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/events/persistent.c b/kernel/events/persistent.c
> index 1e6c03a..6612eb77 100644
> --- a/kernel/events/persistent.c
> +++ b/kernel/events/persistent.c
> @@ -123,15 +123,15 @@ int perf_add_persistent_event(struct perf_event_attr *attr, unsigned nr_pages)
>
> for_each_possible_cpu(i) {
> event = add_persistent_event_on_cpu(i, attr, nr_pages);
> - if (IS_ERR(event)) {
> - pr_err("%s: Error adding persistent event on cpu %d\n",
> - __func__, i);
> + if (IS_ERR(event))
> goto unwind;
> - }
> }
> return 0;
>
> unwind:
> + pr_err("%s: Error adding persistent event on cpu %d: %ld\n",
> + __func__, i, PTR_ERR(event));
> +
> while (--i >= 0)
> del_persistent_event(i, attr);

Should also be merged.

Thanks.


\
 
 \ /
  Last update: 2013-05-31 11:41    [W:0.190 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site