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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/