SurfaceFlinger: Trace pending BufferStateLayer buffers.

In BufferQueueLayer the BufferQueueConsumer lives inside the server
process, and ATRACE's an integer indicating the current number of
queued buffers. This makes it possible from systrace to observe
three useful points:
	1. When a buffer arrives at the server
	2. When the buffer is latched
	3. If any buffers are dropped
In BLAST this trace point has of course been moved to the client
process. In this CL we introduce some new machinery to ATRACE and
increment an integer when transactions containing a buffer arrive
at the server. We then decrement this integer when dropping a frame or
latching a buffer.

Bug: 171232941
Test: Existing tests pass
Change-Id: I2672018e4f20d683e3249141438d0716b5af9d11
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index ac0eb90..95bf510 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -480,6 +480,8 @@
     virtual void useSurfaceDamage() {}
     virtual void useEmptyDamage() {}
 
+    virtual void incrementPendingBufferCount() {}
+
     /*
      * isOpaque - true if this surface is opaque
      *
@@ -744,7 +746,7 @@
      * doTransaction - process the transaction. This is a good place to figure
      * out which attributes of the surface have changed.
      */
-    uint32_t doTransaction(uint32_t transactionFlags);
+    virtual uint32_t doTransaction(uint32_t transactionFlags);
 
     /*
      * Remove relative z for the layer if its relative parent is not part of the