OSDN Git Service

drm_hwcomposer: Add tracing for the main functions
authorStéphane Marchesin <marcheu@chromium.org>
Tue, 23 Jun 2015 23:18:10 +0000 (16:18 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Tue, 23 Jun 2015 23:33:14 +0000 (16:33 -0700)
This will help the profiling efforts, now that all the low-hanging
fruit is gone.

BUG=none
TEST=run systrace, see tracing

Change-Id: I9a149afdea8b84837c19f8e224ce8a7e2db1dd9a

drmcompositor.cpp
gl_compositor.cpp
hwcomposer.cpp

index dc4bfe8..0c6d445 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
 #define LOG_TAG "hwc-drm-compositor"
 
 #include "drmcompositor.h"
@@ -25,6 +26,7 @@
 #include <sstream>
 #include <stdlib.h>
 #include <time.h>
+#include <utils/Trace.h>
 
 #include <cutils/log.h>
 #include <sync/sync.h>
@@ -174,6 +176,7 @@ int DrmCompositor::CompositeDisplay(DrmCompositionLayerMap_t::iterator begin,
 }
 
 int DrmCompositor::Composite() {
+  ATRACE_CALL();
   int ret = pthread_mutex_lock(&lock_);
   if (ret) {
     ALOGE("Failed to acquire compositor lock %d", ret);
index 8d25101..38f1e03 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
 #define LOG_TAG "GLCompositor"
 
 #include <sstream>
@@ -35,6 +36,7 @@
 
 #include <ui/GraphicBuffer.h>
 #include <ui/PixelFormat.h>
+#include <utils/Trace.h>
 
 #include <cutils/properties.h>
 #include <sync/sync.h>
@@ -756,6 +758,7 @@ int GLCompositor::GenerateShaders() {
 }
 
 int GLCompositor::DoComposition(const GLComposition &composition) {
+  ATRACE_CALL();
   int ret = 0;
   size_t i;
   std::vector<struct texture_from_handle> layer_textures;
index 5d395b9..02c13af 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
 #define LOG_TAG "hwcomposer-drm"
 
 #include "drm_hwcomposer.h"
@@ -41,6 +42,7 @@
 #include <sync/sync.h>
 #include <ui/GraphicBuffer.h>
 #include <ui/PixelFormat.h>
+#include <utils/Trace.h>
 
 #define UM_PER_INCH 25400
 #define HWC_FB_BUFFERS 3
@@ -235,6 +237,7 @@ static int hwc_add_layer(int display, hwc_context_t *ctx, hwc_layer_1_t *layer,
 
 static int hwc_set(hwc_composer_device_1_t *dev, size_t num_displays,
                    hwc_display_contents_1_t **display_contents) {
+  ATRACE_CALL();
   struct hwc_context_t *ctx = (struct hwc_context_t *)&dev->common;
   Composition *composition =
       ctx->drm.compositor()->CreateComposition(ctx->importer);