Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e7dc72c authored by Nataniel Borges's avatar Nataniel Borges
Browse files

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
parent 2b796dab
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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()); });
+1 −3
Original line number Diff line number Diff line
@@ -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);