Fix ProfilerConfig::Verify(): stack tracking not requires only sampling
authorAleksei Vereshchagin <avereschagin@dev.rtsoft.ru>
Wed, 4 Apr 2018 20:38:07 +0000 (23:38 +0300)
committerAleksei Vereshchagin <avereschagin@dev.rtsoft.ru>
Wed, 4 Apr 2018 20:38:15 +0000 (23:38 +0300)
Instrumentation memory tracking with stack tracking is acceptable.
This produse only necessary stack info.

src/config/profilerconfig.cpp

index bcbc29f3778debc81393f100b14db616f0f63506..9dcdeb05b395aa9498cfec5f55aa64927f822a84 100644 (file)
@@ -64,6 +64,16 @@ std::vector<std::string> ProfilerConfig::Verify()
     {
         // Instrumentation specific options verification.
     }
+    else
+    {
+        if (StackTrackingEnabled && ExecutionTraceEnabled && MemoryTraceEnabled)
+        {
+            // We show another error if Memory Trace is disabled.
+            warnings.push_back(
+                "stack tracking option is redundant for instrumentation "
+                "when execution tracing enabled");
+        }
+    }
 
     if (CollectionMethod != CollectionMethod::Sampling)
     {
@@ -77,17 +87,8 @@ std::vector<std::string> ProfilerConfig::Verify()
 
         if (HighGranularityEnabled)
         {
-            // We don't show this message if sampling have been required for
-            // line tracing above.
             warnings.push_back("hight granularity option requires sampling");
         }
-
-        if (StackTrackingEnabled)
-        {
-            StackTrackingEnabled = false;
-            warnings.push_back(
-                "stack tracking option requires sampling and turned off");
-        }
     }
 
     if (CollectionMethod == CollectionMethod::None)