1 #ifndef __DALI_INTERNAL_ADAPTOR_PERFORMANCE_SERVER_H__
2 #define __DALI_INTERNAL_ADAPTOR_PERFORMANCE_SERVER_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://floralicense.org/license/
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
21 #include <base/performance-logging/frame-time-stats.h>
22 #include <dali/public-api/common/dali-vector.h>
23 #include <base/interfaces/adaptor-internal-services.h>
26 #include <boost/thread/mutex.hpp>
37 class EnvironmentOptions;
39 * Concrete implementation of performance interface.
40 * Adaptor classes should never include this file, they
41 * just need to include the abstract class performance-interface.h
43 class PerformanceServer : public PerformanceInterface
50 * @param adaptorServices adaptor internal services
51 * @param environmentOptions environment options
53 PerformanceServer( AdaptorInternalServices& adaptorServices,
54 const EnvironmentOptions& environmentOptions );
59 virtual ~PerformanceServer();
62 * @copydoc PerformanceInterface::AddMarker()
64 virtual void AddMarker( PerformanceMarker::MarkerType markerType);
67 * @copydoc PerformanceInterface::SetLogging()
69 virtual void SetLogging( unsigned int level, unsigned int interval);
77 void AddMarkerToLog( PerformanceMarker marker );
82 void LogMarker(const char* name, const FrameTimeStats& frameStats);
91 bool mLoggingEnabled:1; ///< whether logging update / render to a log is enabled
92 bool mLogFunctionInstalled:1; ///< whether the log function is installed
93 unsigned int mLogLevel; ///< log level
95 unsigned int mLogFrequencyMicroseconds; ///< if logging is enabled, what frequency to log out at in micro-seconds
97 FrameTimeStats mUpdateStats; ///< update time statistics
98 FrameTimeStats mRenderStats; ///< render time statistics
99 FrameTimeStats mEventStats; ///< event time statistics
101 Integration::PlatformAbstraction& mPlatformAbstraction; ///< platform abstraction
103 typedef Dali::Vector<PerformanceMarker > MarkerVector;
104 MarkerVector mMarkers; ///< vector of markers
105 boost::mutex mDataMutex; ///< mutex
106 const EnvironmentOptions& mEnvironmentOptions; ///< environment options
107 KernelTraceInterface& mKernelTrace; ///< kernel trace interface
112 } // namespace Internal
114 } // namespace Adaptor