From fe58df83b2d72c4beceb101eb9cffcc5442f3d6e Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Wed, 31 May 2023 13:38:35 +0900 Subject: [PATCH] Revert "[Tizen] Appendix log for ttrace + Print keycode and timestamp" This reverts commit 5bcc1aa5c324cc09ab19dcfb05a7d9247b46d3ab. --- .../dali-test-suite-utils/test-application.cpp | 8 ++--- .../dali/dali-test-suite-utils/test-application.h | 4 +-- dali/integration-api/trace.cpp | 20 +++-------- dali/integration-api/trace.h | 39 +++------------------- dali/internal/event/events/key-event-processor.cpp | 30 ++--------------- 5 files changed, 18 insertions(+), 83 deletions(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp index a8354e8..e4c6078 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,15 +99,15 @@ TestApplication::~TestApplication() delete mCore; } -void TestApplication::LogContext(bool start, const char* tag, const char* message) +void TestApplication::LogContext(bool start, const char* tag) { if(start) { - fprintf(stderr, "INFO: Trace Start: %s %s\n", tag, message ? message : ""); + fprintf(stderr, "INFO: Trace Start: %s\n", tag); } else { - fprintf(stderr, "INFO: Trace End: %s %s\n", tag, message ? message : ""); + fprintf(stderr, "INFO: Trace End: %s\n", tag); } } diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-application.h b/automated-tests/src/dali/dali-test-suite-utils/test-application.h index ce0e151..1b101c5 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-application.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-application.h @@ -2,7 +2,7 @@ #define DALI_TEST_APPLICATION_H /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public: void InitializeCore(); ~TestApplication() override; static void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message); - static void LogContext(bool start, const char* tag, const char* message); + static void LogContext(bool start, const char* tag); Dali::Integration::Core& GetCore(); TestPlatformAbstraction& GetPlatform(); TestRenderController& GetRenderController(); diff --git a/dali/integration-api/trace.cpp b/dali/integration-api/trace.cpp index 5786f3a..704e66f 100644 --- a/dali/integration-api/trace.cpp +++ b/dali/integration-api/trace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,13 +35,13 @@ void InstallLogContextFunction(const LogContextFunction& logContextFunction) gThreadLocalLogContextFunction = logContextFunction; } -void LogContext(bool start, const char* tag, const char* message) +void LogContext(bool start, const char* tag) { if(!gThreadLocalLogContextFunction) { return; } - gThreadLocalLogContextFunction(start, tag, message); + gThreadLocalLogContextFunction(start, tag); } #ifdef TRACE_ENABLED @@ -109,12 +109,7 @@ void Filter::DisableGlobalTrace() */ void Filter::BeginTrace(const char* tagName) { - Dali::Integration::Trace::LogContext(true, tagName, nullptr); -} - -void Filter::BeginTrace(const char* tagName, const char* message) -{ - Dali::Integration::Trace::LogContext(true, tagName, message); + Dali::Integration::Trace::LogContext(true, tagName); } /** @@ -122,12 +117,7 @@ void Filter::BeginTrace(const char* tagName, const char* message) */ void Filter::EndTrace(const char* tagName) { - Dali::Integration::Trace::LogContext(false, tagName, nullptr); -} - -void Filter::EndTrace(const char* tagName, const char* message) -{ - Dali::Integration::Trace::LogContext(false, tagName, message); + Dali::Integration::Trace::LogContext(false, tagName); } /** diff --git a/dali/integration-api/trace.h b/dali/integration-api/trace.h index 794d839..b0ad6d8 100644 --- a/dali/integration-api/trace.h +++ b/dali/integration-api/trace.h @@ -2,7 +2,7 @@ #define DALI_INTEGRATION_TRACE_H /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,16 +32,15 @@ namespace Trace { /** * Used by tracing macros to log a context message - * @param[in] start a bool to indicate start (true) or end (false) of the tracing / logging - * @param[in] tag a unique event tag name - * @param[in] message an additional message for this trace. Ignore if it is nullptr + * @param start a bool to indicate start (true) or end (false) of the tracing / logging + * @param tag a unique event tag name */ -DALI_CORE_API void LogContext(bool start, const char* tag, const char* message = nullptr); +DALI_CORE_API void LogContext(bool start, const char* tag); /** * typedef for the LogContextFunction function. */ -using LogContextFunction = void (*)(bool, const char*, const char*); +using LogContextFunction = void (*)(bool, const char*); /** * A LogContextFunction function has to be installed for every thread that wants to use tracing. @@ -119,26 +118,12 @@ public: void BeginTrace(const char* tagName); /** - * Begin trace. - * @param[in] tagName - a unique event tag name. - * @param[in] message - an additional message for this trace if needs. - */ - void BeginTrace(const char* tagName, const char* message); - - /** * End trace. * @param[in] tagName - a unique event tag name. */ void EndTrace(const char* tagName); /** - * End trace. - * @param[in] tagName - a unique event tag name. - * @param[in] message - an additional message for this trace if needs. - */ - void EndTrace(const char* tagName, const char* message); - - /** * Enable trace on all filters. */ static void EnableGlobalTrace(); @@ -213,12 +198,6 @@ public: filter->BeginTrace(tag); \ } -#define DALI_TRACE_BEGIN_WITH_MESSAGE(filter, tag, message) \ - if(filter && filter->IsTraceEnabled()) \ - { \ - filter->BeginTrace(tag, message); \ - } - /** * End of tracing */ @@ -228,12 +207,6 @@ public: filter->EndTrace(tag); \ } -#define DALI_TRACE_END_WITH_MESSAGE(filter, tag, message) \ - if(filter && filter->IsTraceEnabled()) \ - { \ - filter->EndTrace(tag, message); \ - } - /** * Used for function tracing. It logs tracing of the fuction from start to end. */ @@ -250,9 +223,7 @@ public: #define DALI_INIT_TRACE_FILTER(name, tag, enable) #define DALI_TRACE_BEGIN(filter, tag) -#define DALI_TRACE_BEGIN_WITH_MESSAGE(filter, tag, message) #define DALI_TRACE_END(filter, tag) -#define DALI_TRACE_END_WITH_MESSAGE(filter, tag, message) #define DALI_TRACE_FUNCTION(filter) #define DALI_TRACE_SCOPE(filter, tag) diff --git a/dali/internal/event/events/key-event-processor.cpp b/dali/internal/event/events/key-event-processor.cpp index d454e5c..60fee2e 100644 --- a/dali/internal/event/events/key-event-processor.cpp +++ b/dali/internal/event/events/key-event-processor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,6 @@ // CLASS HEADER #include -// EXTERNAL INCLUDES -#ifdef TRACE_ENABLED -#include ///< for std::ostringstream -#endif - // INTERNAL INCLUDES #include #include @@ -37,14 +32,6 @@ namespace Internal namespace { DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false); - -#ifdef TRACE_ENABLED -const char* KEY_EVENT_STATES[Dali::KeyEvent::State::UP + 1] = - { - "DOWN", - "UP", -}; -#endif } // namespace KeyEventProcessor::KeyEventProcessor(Scene& scene) @@ -59,14 +46,7 @@ void KeyEventProcessor::ProcessKeyEvent(const Integration::KeyEvent& event) KeyEventPtr keyEvent(new KeyEvent(event.keyName, event.logicalKey, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast(event.state), event.compose, event.deviceName, event.deviceClass, event.deviceSubclass)); Dali::KeyEvent keyEventHandle(keyEvent.Get()); -#ifdef TRACE_ENABLED - if(gTraceFilter && gTraceFilter->IsTraceEnabled()) - { - std::ostringstream stream; - stream << "[name:" << event.keyName << ", code:" << event.keyCode << ", state:" << KEY_EVENT_STATES[event.state] << ", time:" << event.time << "]"; - DALI_TRACE_BEGIN_WITH_MESSAGE(gTraceFilter, "DALI_PROCESS_KEY_EVENT", stream.str().c_str()); - } -#endif + DALI_TRACE_SCOPE(gTraceFilter, "DALI_PROCESS_KEY_EVENT"); // Emit the key event signal from the scene. bool consumed = mScene.EmitInterceptKeyEventSignal(keyEventHandle); @@ -78,12 +58,6 @@ void KeyEventProcessor::ProcessKeyEvent(const Integration::KeyEvent& event) { mScene.EmitKeyEventSignal(keyEventHandle); } -#ifdef TRACE_ENABLED - if(gTraceFilter && gTraceFilter->IsTraceEnabled()) - { - DALI_TRACE_END(gTraceFilter, "DALI_PROCESS_KEY_EVENT"); - } -#endif } } // namespace Internal -- 2.7.4