SF: Import ring buffer with size control in SurfaceTracing

Instead of disabling SurfaceTracing when its size exceeds the
limitation, we import the ring buffer as its storage and records the
latest status. The size of the ring buffer can be controlled when layer
trace is enabled.

Bug: b/115920963
Test: layer trace can keep at most 100MB without increasing memory usage
      in heap after 10 minutes.
Test: layer trace can keep last result in layers_trace.pb
Test: mTrace.enable can control the size of ring buffer

Change-Id: I8ce4b235b657429b7f1d9229befd509e976329fd
2 files changed