Revert "[Tizen] Appendix log for ttrace + Print keycode and timestamp"
authorJiyun Yang <ji.yang@samsung.com>
Wed, 31 May 2023 04:38:35 +0000 (13:38 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 31 May 2023 04:38:35 +0000 (13:38 +0900)
This reverts commit 5bcc1aa5c324cc09ab19dcfb05a7d9247b46d3ab.

automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali/dali-test-suite-utils/test-application.h
dali/integration-api/trace.cpp
dali/integration-api/trace.h
dali/internal/event/events/key-event-processor.cpp

index a8354e8..e4c6078 100644 (file)
@@ -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.
  *
  * 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;
 }
 
   delete mCore;
 }
 
-void TestApplication::LogContext(bool start, const char* tag, const char* message)
+void TestApplication::LogContext(bool start, const char* tag)
 {
   if(start)
   {
 {
   if(start)
   {
-    fprintf(stderr, "INFO: Trace Start: %s %s\n", tag, message ? message : "");
+    fprintf(stderr, "INFO: Trace Start: %s\n", tag);
   }
   else
   {
   }
   else
   {
-    fprintf(stderr, "INFO: Trace End: %s %s\n", tag, message ? message : "");
+    fprintf(stderr, "INFO: Trace End: %s\n", tag);
   }
 }
 
   }
 }
 
index ce0e151..1b101c5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_APPLICATION_H
 
 /*
 #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.
  *
  * 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);
   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();
   Dali::Integration::Core& GetCore();
   TestPlatformAbstraction& GetPlatform();
   TestRenderController&    GetRenderController();
index 5786f3a..704e66f 100644 (file)
@@ -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.
  *
  * 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;
 }
 
   gThreadLocalLogContextFunction = logContextFunction;
 }
 
-void LogContext(bool start, const char* tag, const char* message)
+void LogContext(bool start, const char* tag)
 {
   if(!gThreadLocalLogContextFunction)
   {
     return;
   }
 {
   if(!gThreadLocalLogContextFunction)
   {
     return;
   }
-  gThreadLocalLogContextFunction(start, tag, message);
+  gThreadLocalLogContextFunction(start, tag);
 }
 
 #ifdef TRACE_ENABLED
 }
 
 #ifdef TRACE_ENABLED
@@ -109,12 +109,7 @@ void Filter::DisableGlobalTrace()
  */
 void Filter::BeginTrace(const char* tagName)
 {
  */
 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)
 {
  */
 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);
 }
 
 /**
 }
 
 /**
index 794d839..b0ad6d8 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_TRACE_H
 
 /*
 #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.
  *
  * 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
 {
 /**
  * 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.
  */
 
 /**
  * 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.
 
 /**
  * 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);
 
   /**
   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.
    */
   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();
    * Enable trace on all filters.
    */
   static void EnableGlobalTrace();
@@ -213,12 +198,6 @@ public:
     filter->BeginTrace(tag);             \
   }
 
     filter->BeginTrace(tag);             \
   }
 
-#define DALI_TRACE_BEGIN_WITH_MESSAGE(filter, tag, message) \
-  if(filter && filter->IsTraceEnabled())                    \
-  {                                                         \
-    filter->BeginTrace(tag, message);                       \
-  }
-
 /**
  * End of tracing
  */
 /**
  * End of tracing
  */
@@ -228,12 +207,6 @@ public:
     filter->EndTrace(tag);               \
   }
 
     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.
  */
 /**
  * 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_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(filter, tag)
-#define DALI_TRACE_END_WITH_MESSAGE(filter, tag, message)
 #define DALI_TRACE_FUNCTION(filter)
 #define DALI_TRACE_SCOPE(filter, tag)
 
 #define DALI_TRACE_FUNCTION(filter)
 #define DALI_TRACE_SCOPE(filter, tag)
 
index d454e5c..60fee2e 100644 (file)
@@ -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.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // CLASS HEADER
 #include <dali/internal/event/events/key-event-processor.h>
 
 // CLASS HEADER
 #include <dali/internal/event/events/key-event-processor.h>
 
-// EXTERNAL INCLUDES
-#ifdef TRACE_ENABLED
-#include <sstream> ///< for std::ostringstream
-#endif
-
 // INTERNAL INCLUDES
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/trace.h>
 // INTERNAL INCLUDES
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/trace.h>
@@ -37,14 +32,6 @@ namespace Internal
 namespace
 {
 DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
 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)
 } // 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<Dali::KeyEvent::State>(event.state), event.compose, event.deviceName, event.deviceClass, event.deviceSubclass));
   Dali::KeyEvent keyEventHandle(keyEvent.Get());
 
   KeyEventPtr    keyEvent(new KeyEvent(event.keyName, event.logicalKey, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<Dali::KeyEvent::State>(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);
 
   // 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);
   }
   {
     mScene.EmitKeyEventSignal(keyEventHandle);
   }
-#ifdef TRACE_ENABLED
-  if(gTraceFilter && gTraceFilter->IsTraceEnabled())
-  {
-    DALI_TRACE_END(gTraceFilter, "DALI_PROCESS_KEY_EVENT");
-  }
-#endif
 }
 
 } // namespace Internal
 }
 
 } // namespace Internal