Title: [200092] trunk/Source/_javascript_Core
Revision
200092
Author
[email protected]
Date
2016-04-26 09:47:33 -0700 (Tue, 26 Apr 2016)

Log Message

Improve jsc --help and making sampling options
https://bugs.webkit.org/show_bug.cgi?id=157015

Patch by Joseph Pecoraro <[email protected]> on 2016-04-26
Reviewed by Saam Barati.

Simplify sampling options to be easier to remember:

  * --reportSamplingProfilerData => --sample
  * --samplingProfilerTimingInterval => --sampleInterval

Update the --help to mention --sample, and restore the behavior of
--options outputing all possible options so you can discover which
options are available.

* jsc.cpp:
(printUsageStatement):
(CommandLine::parseArguments):
Improve help and modify option dumping.

* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::SamplingProfiler):
Rename the sampling interval option.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (200091 => 200092)


--- trunk/Source/_javascript_Core/ChangeLog	2016-04-26 16:45:13 UTC (rev 200091)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-04-26 16:47:33 UTC (rev 200092)
@@ -1,3 +1,29 @@
+2016-04-26  Joseph Pecoraro  <[email protected]>
+
+        Improve jsc --help and making sampling options
+        https://bugs.webkit.org/show_bug.cgi?id=157015
+
+        Reviewed by Saam Barati.
+
+        Simplify sampling options to be easier to remember:
+
+          * --reportSamplingProfilerData => --sample
+          * --samplingProfilerTimingInterval => --sampleInterval
+
+        Update the --help to mention --sample, and restore the behavior of
+        --options outputing all possible options so you can discover which
+        options are available.        
+
+        * jsc.cpp:
+        (printUsageStatement):
+        (CommandLine::parseArguments):
+        Improve help and modify option dumping.
+
+        * runtime/Options.h:
+        * runtime/SamplingProfiler.cpp:
+        (JSC::SamplingProfiler::SamplingProfiler):
+        Rename the sampling interval option.
+
 2016-04-26  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r200083.

Modified: trunk/Source/_javascript_Core/jsc.cpp (200091 => 200092)


--- trunk/Source/_javascript_Core/jsc.cpp	2016-04-26 16:45:13 UTC (rev 200091)
+++ trunk/Source/_javascript_Core/jsc.cpp	2016-04-26 16:47:33 UTC (rev 200092)
@@ -2100,8 +2100,9 @@
     fprintf(stderr, "  -p <file>  Outputs profiling data to a file\n");
     fprintf(stderr, "  -x         Output exit code before terminating\n");
     fprintf(stderr, "\n");
+    fprintf(stderr, "  --sample                   Collects and outputs sampling profiler data\n");
     fprintf(stderr, "  --options                  Dumps all JSC VM options and exits\n");
-    fprintf(stderr, "  --dumpOptions              Dumps all JSC VM options before continuing\n");
+    fprintf(stderr, "  --dumpOptions              Dumps all non-default JSC VM options before continuing\n");
     fprintf(stderr, "  --<jsc VM option>=<value>  Sets the specified JSC VM option\n");
     fprintf(stderr, "\n");
 
@@ -2113,7 +2114,7 @@
     Options::initialize();
     
     int i = 1;
-    bool needToDumpOptions = false;
+    JSC::Options::DumpLevel dumpOptionsLevel = JSC::Options::DumpLevel::None;
     bool needToExit = false;
 
     bool hasBadJSCOptions = false;
@@ -2171,15 +2172,15 @@
             printUsageStatement(true);
 
         if (!strcmp(arg, "--options")) {
-            needToDumpOptions = true;
+            dumpOptionsLevel = JSC::Options::DumpLevel::Verbose;
             needToExit = true;
             continue;
         }
         if (!strcmp(arg, "--dumpOptions")) {
-            needToDumpOptions = true;
+            dumpOptionsLevel = JSC::Options::DumpLevel::Overridden;
             continue;
         }
-        if (!strcmp(arg, "--reportSamplingProfilerData")) {
+        if (!strcmp(arg, "--sample")) {
             JSC::Options::useSamplingProfiler() = true;
             JSC::Options::collectSamplingProfilerDataForJSCShell() = true;
             m_dumpSamplingProfilerData = true;
@@ -2209,8 +2210,8 @@
     for (; i < argc; ++i)
         m_arguments.append(argv[i]);
 
-    if (needToDumpOptions)
-        JSC::Options::dumpAllOptions(stderr, JSC::Options::DumpLevel::Overridden, "All JSC runtime options:");
+    if (dumpOptionsLevel != JSC::Options::DumpLevel::None)
+        JSC::Options::dumpAllOptions(stderr, dumpOptionsLevel, "All JSC runtime options:");
     JSC::Options::ensureOptionsAreCoherent();
     if (needToExit)
         jscExit(EXIT_SUCCESS);

Modified: trunk/Source/_javascript_Core/runtime/Options.h (200091 => 200092)


--- trunk/Source/_javascript_Core/runtime/Options.h	2016-04-26 16:45:13 UTC (rev 200091)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2016-04-26 16:47:33 UTC (rev 200092)
@@ -315,11 +315,14 @@
     v(unsigned, forceRAMSize, 0, nullptr) \
     v(bool, recordGCPauseTimes, false, nullptr) \
     v(bool, logHeapStatisticsAtExit, false, nullptr) \
+    \
     v(bool, useTypeProfiler, false, nullptr) \
     v(bool, useControlFlowProfiler, false, nullptr) \
+    \
     v(bool, useSamplingProfiler, false, nullptr) \
-    v(unsigned, samplingProfilerTimingInterval, 1000, "Time between stack traces in microseconds.") \
-    v(bool, collectSamplingProfilerDataForJSCShell, false, "This corresponds to the JSC shell's --reportSamplingProfilerData option.") \
+    v(unsigned, sampleInterval, 1000, "Time between stack traces in microseconds.") \
+    v(bool, collectSamplingProfilerDataForJSCShell, false, "This corresponds to the JSC shell's --sample option.") \
+    \
     v(bool, alwaysGeneratePCToCodeOriginMap, false, "This will make sure we always generate a PCToCodeOriginMap for JITed code.") \
     \
     v(bool, verifyHeap, false, nullptr) \

Modified: trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp (200091 => 200092)


--- trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2016-04-26 16:45:13 UTC (rev 200091)
+++ trunk/Source/_javascript_Core/runtime/SamplingProfiler.cpp	2016-04-26 16:47:33 UTC (rev 200092)
@@ -185,7 +185,7 @@
 SamplingProfiler::SamplingProfiler(VM& vm, RefPtr<Stopwatch>&& stopwatch)
     : m_vm(vm)
     , m_stopwatch(WTFMove(stopwatch))
-    , m_timingInterval(std::chrono::microseconds(Options::samplingProfilerTimingInterval()))
+    , m_timingInterval(std::chrono::microseconds(Options::sampleInterval()))
     , m_threadIdentifier(0)
     , m_jscExecutionThread(nullptr)
     , m_isPaused(false)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to