Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit c12f28298d3ac4faf301e93da301aa0fdcb402e6
- Author: Park Ju Hyung <qkrwngud825@gmail.com>
- Date: Mon Apr 3 02:11:40 2017 +0900
- Log debugging messages only when requested
- Change-Id: If019e69f6530363d8870323c9e2e843b66b42a21
- Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
- diff --git a/common.mk b/common.mk
- index c2a6cac6..a13a34c1 100644
- --- a/common.mk
- +++ b/common.mk
- @@ -30,9 +30,19 @@ else
- LOCAL_CLANG := true
- endif
- +#Debugging mode
- +debug := false
- +
- #Common C flags
- -common_flags += -DDEBUG_CALC_FPS -Wno-missing-field-initializers
- +common_flags += -Wno-missing-field-initializers
- common_flags += -Wconversion -Wall -Werror -std=c++11
- +
- +ifeq ($(debug), true)
- + common_flags += -DDEBUG=1 -DDEBUG_CALC_FPS
- +else
- + common_flags += -Wno-unused-parameter -Wno-unused-variable
- +endif
- +
- ifneq ($(TARGET_USES_GRALLOC1), true)
- common_flags += -isystem $(display_top)/libgralloc
- else
- diff --git a/hdmi_cec/QHDMIClient.cpp b/hdmi_cec/QHDMIClient.cpp
- index 2b2b1e6f..6620768f 100644
- --- a/hdmi_cec/QHDMIClient.cpp
- +++ b/hdmi_cec/QHDMIClient.cpp
- @@ -27,7 +27,10 @@
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- +#ifndef DEBUG
- #define DEBUG 0
- +#endif
- +
- #include <QServiceUtils.h>
- #include "QHDMIClient.h"
- diff --git a/hdmi_cec/qhdmi_cec.cpp b/hdmi_cec/qhdmi_cec.cpp
- index f84cf809..6299691f 100644
- --- a/hdmi_cec/qhdmi_cec.cpp
- +++ b/hdmi_cec/qhdmi_cec.cpp
- @@ -27,7 +27,10 @@
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- +#ifndef DEBUG
- #define DEBUG 0
- +#endif
- +
- #define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
- #include <cstdlib>
- #include <cutils/log.h>
- diff --git a/libgralloc/ionalloc.cpp b/libgralloc/ionalloc.cpp
- index 96e0e3ed..4e89cce3 100644
- --- a/libgralloc/ionalloc.cpp
- +++ b/libgralloc/ionalloc.cpp
- @@ -27,7 +27,10 @@
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- +#ifndef DEBUG
- #define DEBUG 0
- +#endif
- +
- #define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
- #include <sys/ioctl.h>
- #include <sys/mman.h>
- diff --git a/libgralloc1/gr_ion_alloc.cpp b/libgralloc1/gr_ion_alloc.cpp
- index ca93a632..1830a073 100644
- --- a/libgralloc1/gr_ion_alloc.cpp
- +++ b/libgralloc1/gr_ion_alloc.cpp
- @@ -27,7 +27,10 @@
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- +#ifndef DEBUG
- #define DEBUG 0
- +#endif
- +
- #define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL)
- #include <sys/ioctl.h>
- #include <sys/mman.h>
- diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h
- index e35ddf32..440df309 100644
- --- a/sdm/include/utils/debug.h
- +++ b/sdm/include/utils/debug.h
- @@ -35,8 +35,20 @@
- #include <core/debug_interface.h>
- #include <core/display_interface.h>
- -#define DLOG(tag, method, format, ...) Debug::Get()->method(tag, __CLASS__ "::%s: " format, \
- - __FUNCTION__, ##__VA_ARGS__)
- +#ifdef DEBUG
- + #define DLOG(tag, method, format, ...) Debug::Get()->method(tag, __CLASS__ "::%s: " format, \
- + __FUNCTION__, ##__VA_ARGS__)
- +
- + #define DTRACE_BEGIN(custom_string) Debug::Get()->BeginTrace(__CLASS__, __FUNCTION__, custom_string)
- + #define DTRACE_END() Debug::Get()->EndTrace()
- + #define DTRACE_SCOPED() ScopeTracer <Debug> scope_tracer(__CLASS__, __FUNCTION__)
- +#else
- + #define DLOG(...) {}
- +
- + #define DTRACE_BEGIN(...) {}
- + #define DTRACE_END(...) {}
- + #define DTRACE_SCOPED(...) {}
- +#endif
- #define DLOGE_IF(tag, format, ...) DLOG(tag, Error, format, ##__VA_ARGS__)
- #define DLOGW_IF(tag, format, ...) DLOG(tag, Warning, format, ##__VA_ARGS__)
- @@ -50,10 +62,6 @@
- #define DLOGI(format, ...) DLOGI_IF(kTagNone, format, ##__VA_ARGS__)
- #define DLOGV(format, ...) DLOGV_IF(kTagNone, format, ##__VA_ARGS__)
- -#define DTRACE_BEGIN(custom_string) Debug::Get()->BeginTrace(__CLASS__, __FUNCTION__, custom_string)
- -#define DTRACE_END() Debug::Get()->EndTrace()
- -#define DTRACE_SCOPED() ScopeTracer <Debug> scope_tracer(__CLASS__, __FUNCTION__)
- -
- namespace sdm {
- class Debug {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement