From 8e7dc72c26e8bf2e3ebc7e65e08f42f58ff4b6d6 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Thu, 28 Feb 2019 15:10:28 -0800 Subject: 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 --- services/surfaceflinger/SurfaceFlinger.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') 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()); }); -- cgit v1.2.3-59-g8ed1b