(PanGesture) Logging enabled via environment variable 51/19451/1
authorPaul Wisbey <p.wisbey@samsung.com>
Fri, 4 Apr 2014 15:12:23 +0000 (16:12 +0100)
committerVictor Cebollada <v.cebollada@samsung.com>
Fri, 11 Apr 2014 14:30:15 +0000 (15:30 +0100)
[Issue#]   N/A
[Problem]  Touch smootness etc. is hard to profile
[Cause]    No logging features available
[Solution] Added new environment variable, usage:

  DALI_LOG_PAN_GESTURE=1 your-app.exe

Change-Id: I2cc8be26899a795c7dec93d71a062dacf498aae3
Signed-off-by: Paul Wisbey <p.wisbey@samsung.com>
adaptors/base/environment-variables.h
adaptors/base/log-options.cpp
adaptors/base/log-options.h
adaptors/tizen/internal/common/adaptor-impl.cpp

index d109e4c..13f86b9 100644 (file)
@@ -28,6 +28,8 @@ namespace Adaptor
 
 #define DALI_ENV_LOG_PERFORMANCE "DALI_LOG_PERFORMANCE"
 
+#define DALI_ENV_LOG_PAN_GESTURE "DALI_LOG_PAN_GESTURE"
+
 } // namespace Adaptor
 
 } // namespace Internal
index 9d3f175..9efea66 100644 (file)
 
 namespace Dali
 {
+
 namespace Internal
 {
+
 namespace Adaptor
 {
 
@@ -28,24 +30,26 @@ LogOptions::LogOptions()
 : mFpsFrequency(0),
   mUpdateStatusFrequency(0),
   mPerformanceLoggingLevel(0),
+  mPanGestureLoggingLevel(0),
   mLogFunction( NULL )
 {
 }
 
 LogOptions::~LogOptions()
 {
-
 }
 
 void LogOptions::SetOptions( const Dali::Integration::Log::LogFunction& logFunction,
                              unsigned int logFrameRateFrequency,
                              unsigned int logupdateStatusFrequency,
-                             unsigned int logPerformanceLevel )
+                             unsigned int logPerformanceLevel,
+                             unsigned int logPanGestureLevel )
 {
   mLogFunction = logFunction;
   mFpsFrequency = logFrameRateFrequency;
   mUpdateStatusFrequency = logupdateStatusFrequency;
   mPerformanceLoggingLevel = logPerformanceLevel;
+  mPanGestureLoggingLevel = logPanGestureLevel;
 }
 
 void LogOptions::InstallLogFunction() const
@@ -73,7 +77,13 @@ unsigned int LogOptions::GetPerformanceLoggingLevel() const
   return mPerformanceLoggingLevel;
 }
 
+unsigned int LogOptions::GetPanGestureLoggingLevel() const
+{
+  return mPanGestureLoggingLevel;
+}
 
 } // Adaptor
+
 } // Internal
+
 } // Dali
index c560921..038a437 100644 (file)
@@ -50,11 +50,13 @@ public:
    * @param logFrameRateFrequency frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
    * @param logupdateStatusFrequency frequency of how often the update status is logged in number of frames
    * @param logPerformanceLevel performance logging, 0 = disabled,  1+ =  enabled
+   * @param logPanGestureLevel pan-gesture logging, 0 = disabled,  1 = enabled
    */
   void SetOptions( const Dali::Integration::Log::LogFunction& logFunction,
                    unsigned int logFrameRateFrequency,
                    unsigned int logupdateStatusFrequency,
-                   unsigned int logPerformanceLevel );
+                   unsigned int logPerformanceLevel,
+                   unsigned int logPanGestureLevel );
 
   /**
    * Install the log function for the current thread.
@@ -81,11 +83,17 @@ public:
    */
   unsigned int GetPerformanceLoggingLevel() const;
 
+  /**
+   * @return pan-gesture logging level ( 0 == off )
+   */
+  unsigned int GetPanGestureLoggingLevel() const;
+
 private:
 
   unsigned int mFpsFrequency;                     ///< how often fps is logged out in seconds
   unsigned int mUpdateStatusFrequency;            ///< how often update status is logged out in frames
   unsigned int mPerformanceLoggingLevel;          ///< performance log level
+  unsigned int mPanGestureLoggingLevel;           ///< pan-gesture log level
 
   Dali::Integration::Log::LogFunction mLogFunction;
 
index 6222b2e..143173d 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/common/dali-common.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/core.h>
+#include <dali/integration-api/profiling.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 
 // INTERNAL INCLUDES
@@ -91,23 +92,22 @@ Dali::Adaptor* Adaptor::New( RenderSurface *surface, const DeviceLayout& baseLay
 
 void Adaptor::ParseLogOptions()
 {
-
   // get logging options
   unsigned int logFrameRateFrequency = GetIntegerEnvironmentVariable( DALI_ENV_FPS_TRACKING, 0 );
   unsigned int logupdateStatusFrequency = GetIntegerEnvironmentVariable( DALI_ENV_UPDATE_STATUS_INTERVAL, 0 );
   unsigned int logPerformanceLevel = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE, 0 );
+  unsigned int logPanGesture = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PAN_GESTURE, 0 );
 
   Dali::Integration::Log::LogFunction  logFunction(Dali::SlpPlatform::LogMessage);
 
-  mLogOptions.SetOptions( logFunction, logFrameRateFrequency, logupdateStatusFrequency, logPerformanceLevel );
+  mLogOptions.SetOptions( logFunction, logFrameRateFrequency, logupdateStatusFrequency, logPerformanceLevel, logPanGesture );
 
   // all threads here (event, update, and render) will send their logs to SLP Platform's LogMessage handler.
   // Dali::Integration::Log::LogFunction logFunction(Dali::SlpPlatform::LogMessage);
 
   mLogOptions.InstallLogFunction();
-
-
 }
+
 void Adaptor::Initialize()
 {
   ParseLogOptions();
@@ -140,6 +140,12 @@ void Adaptor::Initialize()
   mUpdateRenderController = new UpdateRenderController( *this, mLogOptions );
 
   mDaliFeedbackPlugin = new FeedbackPluginProxy( FeedbackPluginProxy::DEFAULT_OBJECT_NAME );
+
+  // Should be called after Core creation
+  if( mLogOptions.GetPanGestureLoggingLevel() )
+  {
+    Integration::EnableProfiling( Dali::Integration::PROFILING_TYPE_PAN_GESTURE );
+  }
 }
 
 Adaptor::~Adaptor()