lkml.org 
[lkml]   [2012]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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);



\
 
 \ /
  Last update: 2012-11-03 06:21    [W:0.102 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site