Re-enabled performance logging 20/51920/2
authorFerran Sole <ferran.sole@samsung.com>
Tue, 17 Nov 2015 08:47:11 +0000 (08:47 +0000)
committerVictor Cebollada <v.cebollada@samsung.com>
Tue, 17 Nov 2015 16:42:19 +0000 (16:42 +0000)
Change-Id: Iee5485db65b00d46573c9ae7980d896e63d64ed0

adaptors/base/file.list
adaptors/base/performance-logging/performance-server.cpp
adaptors/base/performance-logging/performance-server.h
adaptors/common/adaptor-impl.cpp

index 9b85f44..f676131 100644 (file)
@@ -11,6 +11,8 @@ base_adaptor_src_files = \
   $(base_adaptor_src_dir)/performance-logging/frame-time-stamp.cpp \
   $(base_adaptor_src_dir)/performance-logging/frame-time-stats.cpp \
   $(base_adaptor_src_dir)/performance-logging/performance-marker.cpp \
+  $(base_adaptor_src_dir)/performance-logging/performance-server.cpp \
+  $(base_adaptor_src_dir)/performance-logging/performance-interface-factory.cpp \
   $(base_adaptor_src_dir)/performance-logging/statistics/stat-context.cpp \
   $(base_adaptor_src_dir)/performance-logging/statistics/stat-context-manager.cpp \
   $(base_adaptor_src_dir)/separate-update-render/frame-time.cpp \
index 9aabb48..2c3512c 100644 (file)
@@ -45,10 +45,12 @@ PerformanceServer::PerformanceServer( AdaptorInternalServices& adaptorServices,
 : mEnvironmentOptions( environmentOptions ),
   mKernelTrace( adaptorServices.GetKernelTraceInterface() ),
   mSystemTrace( adaptorServices.GetSystemTraceInterface() ),
+#if defined(NETWORK_LOGGING_ENABLED)
   mNetworkServer( adaptorServices, environmentOptions ),
+  mNetworkControlEnabled( mEnvironmentOptions.GetNetworkControlMode()),
+#endif
   mStatContextManager( *this ),
   mStatisticsLogBitmask( 0 ),
-  mNetworkControlEnabled( mEnvironmentOptions.GetNetworkControlMode()),
   mLoggingEnabled( false ),
   mLogFunctionInstalled( false )
 {
@@ -56,19 +58,23 @@ PerformanceServer::PerformanceServer( AdaptorInternalServices& adaptorServices,
               mEnvironmentOptions.GetPerformanceTimeStampOutput(),
               mEnvironmentOptions.GetPerformanceStatsLoggingFrequency());
 
+#if defined(NETWORK_LOGGING_ENABLED)
   if( mNetworkControlEnabled )
   {
     mLoggingEnabled  = true;
     mNetworkServer.Start();
   }
+#endif
 }
 
 PerformanceServer::~PerformanceServer()
 {
+#if defined(NETWORK_LOGGING_ENABLED)
   if( mNetworkControlEnabled )
   {
     mNetworkServer.Stop();
   }
+#endif
 
   if( mLogFunctionInstalled )
   {
@@ -186,11 +192,13 @@ void PerformanceServer::LogContextStatistics( const char* const text )
 
 void PerformanceServer::LogMarker( const PerformanceMarker& marker, const char* const description )
 {
+#if defined(NETWORK_LOGGING_ENABLED)
   // log to the network ( this is thread safe )
   if( mNetworkControlEnabled )
   {
     mNetworkServer.TransmitMarker( marker, description );
   }
+#endif
 
   // log to kernel trace
   if( mPerformanceOutputBitmask & OUTPUT_KERNEL_TRACE )
@@ -217,6 +225,7 @@ void PerformanceServer::LogMarker( const PerformanceMarker& marker, const char*
                                     "%.6f (seconds), %s\n",
                                     (float)( marker.GetTimeStamp().microseconds * MICROSECONDS_TO_SECOND ),
                                     description);
+
   }
 }
 
index a60a1a3..768f04c 100644 (file)
@@ -121,11 +121,16 @@ private:
   TraceInterface& mKernelTrace;                           ///< kernel trace interface
   TraceInterface& mSystemTrace;                           ///< system trace interface
   Dali::Mutex mLogMutex;                                  ///< mutex
+
+#if defined(NETWORK_LOGGING_ENABLED)
   NetworkPerformanceServer mNetworkServer;                ///< network server
+  bool mNetworkControlEnabled;                          ///< Whether network control is enabled
+#endif
+
   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
 };
index 3e6a1ed..cdc1405 100644 (file)
@@ -29,9 +29,7 @@
 
 // INTERNAL INCLUDES
 #include <base/thread-controller.h>
-#if defined(NETWORK_LOGGING_ENABLED)
 #  include <base/performance-logging/performance-interface-factory.h>
-#endif
 #include <base/lifecycle-observer.h>
 
 #include <dali/devel-api/text-abstraction/font-client.h>
@@ -114,12 +112,10 @@ void Adaptor::Initialize( Dali::Configuration::ContextLoss configuration )
   // Note, Tizen does not use DALI_RETAINS_ALL_DATA, as it can reload images from
   // files automatically.
 
-#if defined(NETWORK_LOGGING_ENABLED)
   if( mEnvironmentOptions->PerformanceServerRequired() )
   {
     mPerformanceInterface = PerformanceInterfaceFactory::CreateInterface( *this, *mEnvironmentOptions );
   }
-#endif
 
   mCallbackManager = CallbackManager::New();