Merge "improve SurfaceFlinger 'dumpsys' log" into honeycomb
This commit is contained in:
committed by
Android (Google) Code Review
commit
0fb9c5dcc7
@ -61,7 +61,7 @@ void GraphicBufferAllocator::dump(String8& result) const
|
|||||||
const size_t c = list.size();
|
const size_t c = list.size();
|
||||||
for (size_t i=0 ; i<c ; i++) {
|
for (size_t i=0 ; i<c ; i++) {
|
||||||
const alloc_rec_t& rec(list.valueAt(i));
|
const alloc_rec_t& rec(list.valueAt(i));
|
||||||
snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %2d | 0x%08x\n",
|
snprintf(buffer, SIZE, "%10p: %7.2f KiB | %4u (%4u) x %4u | %8X | 0x%08x\n",
|
||||||
list.keyAt(i), rec.size/1024.0f,
|
list.keyAt(i), rec.size/1024.0f,
|
||||||
rec.w, rec.s, rec.h, rec.format, rec.usage);
|
rec.w, rec.s, rec.h, rec.format, rec.usage);
|
||||||
result.append(buffer);
|
result.append(buffer);
|
||||||
|
@ -534,6 +534,12 @@ void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const
|
|||||||
result.append(buffer);
|
result.append(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LayerBase::shortDump(String8& result, char* scratch, size_t size) const
|
||||||
|
{
|
||||||
|
LayerBase::dump(result, scratch, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
int32_t LayerBaseClient::sIdentity = 1;
|
int32_t LayerBaseClient::sIdentity = 1;
|
||||||
@ -585,6 +591,12 @@ void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const
|
|||||||
result.append(buffer);
|
result.append(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LayerBaseClient::shortDump(String8& result, char* scratch, size_t size) const
|
||||||
|
{
|
||||||
|
LayerBaseClient::dump(result, scratch, size);
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
LayerBaseClient::Surface::Surface(
|
LayerBaseClient::Surface::Surface(
|
||||||
|
@ -211,6 +211,7 @@ public:
|
|||||||
|
|
||||||
/** always call base class first */
|
/** always call base class first */
|
||||||
virtual void dump(String8& result, char* scratch, size_t size) const;
|
virtual void dump(String8& result, char* scratch, size_t size) const;
|
||||||
|
virtual void shortDump(String8& result, char* scratch, size_t size) const;
|
||||||
|
|
||||||
|
|
||||||
enum { // flags for doTransaction()
|
enum { // flags for doTransaction()
|
||||||
@ -324,6 +325,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void dump(String8& result, char* scratch, size_t size) const;
|
virtual void dump(String8& result, char* scratch, size_t size) const;
|
||||||
|
virtual void shortDump(String8& result, char* scratch, size_t size) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable Mutex mLock;
|
mutable Mutex mLock;
|
||||||
|
@ -1491,8 +1491,13 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
|
|||||||
result.append(buffer);
|
result.append(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dump the visible layer list
|
||||||
|
*/
|
||||||
const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
|
const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
|
||||||
const size_t count = currentLayers.size();
|
const size_t count = currentLayers.size();
|
||||||
|
snprintf(buffer, SIZE, "Visible layers (count = %d)\n", count);
|
||||||
|
result.append(buffer);
|
||||||
for (size_t i=0 ; i<count ; i++) {
|
for (size_t i=0 ; i<count ; i++) {
|
||||||
const sp<LayerBase>& layer(currentLayers[i]);
|
const sp<LayerBase>& layer(currentLayers[i]);
|
||||||
layer->dump(result, buffer, SIZE);
|
layer->dump(result, buffer, SIZE);
|
||||||
@ -1502,6 +1507,24 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
|
|||||||
layer->visibleRegionScreen.dump(result, "visibleRegionScreen");
|
layer->visibleRegionScreen.dump(result, "visibleRegionScreen");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dump the layers in the purgatory
|
||||||
|
*/
|
||||||
|
|
||||||
|
const size_t purgatorySize = mLayerPurgatory.size();
|
||||||
|
snprintf(buffer, SIZE, "Purgatory state (%d entries)\n", purgatorySize);
|
||||||
|
result.append(buffer);
|
||||||
|
for (size_t i=0 ; i<purgatorySize ; i++) {
|
||||||
|
const sp<LayerBase>& layer(mLayerPurgatory.itemAt(i));
|
||||||
|
layer->shortDump(result, buffer, SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dump SurfaceFlinger global state
|
||||||
|
*/
|
||||||
|
|
||||||
|
snprintf(buffer, SIZE, "SurfaceFlinger global state\n");
|
||||||
|
result.append(buffer);
|
||||||
mWormholeRegion.dump(result, "WormholeRegion");
|
mWormholeRegion.dump(result, "WormholeRegion");
|
||||||
const DisplayHardware& hw(graphicPlane(0).displayHardware());
|
const DisplayHardware& hw(graphicPlane(0).displayHardware());
|
||||||
snprintf(buffer, SIZE,
|
snprintf(buffer, SIZE,
|
||||||
@ -1527,6 +1550,9 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
|
|||||||
result.append(buffer);
|
result.append(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dump HWComposer state
|
||||||
|
*/
|
||||||
HWComposer& hwc(hw.getHwComposer());
|
HWComposer& hwc(hw.getHwComposer());
|
||||||
snprintf(buffer, SIZE, " h/w composer %s and %s\n",
|
snprintf(buffer, SIZE, " h/w composer %s and %s\n",
|
||||||
hwc.initCheck()==NO_ERROR ? "present" : "not present",
|
hwc.initCheck()==NO_ERROR ? "present" : "not present",
|
||||||
@ -1534,6 +1560,9 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
|
|||||||
result.append(buffer);
|
result.append(buffer);
|
||||||
hwc.dump(result, buffer, SIZE);
|
hwc.dump(result, buffer, SIZE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dump gralloc state
|
||||||
|
*/
|
||||||
const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
|
const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get());
|
||||||
alloc.dump(result);
|
alloc.dump(result);
|
||||||
hw.dump(result);
|
hw.dump(result);
|
||||||
|
Reference in New Issue
Block a user