I'm currently using atrace on Android to record and analyze the state of the OS during a video workload. Specifically, I'm monitoring the system's BufferQueue sizes throughout the execution. atrace logs the sizes of these buffers as they are queued/acquired over time.
However, in some of my traces, this leads to impossible situations. The C|171|SurfaceView|x lines denote 'x' as being the number of textures queued in the buffer. For example, sometimes during a single acquire, two buffers are removed instead of one (which should be impossible):
Binder_5-4526 ( 171) [002] ...1 1621.656462: tracing_mark_write: B|171|queueBuffer
Binder_5-4526 ( 171) [002] ...1 1621.656493: tracing_mark_write: C|171|SurfaceView|2
surfaceflinger-171 ( 171) [002] ...1 1621.664886: tracing_mark_write: B|171|acquireBuffer
surfaceflinger-171 ( 171) [002] ...1 1621.664978: tracing_mark_write: C|171|SurfaceView|0