diff options
author | John Reck <jreck@google.com> | 2015-06-02 15:58:43 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-06-02 15:58:43 -0700 |
commit | 4db3d17debef68f72d23999d69ae68b75f59dda3 (patch) | |
tree | e6458545b7dfedcb156ac33adba4b6162a3d09a9 | |
parent | 233241f13d5d7f841d3db80408429d4d0a528c78 (diff) | |
download | frameworks_base-4db3d17debef68f72d23999d69ae68b75f59dda3.zip frameworks_base-4db3d17debef68f72d23999d69ae68b75f59dda3.tar.gz frameworks_base-4db3d17debef68f72d23999d69ae68b75f59dda3.tar.bz2 |
FrameInfo header fixes
Bug: 21560187
Log column names as part of output in case of other such
issues
Change-Id: I16157ed968307e761d416ca54bd7af5453fe67bf
-rw-r--r-- | libs/hwui/FrameInfo.cpp | 16 | ||||
-rw-r--r-- | libs/hwui/FrameInfo.h | 3 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 6 |
3 files changed, 24 insertions, 1 deletions
diff --git a/libs/hwui/FrameInfo.cpp b/libs/hwui/FrameInfo.cpp index 6da1fa8..c24833b 100644 --- a/libs/hwui/FrameInfo.cpp +++ b/libs/hwui/FrameInfo.cpp @@ -20,6 +20,22 @@ namespace android { namespace uirenderer { +std::string FrameInfoNames[] = { + "Flags", + "IntendedVsync", + "Vsync", + "OldestInputEvent", + "NewestInputEvent", + "HandleInputStart", + "AnimationStart", + "PerformTraversalsStart", + "DrawStart", + "SyncStart", + "IssueDrawCommandsStart", + "SwapBuffers", + "FrameCompleted", +}; + void FrameInfo::importUiThreadInfo(int64_t* info) { memcpy(mFrameInfo, info, UI_THREAD_FRAME_INFO_SIZE * sizeof(int64_t)); } diff --git a/libs/hwui/FrameInfo.h b/libs/hwui/FrameInfo.h index c8189b8..816ef56 100644 --- a/libs/hwui/FrameInfo.h +++ b/libs/hwui/FrameInfo.h @@ -22,6 +22,7 @@ #include <utils/Timers.h> #include <memory.h> +#include <string> namespace android { namespace uirenderer { @@ -49,6 +50,8 @@ enum class FrameInfoIndex { kNumIndexes }; +extern std::string FrameInfoNames[]; + enum class FrameInfoFlags { kWindowLayoutChanged = 1 << 0, kRTAnimation = 1 << 1, diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 706e14e..b5d7346 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -391,7 +391,11 @@ void CanvasContext::setTextureAtlas(RenderThread& thread, void CanvasContext::dumpFrames(int fd) { FILE* file = fdopen(fd, "a"); - fprintf(file, "\n\n---PROFILEDATA---"); + fprintf(file, "\n\n---PROFILEDATA---\n"); + for (size_t i = 0; i < static_cast<size_t>(FrameInfoIndex::kNumIndexes); i++) { + fprintf(file, FrameInfoNames[i].c_str()); + fprintf(file, ","); + } for (size_t i = 0; i < mFrames.size(); i++) { FrameInfo& frame = mFrames[i]; if (frame[FrameInfoIndex::kSyncStart] == 0) { |