#ifndef __DALI_INTERNAL_ADAPTOR_PERFORMANCE_SERVER_H__
#define __DALI_INTERNAL_ADAPTOR_PERFORMANCE_SERVER_H__
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * Copyright (c) 2014 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 INCLDUES
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/devel-api/common/mutex.h>
// INTERNAL INCLUDES
#include <base/performance-logging/frame-time-stats.h>
-#include <dali/public-api/common/dali-vector.h>
+#include <base/performance-logging/networking/network-performance-server.h>
#include <base/interfaces/adaptor-internal-services.h>
-
-// EXTERNAL INCLUDES
-#include <boost/thread/mutex.hpp>
+#include <base/performance-logging/performance-marker.h>
+#include <base/performance-logging/statistics/stat-context-manager.h>
namespace Dali
{
{
class EnvironmentOptions;
+class StatContext;
/**
* Concrete implementation of performance interface.
* Adaptor classes should never include this file, they
* just need to include the abstract class performance-interface.h
*/
-class PerformanceServer : public PerformanceInterface
+class PerformanceServer : public PerformanceInterface, public StatContextLogInterface
{
-
public:
/**
- * Constructor
- * @param adaptorServices adaptor internal services
- * @param environmentOptions environment options
+ * @brief Constructor
+ * @param[in] adaptorServices adaptor internal services
+ * @param[in] environmentOptions environment options
*/
PerformanceServer( AdaptorInternalServices& adaptorServices,
const EnvironmentOptions& environmentOptions );
virtual ~PerformanceServer();
/**
- * @copydoc PerformanceInterface::AddMarker()
+ * @copydoc PerformanceLogger::AddContext()
*/
- virtual void AddMarker( PerformanceMarker::MarkerType markerType);
+ virtual ContextId AddContext( const char* name );
/**
- * @copydoc PerformanceInterface::SetLogging()
+ * @copydoc PerformanceLogger::RemoveContext()
*/
- virtual void SetLogging( unsigned int level, unsigned int interval);
-
+ virtual void RemoveContext( ContextId contextId );
-private:
+ /**
+ * @copydoc PerformanceInterface::AddMarker( MarkerType markerType )
+ */
+ virtual void AddMarker( MarkerType markerType );
/**
- * Helper
+ * @copydoc PerformanceLogger::AddMarker( MarkerType markerType, ContextId contextId )
*/
- void AddMarkerToLog( PerformanceMarker marker );
+ virtual void AddMarker( MarkerType markerType, ContextId contextId );
/**
- * Helper
+ * @copydoc PerformanceInterface::SetLogging()
*/
- void LogMarker(const char* name, const FrameTimeStats& frameStats);
+ virtual void SetLogging( unsigned int statisticsLogOptions,
+ unsigned int timeStampOutput,
+ unsigned int logFrequency );
/**
- * log markers out
+ * @copydoc PerformanceLogger::SetLoggingFrequency()
*/
- void LogMarkers();
+ virtual void SetLoggingFrequency( unsigned int logFrequency, ContextId contextId );
-private:
+ /**
+ * @copydoc PerformanceLogger::EnableLogging()
+ */
+ virtual void EnableLogging( bool enable, ContextId contextId );
- bool mLoggingEnabled:1; ///< whether logging update / render to a log is enabled
- bool mLogFunctionInstalled:1; ///< whether the log function is installed
- unsigned int mLogLevel; ///< log level
+public: //StatLogInterface
- unsigned int mLogFrequencyMicroseconds; ///< if logging is enabled, what frequency to log out at in micro-seconds
+ /**
+ * @copydoc StatLogInterface::LogContextStatistics()
+ */
+ virtual void LogContextStatistics( const char* const text );
- FrameTimeStats mUpdateStats; ///< update time statistics
- FrameTimeStats mRenderStats; ///< render time statistics
- FrameTimeStats mEventStats; ///< event time statistics
+private:
- Integration::PlatformAbstraction& mPlatformAbstraction; ///< platform abstraction
+ /**
+ * @brief log the marker out to kernel/ DALi log
+ * @param[in] marker performance marker
+ * @param[in] description marker description
+ */
+ void LogMarker( const PerformanceMarker& marker, const char* const description );
- typedef Dali::Vector<PerformanceMarker > MarkerVector;
- MarkerVector mMarkers; ///< vector of markers
- boost::mutex mDataMutex; ///< mutex
- const EnvironmentOptions& mEnvironmentOptions; ///< environment options
- KernelTraceInterface& mKernelTrace; ///< kernel trace interface
+private:
+ Integration::PlatformAbstraction& mPlatformAbstraction; ///< platform abstraction
+ const EnvironmentOptions& mEnvironmentOptions; ///< environment options
+ TraceInterface& mKernelTrace; ///< kernel trace interface
+ TraceInterface& mSystemTrace; ///< system trace interface
+ Dali::Mutex mLogMutex; ///< mutex
+ NetworkPerformanceServer mNetworkServer; ///< network server
+ StatContextManager mStatContextManager; ///< Stat context manager
+ unsigned int mStatisticsLogBitmask; ///< statistics log level
+ unsigned int mPerformanceOutputBitmask; ///< performance marker output
+ bool mNetworkControlEnabled:1; ///< Whether network control is enabled
+ bool mLoggingEnabled:1; ///< whether logging update / render to a log is enabled
+ bool mLogFunctionInstalled:1; ///< whether the log function is installed
};