Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
Dali::Integration::Log::InstallLogFunction(logFunction);
+ Dali::Integration::Trace::LogContextFunction logContextFunction(&TestApplication::LogContext);
+ Dali::Integration::Trace::InstallLogContextFunction( logContextFunction );
+
+ Dali::Integration::Trace::LogContext( true, "Test" );
+
mCore->SceneCreated();
}
delete mCore;
}
+void TestApplication::LogContext( bool start, const char* tag )
+{
+ if( start )
+ {
+ fprintf(stderr, "INFO: Trace Start: %s", tag);
+ }
+ else
+ {
+ fprintf(stderr, "INFO: Trace End: %s", tag);
+ }
+}
+
void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
{
switch(level)
#include "test-render-controller.h"
#include <dali/public-api/common/dali-common.h>
#include <dali/integration-api/resource-policies.h>
+#include <dali/integration-api/trace.h>
namespace Dali
{
void Initialize();
virtual ~TestApplication();
static void LogMessage( Dali::Integration::Log::DebugPriority level, std::string& message );
+ static void LogContext( bool start, const char* tag );
Dali::Integration::Core& GetCore();
TestPlatformAbstraction& GetPlatform();
TestRenderController& GetRenderController();
$(adaptor_resampler_src_files) \
$(adaptor_video_common_src_files) \
$(adaptor_window_system_common_src_files) \
+ $(adaptor_trace_common_src_files) \
$(adaptor_window_system_ubuntu_x11_src_files) \
$(devel_api_text_abstraction_src_files) \
$(static_libraries_glyphy_src_files) \
$(adaptor_performance_logging_src_files)
endif
+if ENABLE_TRACE
+LIBDALI_ADAPTOR_LA_SOURCES += \
+ $(adaptor_trace_ubuntu_src_files)
+endif
+
endif
$(adaptor_window_system_tizen_mobile_src_files) \
$(adaptor_window_system_tizen_src_files) \
$(adaptor_window_system_tizen_wayland_src_files) \
+ $(adaptor_trace_common_src_files) \
$(devel_api_text_abstraction_src_files) \
$(static_libraries_glyphy_src_files) \
$(static_libraries_libunibreak_src_files)
$(adaptor_performance_logging_src_files)
endif
+if ENABLE_TRACE
+LIBDALI_ADAPTOR_LA_SOURCES += \
+ $(adaptor_trace_tizen_src_files)
+endif
+
endif
$(adaptor_window_system_common_src_files) \
$(adaptor_window_system_tizen_src_files) \
$(adaptor_window_system_tizen_wayland_src_files) \
+ $(adaptor_trace_common_src_files) \
$(devel_api_text_abstraction_src_files) \
$(static_libraries_glyphy_src_files) \
$(static_libraries_libunibreak_src_files)
$(adaptor_performance_logging_src_files)
endif
+if ENABLE_TRACE
+LIBDALI_ADAPTOR_LA_SOURCES += \
+ $(adaptor_trace_tizen_src_files)
+endif
+
endif
$(adaptor_window_system_common_src_files) \
$(adaptor_window_system_tizen_src_files) \
$(adaptor_window_system_tizen_wayland_src_files) \
+ $(adaptor_trace_common_src_files) \
$(devel_api_text_abstraction_src_files) \
$(static_libraries_glyphy_src_files) \
$(static_libraries_libunibreak_src_files)
$(adaptor_performance_logging_src_files)
endif
+if ENABLE_TRACE
+LIBDALI_ADAPTOR_LA_SOURCES += \
+ $(adaptor_trace_tizen_src_files)
+endif
+
endif
if COMMON_PROFILE
$(adaptor_window_system_common_src_files) \
$(adaptor_window_system_tizen_src_files) \
$(adaptor_window_system_tizen_wayland_src_files) \
+ $(adaptor_trace_common_src_files) \
$(devel_api_text_abstraction_src_files) \
$(static_libraries_glyphy_src_files) \
$(static_libraries_libunibreak_src_files)
$(adaptor_performance_logging_src_files)
endif
+if ENABLE_TRACE
+LIBDALI_ADAPTOR_LA_SOURCES += \
+ $(adaptor_trace_tizen_src_files)
+endif
+
endif
$(adaptor_window_system_tizen_src_files) \
$(adaptor_window_system_tizen_wayland_src_files) \
$(adaptor_window_system_tizen_wearable_src_files) \
+ $(adaptor_trace_common_src_files) \
$(devel_api_text_abstraction_src_files) \
$(static_libraries_glyphy_src_files) \
$(static_libraries_libunibreak_src_files)
$(adaptor_performance_logging_src_files)
endif
+if ENABLE_TRACE
+LIBDALI_ADAPTOR_LA_SOURCES += \
+ $(adaptor_trace_tizen_src_files)
+endif
+
endif
#
-# Copyright (c) 2017 Samsung Electronics Co., Ltd.
+# 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.
DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDEBUG_ENABLED"
fi
+if test "x$enable_trace" = "xyes"; then
+ DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DTRACE_ENABLED"
+fi
+
if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
fi
AM_CONDITIONAL([ENABLE_NETWORK_LOGGING], [test x$enable_networklogging = xyes])
+AM_CONDITIONAL([ENABLE_TRACE], [test x$enable_trace = xyes])
+
# Platforms should either enable features or remove them, they
# should not disable features. This allows the developer to override
# features through the command line.
-------------
Prefix: $prefix
Debug Build: $enable_debug
+ Trace Build: $enable_trace
Compile flags: $DALI_ADAPTOR_CFLAGS
Freetype bitmap support (Emoji): $freetype_bitmap_support
Profile: $enable_profile
adaptor_window_system_dir = ../../../dali/internal/window-system
include ../../../dali/internal/window-system/file.list
+# Module: trace
+adaptor_trace_dir = ../../../dali/internal/trace
+include ../../../dali/internal/trace/file.list
+
# Module: public-api
adaptor_public_api_dir = ../../../dali/public-api
include ../../../dali/public-api/file.list
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
mPerformanceInterface = PerformanceInterfaceFactory::CreateInterface( *this, *mEnvironmentOptions );
}
+ mEnvironmentOptions->CreateTraceManager( mPerformanceInterface );
+ mEnvironmentOptions->InstallTraceFunction(); // install tracing for main thread
+
mCallbackManager = CallbackManager::New();
PositionSize size = mSurface->GetPositionSize();
#define __DALI_INTERNAL_ADAPTOR_IMPL_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
namespace
{
+
const unsigned int CREATED_THREAD_COUNT = 1u;
const int CONTINUOUS = -1;
// Install a function for logging
mEnvironmentOptions.InstallLogFunction();
+ // Install a function for tracing
+ mEnvironmentOptions.InstallTraceFunction();
+
LOG_UPDATE_RENDER( "THREAD CREATED" );
mRenderHelper.InitializeEgl();
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
#include <dali/public-api/math/math-utils.h>
// INTERNAL INCLUDES
+#include <dali/internal/trace/common/trace-factory.h>
#include <dali/internal/system/common/environment-variables.h>
namespace Dali
{
}
+void EnvironmentOptions::CreateTraceManager( PerformanceInterface* performanceInterface )
+{
+ mTraceManager = TraceManagerFactory::CreateTraceFactory( performanceInterface );
+}
+
+void EnvironmentOptions::InstallTraceFunction() const
+{
+ if( mTraceManager )
+ {
+ mTraceManager->Initialise();
+ }
+}
+
void EnvironmentOptions::SetLogFunction( const Dali::Integration::Log::LogFunction& logFunction )
{
mLogFunction = logFunction;
#define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
*/
// EXTERNAL INCLUDES
+#include <memory>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
{
namespace Adaptor
{
+class TraceManager;
+class PerformanceInterface;
/**
* This class provides the environment options which define settings as well as
*/
virtual ~EnvironmentOptions();
+ /**
+ * Create a TraceManager which is used for tracing.
+ * @param PerformanceInterface for using network logging for tracing on Ubuntu
+ */
+ void CreateTraceManager( PerformanceInterface* performanceInterface );
+
+ /**
+ * Initialize TraceManager by installing Trace function.
+ */
+ void InstallTraceFunction() const;
+
/**
* @param logFunction logging function
*/
private: // Data
Dali::Integration::Log::LogFunction mLogFunction;
-
std::string mWindowName; ///< name of the window
std::string mWindowClassName; ///< name of the class the window belongs to
unsigned int mNetworkControl; ///< whether network control is enabled
bool mGlesCallAccumulate; ///< Whether or not to accumulate gles call statistics
bool mDepthBufferRequired; ///< Whether the depth buffer is required
bool mStencilBufferRequired; ///< Whether the stencil buffer is required
+ std::unique_ptr<TraceManager> mTraceManager; ///< TraceManager
};
} // Adaptor
--- /dev/null
+/*
+ * 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>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace TraceManagerFactory
+{
+
+// Factory function creating new TraceFactory
+// Symbol exists but may be overriden during linking
+
+__attribute__((weak))
+TraceManagerUPtr CreateTraceFactory( PerformanceInterface* performanceInterface )
+{
+ // return empty handle if TraceManager not implemented
+ return nullptr;
+}
+
+} // namespace TraceManagerFactory
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
\ No newline at end of file
--- /dev/null
+#ifndef DALI_INTERNAL_TRACE_FACTORY_H
+#define DALI_INTERNAL_TRACE_FACTORY_H
+
+/*
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali/internal/trace/common/trace-manager-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace TraceManagerFactory
+{
+
+using TraceManagerUPtr = std::unique_ptr<TraceManager>;
+
+// Factory function creating new TraceFactory
+// Symbol exists but may be overriden during linking
+TraceManagerUPtr CreateTraceFactory( PerformanceInterface* performanceInterface );
+
+} // namespace TraceManagerFactory
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif //DALI_INTERNAL_TRACE_FACTORY_H
--- /dev/null
+/*
+ * 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/common/trace-manager-impl.h>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+TraceManager::TraceManager( PerformanceInterface* performanceInterface )
+: mPerformanceInterface( performanceInterface )
+{
+}
+
+bool TraceManager::Initialise()
+{
+ auto logFunction = GetLogContextFunction();
+ if( !logFunction )
+ {
+ return false;
+ }
+ Dali::Integration::Trace::InstallLogContextFunction( logFunction );
+ return true;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_TRACE_MANAGER_IMPL_H
+#define DALI_INTERNAL_TRACE_MANAGER_IMPL_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
+#include <dali/integration-api/trace.h>
+
+// INTERNAL INCLUDES
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+class PerformanceInterface;
+
+class TraceManager
+{
+public:
+
+ /**
+ * Explicit Constructor
+ */
+ explicit TraceManager( PerformanceInterface* performanceInterface );
+
+ /**
+ * Constructor
+ */
+ TraceManager() = default;
+
+ /**
+ * Virtual Destructor
+ */
+ virtual ~TraceManager() = default;
+
+ /**
+ * Second phase initialisation of TraceManager
+ */
+ bool Initialise();
+
+ /**
+ * Used for network server logging on Ubuntu
+ */
+ PerformanceInterface* mPerformanceInterface;
+
+protected:
+
+ /**
+ * Obtain the platform dependent LogContextFunction method used for tracing
+ */
+ virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction() { return nullptr; };
+
+private:
+
+ /**
+ * Set / Install the platform dependent trace function
+ * @param logContextFunction - Platform dependent trace function
+ */
+ void SetTraceLogContextFunction( const Dali::Integration::Trace::LogContextFunction& logContextFunction );
+
+ TraceManager( const TraceManager& ) = delete;
+ TraceManager& operator=( TraceManager& ) = delete;
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_TRACE_MANAGER_IMPL_H
--- /dev/null
+
+
+# module: trace, backend: common
+adaptor_trace_common_src_files=\
+ ${adaptor_trace_dir}/common/trace-manager-impl.cpp \
+ ${adaptor_trace_dir}/common/trace-factory.cpp
+
+# 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
+
+# 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
--- /dev/null
+/*
+ * 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/tizen/trace-manager-impl-tizen.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::TraceManagerTizen( performanceInterface ) );
+}
+
+} // namespace TraceManagerFactory
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
\ No newline at end of file
--- /dev/null
+/*
+ * 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 <ttrace.h>
+#include <dali/internal/trace/tizen/trace-manager-impl-tizen.h>
+
+// INTERNAL INCLUDES
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+TraceManagerTizen::TraceManagerTizen( PerformanceInterface* performanceInterface )
+: TraceManager( performanceInterface )
+{
+}
+
+Dali::Integration::Trace::LogContextFunction TraceManagerTizen::GetLogContextFunction()
+{
+ return LogContext;
+}
+
+void TraceManagerTizen::LogContext( bool start, const char* tag )
+{
+ if( start )
+ {
+ traceBegin( TTRACE_TAG_GRAPHICS, tag );
+ }
+ else
+ {
+ traceEnd( TTRACE_TAG_GRAPHICS );
+ }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INTERNAL_TRACE_MANAGER_IMPL_TIZEN_H
+#define DALI_INTERNAL_TRACE_MANAGER_IMPL_TIZEN_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 TraceManagerTizen : public Dali::Internal::Adaptor::TraceManager
+{
+public:
+ /**
+ * Explicit Constructor
+ */
+ explicit TraceManagerTizen( PerformanceInterface* performanceInterface );
+
+protected:
+
+ /**
+ * Destructor
+ */
+ ~TraceManagerTizen() override = default;
+
+ /**
+ * Obtain the LogContextFunction method (Tizen specific) used for tracing
+ */
+ virtual Dali::Integration::Trace::LogContextFunction GetLogContextFunction() final;
+
+private:
+
+ /**
+ * LogContext method (Tizen specific) used for tracing
+ */
+ static void LogContext( bool start, const char* tag );
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_TRACE_MANAGER_IMPL_TIZEN_H
--- /dev/null
+/*
+ * 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
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
%build
PREFIX+="/usr"
CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -DGL_GLEXT_PROTOTYPES"
-LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
+LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -lttrace -Wl,-Bsymbolic-functions "
%ifarch %{arm}
CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.mobile"; done
-for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
mv pkgconfig/dali-adaptor*pc %{_builddir}/%{name}-%{version}/build/tizen/
popd
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.tv"; done
-for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
mv pkgconfig/dali-adaptor*pc %{_builddir}/%{name}-%{version}/build/tizen/
popd
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.wearable"; done
-for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
mv pkgconfig/dali-adaptor*pc %{_builddir}/%{name}-%{version}/build/tizen/
popd
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adaptor*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.ivi"; done
-for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
mv pkgconfig/dali-adaptor*pc %{_builddir}/%{name}-%{version}/build/tizen/
popd
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
-for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin*-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
mv pkgconfig/dali-adaptor*pc %{_builddir}/%{name}-%{version}/build/tizen/
popd
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.mobile"; done
-for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
popd
make clean
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.tv"; done
-for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
popd
make clean
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.wearable"; done
-for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
popd
make clean
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
pushd %{buildroot}%{_libdir}
for FILE in libdali-adap*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.ivi"; done
-for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
+for FILE in libdali-*plugin.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
popd
make clean
%endif
%if 0%{?enable_debug}
--enable-debug \
+%endif
+%if 0%{?enable_trace}
+ --enable-trace \
%endif
--enable-appfw=yes \
$configure_flags --libdir=%{_libdir} \
popd
################################################
-#rename
+#rename
###############################################
pushd %{buildroot}%{_libdir}