ARM: etm: Don't try to clear the buffer full status after reading the buffer
authorArve Hjønnevåg <arve@android.com>
Tue, 1 Feb 2011 05:34:47 +0000 (21:34 -0800)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:07:43 +0000 (12:07 -0800)
commitaf40bcef9bab66b0c9db0fd6659f4746f2437daa
tree3a34c406e0fe168db4ec86ed331a7c91e661b687
parent07a8543be680f33f953de0b918fbb4c9bddebf37
ARM: etm: Don't try to clear the buffer full status after reading the buffer

If the write address was at the end of the buffer, toggling the trace
capture bit would set the RAM-full status instead of clearing it, and
if any of the stop bits in the formatter is set toggling the trace
capture bit may not do anything.

Instead use the read position to find out if the data has already
been returned.

This also fixes the read function so it works when the trace buffer is
larger than the buffer passed in from user space. The old version
would reset the trace buffer pointers after every read, so the second
call to read would always return 0.

Change-Id: I75256abe2556adfd66fd5963e46f9e84ae4645e1
Signed-off-by: Arve Hjønnevåg <arve@android.com>
arch/arm/kernel/etm.c