[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5094A2CB.8040208@gmail.com>
Date: Sat, 03 Nov 2012 12:51:23 +0800
From: Shan Wei <shanwei88@...il.com>
To: Christoph Lameter <cl@...ux.com>
CC: rostedt@...dmis.org, fweisbec@...il.com,
Kernel-Maillist <linux-kernel@...r.kernel.org>, mingo@...hat.com
Subject: Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper
Christoph Lameter said, at 2012/11/3 1:53:
>
> hmm.... what is actually returned is a pointer to char right? And buffer
> is char[1024] so I guess then you need to pass a pointer to char to
> this_cpu_read.
>
> return this_cpu_read(&(percpu_buffer->buffer))
still error....
kernel/trace/trace.c: In function 'get_trace_buf':
kernel/trace/trace.c:1517: error: lvalue required as unary '&' operand
kernel/trace/trace.c:1517: warning: type defaults to 'int' in declaration of 'type name'
kernel/trace/trace.c:1517: warning: cast from pointer to integer of different size
kernel/trace/trace.c:1517: warning: return from incompatible pointer type
kernel/trace/trace.c:1498: warning: unused variable 'buffer'
kernel/trace/trace.c:1517: error: memory input 1 is not directly addressable
kernel/trace/trace.c:1517: error: memory input 1 is not directly addressable
this_cpu_read just read the actual value which a pointer point to.
some case, we just need the pointer.
It's better to use this_cpu_ptr.
return (char *)this_cpu_ptr(&percpu_buffer->buffer);
--
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