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

Commit 695e331f authored by Jamie Gennis's avatar Jamie Gennis
Browse files

BufferQueue: check before tracing buffer index

This change adds a check on ATRACE_ENABLED before calling snprintf to trace the
buffer index.

Change-Id: Id79430f9c69706393efd3d10780a4cc97055e9e0
parent 91a6826d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -57,9 +57,12 @@
#define ST_LOGE(x, ...) ALOGE("[%s] "x, mConsumerName.string(), ##__VA_ARGS__)

#define ATRACE_BUFFER_INDEX(index)                                            \
    if (ATRACE_ENABLED()) {                                                   \
        char ___traceBuf[1024];                                               \
    snprintf(___traceBuf, 1024, "%s: %d", mConsumerName.string(), (index));   \
    android::ScopedTrace ___bufTracer(ATRACE_TAG, ___traceBuf);
        snprintf(___traceBuf, 1024, "%s: %d", mConsumerName.string(),         \
                (index));                                                     \
        android::ScopedTrace ___bufTracer(ATRACE_TAG, ___traceBuf);           \
    }

namespace android {