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 <dali/public-api/common/dali-vector.h>
25 #include <base/performance-logging/frame-time-stats.h>
26 #include <base/performance-logging/networking/network-performance-server.h>
27 #include <base/interfaces/adaptor-internal-services.h>
28 #include <base/performance-logging/performance-marker.h>
29 #include <base/performance-logging/statistics/stat-context-manager.h>
40 class EnvironmentOptions;
43 * Concrete implementation of performance interface.
44 * Adaptor classes should never include this file, they
45 * just need to include the abstract class performance-interface.h
47 class PerformanceServer : public PerformanceInterface, public StatContextLogInterface
53 * @param[in] adaptorServices adaptor internal services
54 * @param[in] environmentOptions environment options
56 PerformanceServer( AdaptorInternalServices& adaptorServices,
57 const EnvironmentOptions& environmentOptions );
62 virtual ~PerformanceServer();
65 * @copydoc PerformanceLogger::AddContext()
67 virtual ContextId AddContext( const char* name );
70 * @copydoc PerformanceLogger::RemoveContext()
72 virtual void RemoveContext( ContextId contextId );
75 * @copydoc PerformanceInterface::AddMarker( MarkerType markerType )
77 virtual void AddMarker( MarkerType markerType );
80 * @copydoc PerformanceLogger::AddMarker( MarkerType markerType, ContextId contextId )
82 virtual void AddMarker( MarkerType markerType, ContextId contextId );
85 * @copydoc PerformanceInterface::SetLogging()
87 virtual void SetLogging( unsigned int statisticsLogOptions,
88 unsigned int timeStampOutput,
89 unsigned int logFrequency );
92 * @copydoc PerformanceLogger::SetLoggingFrequency()
94 virtual void SetLoggingFrequency( unsigned int logFrequency, ContextId contextId );
97 * @copydoc PerformanceLogger::EnableLogging()
99 virtual void EnableLogging( bool enable, ContextId contextId );
101 public: //StatLogInterface
104 * @copydoc StatLogInterface::LogContextStatistics()
106 virtual void LogContextStatistics( const char* const text );
111 * @brief log the marker out to kernel/ DALi log
112 * @param[in] marker performance marker
113 * @param[in] description marker description
115 void LogMarker( const PerformanceMarker& marker, const char* const description );
119 Integration::PlatformAbstraction& mPlatformAbstraction; ///< platform abstraction
120 const EnvironmentOptions& mEnvironmentOptions; ///< environment options
121 TraceInterface& mKernelTrace; ///< kernel trace interface
122 TraceInterface& mSystemTrace; ///< system trace interface
123 boost::mutex mDataMutex; ///< mutex
124 NetworkPerformanceServer mNetworkServer; ///< network server
125 StatContextManager mStatContextManager; ///< Stat context manager
126 unsigned int mStatisticsLogBitmask; ///< statistics log level
127 unsigned int mPerformanceOutputBitmask; ///< performance marker output
128 bool mNetworkControlEnabled:1; ///< Whether network control is enabled
129 bool mLoggingEnabled:1; ///< whether logging update / render to a log is enabled
130 bool mLogFunctionInstalled:1; ///< whether the log function is installed
134 } // namespace Internal
136 } // namespace Adaptor