diff options
| author | 2019-02-28 15:10:28 -0800 | |
|---|---|---|
| committer | 2019-03-14 14:06:46 -0700 | |
| commit | 8e7dc72c26e8bf2e3ebc7e65e08f42f58ff4b6d6 (patch) | |
| tree | 8e5ea7f3da117538be244f24da1375f49f8cc7b8 | |
| parent | 2b796dabd8f4b172d2751f8de79b93cbe0f92553 (diff) | |
Add SF trace to bugreport
Automatically add SF traces to bugreport if tracing is enabled.
Test: Flash a device. Enable tracing. Use the device. Trigger a bug
report. Check if the SF trace file is in the bugreport.
Change-Id: I4f0ba3d7a762b1dad6e7706293ea33ad63ced090
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 8 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index ea1901bbf1..1083d0865a 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -4342,6 +4342,14 @@ status_t SurfaceFlinger::doDump(int fd, const DumpArgs& args, return NO_ERROR; } +status_t SurfaceFlinger::dumpCritical(int fd, const DumpArgs&, bool asProto) { + if (asProto && mTracing.isEnabled()) { + mTracing.writeToFileAsync(); + } + + return doDump(fd, DumpArgs(), asProto); +} + void SurfaceFlinger::listLayersLocked(std::string& result) const { mCurrentState.traverseInZOrder( [&](Layer* layer) { StringAppendF(&result, "%s\n", layer->getName().string()); }); diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 2b524bd46c..55949433bc 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -901,9 +901,7 @@ private: status_t doDump(int fd, const DumpArgs& args, bool asProto); - status_t dumpCritical(int fd, const DumpArgs&, bool asProto) override { - return doDump(fd, DumpArgs(), asProto); - } + status_t dumpCritical(int fd, const DumpArgs&, bool asProto); status_t dumpAll(int fd, const DumpArgs& args, bool asProto) override { return doDump(fd, args, asProto); |