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)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:09:59 +0000 (09:09 -0700)
commit5f388f32b6c022d65ea5132df4e8bca8b8a5bfa3
treed7277831cd86bcccbbccd96c070aae82feeba270
parentccd3dbcbf1c62610d455222e6da11397d502c582
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