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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <base/performance-logging/frame-time-stats.h>
23 #include <dali/public-api/common/dali-vector.h>
24 #include <base/interfaces/adaptor-internal-services.h>
27 #include <boost/thread/mutex.hpp>
38 class EnvironmentOptions;
40 * Concrete implementation of performance interface.
41 * Adaptor classes should never include this file, they
42 * just need to include the abstract class performance-interface.h
44 class PerformanceServer : public PerformanceInterface
51 * @param adaptorServices adaptor internal services
52 * @param environmentOptions environment options
54 PerformanceServer( AdaptorInternalServices& adaptorServices,
55 const EnvironmentOptions& environmentOptions );
60 virtual ~PerformanceServer();
63 * @copydoc PerformanceInterface::AddMarker()
65 virtual void AddMarker( PerformanceMarker::MarkerType markerType);
68 * @copydoc PerformanceInterface::SetLogging()
70 virtual void SetLogging( unsigned int level, unsigned int interval);
78 void AddMarkerToLog( PerformanceMarker marker );
83 void LogMarker(const char* name, const FrameTimeStats& frameStats);
92 bool mLoggingEnabled:1; ///< whether logging update / render to a log is enabled
93 bool mLogFunctionInstalled:1; ///< whether the log function is installed
94 unsigned int mLogLevel; ///< log level
96 unsigned int mLogFrequencyMicroseconds; ///< if logging is enabled, what frequency to log out at in micro-seconds
98 FrameTimeStats mUpdateStats; ///< update time statistics
99 FrameTimeStats mRenderStats; ///< render time statistics
100 FrameTimeStats mEventStats; ///< event time statistics
102 Integration::PlatformAbstraction& mPlatformAbstraction; ///< platform abstraction
104 typedef Dali::Vector<PerformanceMarker > MarkerVector;
105 MarkerVector mMarkers; ///< vector of markers
106 boost::mutex mDataMutex; ///< mutex
107 const EnvironmentOptions& mEnvironmentOptions; ///< environment options
108 KernelTraceInterface& mKernelTrace; ///< kernel trace interface
113 } // namespace Internal
115 } // namespace Adaptor