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

Commit e12d7bee authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

libutils: allow multiple ATRACE_NAMEs in a scope. am: 01937ee2 am: d28920f7

am: e152b1b4

Change-Id: Ibc2c1f24bac30b7370a166e23d4186376d45cd83
parents 90007c54 e152b1b4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -33,10 +33,10 @@

// See <cutils/trace.h> for more ATRACE_* macros.

// ATRACE_NAME traces the beginning and end of the current scope.  To trace
// the correct start and end times this macro should be declared first in the
// scope body.
#define ATRACE_NAME(name) android::ScopedTrace ___tracer(ATRACE_TAG, name)
// ATRACE_NAME traces from its location until the end of its enclosing scope.
#define _PASTE(x, y) x ## y
#define PASTE(x, y) _PASTE(x,y)
#define ATRACE_NAME(name) android::ScopedTrace PASTE(___tracer, __LINE__) (ATRACE_TAG, name)
// ATRACE_CALL is an ATRACE_NAME that uses the current function name.
#define ATRACE_CALL() ATRACE_NAME(__FUNCTION__)