diff options
author | Mathias Agopian <mathias@google.com> | 2017-02-28 15:06:51 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2017-03-03 14:47:47 -0800 |
commit | 22dbf3947fedf988e714a4703ddf85fc41413f90 (patch) | |
tree | ad823e9592de58265e4740a4d1ae251bfa260348 /libutils/include/utils/Trace.h | |
parent | 6048d9db5f11045412504b533ea9a92a7df6354c (diff) |
clean-up libutils includes
moved Foo.h as first include of Foo.cpp, and
removed redundant includes.
Made NativeHandle non virtual.
Test: run & compile
Bug: n/a
Change-Id: I37fa746cd42c9ba23aba181f84cb6c619386406a
Diffstat (limited to 'libutils/include/utils/Trace.h')
-rw-r--r-- | libutils/include/utils/Trace.h | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/libutils/include/utils/Trace.h b/libutils/include/utils/Trace.h index eeba40d65..5e9229c1e 100644 --- a/libutils/include/utils/Trace.h +++ b/libutils/include/utils/Trace.h @@ -19,16 +19,8 @@ #if defined(__ANDROID__) -#include <fcntl.h> #include <stdint.h> -#include <stdio.h> -#include <string.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <unistd.h> - -#include <cutils/compiler.h> -#include <utils/threads.h> + #include <cutils/trace.h> // See <cutils/trace.h> for more ATRACE_* macros. @@ -37,6 +29,7 @@ #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__) @@ -44,14 +37,13 @@ namespace android { class ScopedTrace { public: -inline ScopedTrace(uint64_t tag, const char* name) - : mTag(tag) { - atrace_begin(mTag,name); -} - -inline ~ScopedTrace() { - atrace_end(mTag); -} + inline ScopedTrace(uint64_t tag, const char* name) : mTag(tag) { + atrace_begin(mTag, name); + } + + inline ~ScopedTrace() { + atrace_end(mTag); + } private: uint64_t mTag; |