Move trace factory Ubuntu implementation to generic. 50/208450/3
authorAnton Obzhirov <a.obzhirov@samsung.com>
Mon, 24 Jun 2019 10:36:52 +0000 (11:36 +0100)
committerAnton Obzhirov <a.obzhirov@samsung.com>
Mon, 24 Jun 2019 12:22:03 +0000 (13:22 +0100)
Change-Id: Ic34941ea014408a844a3d2777c87a375392e190f

dali/internal/trace/file.list
dali/internal/trace/generic/trace-factory-generic.cpp [new file with mode: 0644]
dali/internal/trace/generic/trace-manager-impl-generic.cpp [new file with mode: 0644]
dali/internal/trace/generic/trace-manager-impl-generic.h [new file with mode: 0644]
dali/internal/trace/ubuntu/trace-factory-ubuntu.cpp [deleted file]
dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.cpp [deleted file]
dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.h [deleted file]

index 9b94bd6322c7afbb5a6fc063f4851693802d757b..833aa4e1a2174db12c35f0abe3aee139800e6962 100644 (file)
@@ -7,10 +7,10 @@ adaptor_trace_common_src_files=\
 
 # module: trace, backend: ubuntu
 adaptor_trace_ubuntu_src_files=\
-    ${adaptor_trace_dir}/ubuntu/trace-manager-impl-ubuntu.cpp \
-    ${adaptor_trace_dir}/ubuntu/trace-factory-ubuntu.cpp
+    ${adaptor_trace_dir}/generic/trace-manager-impl-generic.cpp \
+    ${adaptor_trace_dir}/generic/trace-factory-generic.cpp
 
 # module: trace, backend: tizen
 adaptor_trace_tizen_src_files=\
     ${adaptor_trace_dir}/tizen/trace-manager-impl-tizen.cpp \
-    ${adaptor_trace_dir}/tizen/trace-factory-tizen.cpp
\ No newline at end of file
+    ${adaptor_trace_dir}/tizen/trace-factory-tizen.cpp
diff --git a/dali/internal/trace/generic/trace-factory-generic.cpp b/dali/internal/trace/generic/trace-factory-generic.cpp
new file mode 100644 (file)
index 0000000..844fc40
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/internal/trace/common/trace-factory.h>
+#include <dali/internal/trace/generic/trace-manager-impl-generic.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace TraceManagerFactory
+{
+
+// TraceManager Factory to be implemented by the platform
+TraceManagerUPtr CreateTraceFactory( PerformanceInterface* performanceInterface )
+{
+  return TraceManagerUPtr( new Dali::Internal::Adaptor::TraceManagerUbuntu( performanceInterface ) );
+}
+
+} // namespace TraceManagerFactory
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
\ No newline at end of file
diff --git a/dali/internal/trace/generic/trace-manager-impl-generic.cpp b/dali/internal/trace/generic/trace-manager-impl-generic.cpp
new file mode 100644 (file)
index 0000000..45861a5
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/internal/system/common/performance-interface.h>
+#include "trace-manager-impl-generic.h"
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+TraceManagerGeneric* TraceManagerGeneric::traceManagerGeneric = nullptr;
+
+TraceManagerGeneric::TraceManagerGeneric( PerformanceInterface* performanceInterface )
+: TraceManager( performanceInterface )
+{
+  TraceManagerGeneric::traceManagerGeneric = this;
+}
+
+Dali::Integration::Trace::LogContextFunction TraceManagerGeneric::GetLogContextFunction()
+{
+  return LogContext;
+}
+
+void TraceManagerGeneric::LogContext( bool start, const char* tag )
+{
+  if( start )
+  {
+    unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext( tag );
+    traceManagerGeneric->mPerformanceInterface->AddMarker( PerformanceInterface::START, contextId );
+  }
+  else
+  {
+    unsigned short contextId = traceManagerGeneric->mPerformanceInterface->AddContext( tag );
+    traceManagerGeneric->mPerformanceInterface->AddMarker( PerformanceInterface::END, contextId );
+  }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/trace/generic/trace-manager-impl-generic.h b/dali/internal/trace/generic/trace-manager-impl-generic.h
new file mode 100644 (file)
index 0000000..c9a755f
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef DALI_INTERNAL_TRACE_MANAGER_IMPL_UBUNTU_H
+#define DALI_INTERNAL_TRACE_MANAGER_IMPL_UBUNTU_H
+
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include <dali/internal/trace/common/trace-manager-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+class PerformanceInterface;
+
+class TraceManagerGeneric : public Dali::Internal::Adaptor::TraceManager
+{
+public:
+  /**
+   * Static member to hold TraceManagerUbuntu instance. This allows
+   * to access PerformanceInterface for network logging.
+   */
+  static TraceManagerGeneric* traceManagerGeneric;
+
+  /**
+   * Explicit Constructor
+   */
+  explicit TraceManagerGeneric( PerformanceInterface* performanceInterface );
+
+protected:
+  /**
+   * Destructor
+   */
+  ~TraceManagerGeneric() override = default;
+
+  /**
+   * Obtain the LogContextFunction method (Ubuntu specific) used for tracing
+   */
+  virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
+
+private:
+
+  /**
+   * LogContext method (Ubuntu specific) used for tracing
+   */
+  static void LogContext( bool start, const char* tag );
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_TRACE_MANAGER_IMPL_UBUNTU_H
diff --git a/dali/internal/trace/ubuntu/trace-factory-ubuntu.cpp b/dali/internal/trace/ubuntu/trace-factory-ubuntu.cpp
deleted file mode 100644 (file)
index 63b2592..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2017 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/internal/trace/common/trace-factory.h>
-#include <dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace TraceManagerFactory
-{
-
-// TraceManager Factory to be implemented by the platform
-TraceManagerUPtr CreateTraceFactory( PerformanceInterface* performanceInterface )
-{
-  return TraceManagerUPtr( new Dali::Internal::Adaptor::TraceManagerUbuntu( performanceInterface ) );
-}
-
-} // namespace TraceManagerFactory
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
\ No newline at end of file
diff --git a/dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.cpp b/dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.cpp
deleted file mode 100644 (file)
index c172c1a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2018 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.h>
-#include <dali/internal/system/common/performance-interface.h>
-
-// INTERNAL INCLUDES
-
-namespace Dali
-{
-
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-TraceManagerUbuntu* TraceManagerUbuntu::traceManagerUbuntu = nullptr;
-
-TraceManagerUbuntu::TraceManagerUbuntu( PerformanceInterface* performanceInterface )
-: TraceManager( performanceInterface )
-{
-  TraceManagerUbuntu::traceManagerUbuntu = this;
-}
-
-Dali::Integration::Trace::LogContextFunction TraceManagerUbuntu::GetLogContextFunction()
-{
-  return LogContext;
-}
-
-void TraceManagerUbuntu::LogContext( bool start, const char* tag )
-{
-  if( start )
-  {
-    unsigned short contextId = traceManagerUbuntu->mPerformanceInterface->AddContext( tag );
-    traceManagerUbuntu->mPerformanceInterface->AddMarker( PerformanceInterface::START, contextId );
-  }
-  else
-  {
-    unsigned short contextId = traceManagerUbuntu->mPerformanceInterface->AddContext( tag );
-    traceManagerUbuntu->mPerformanceInterface->AddMarker( PerformanceInterface::END, contextId );
-  }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.h b/dali/internal/trace/ubuntu/trace-manager-impl-ubuntu.h
deleted file mode 100644 (file)
index 7590bdf..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef DALI_INTERNAL_TRACE_MANAGER_IMPL_UBUNTU_H
-#define DALI_INTERNAL_TRACE_MANAGER_IMPL_UBUNTU_H
-
-/*
- * Copyright (c) 2018 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-
-// INTERNAL INCLUDES
-#include <dali/internal/trace/common/trace-manager-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-class PerformanceInterface;
-
-class TraceManagerUbuntu : public Dali::Internal::Adaptor::TraceManager
-{
-public:
-  /**
-   * Static member to hold TraceManagerUbuntu instance. This allows
-   * to access PerformanceInterface for network logging.
-   */
-  static TraceManagerUbuntu* traceManagerUbuntu;
-
-  /**
-   * Explicit Constructor
-   */
-  explicit TraceManagerUbuntu( PerformanceInterface* performanceInterface );
-
-protected:
-  /**
-   * Destructor
-   */
-  ~TraceManagerUbuntu() override = default;
-
-  /**
-   * Obtain the LogContextFunction method (Ubuntu specific) used for tracing
-   */
-  virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
-
-private:
-
-  /**
-   * LogContext method (Ubuntu specific) used for tracing
-   */
-  static void LogContext( bool start, const char* tag );
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_TRACE_MANAGER_IMPL_UBUNTU_H