Ignore:
Timestamp:
Apr 26, 2016, 9:47:33 AM (9 years ago)
Author:
[email protected]
Message:

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

Patch by Joseph Pecoraro <Joseph Pecoraro> 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r199863 r200092  
    21012101    fprintf(stderr, "  -x         Output exit code before terminating\n");
    21022102    fprintf(stderr, "\n");
     2103    fprintf(stderr, "  --sample                   Collects and outputs sampling profiler data\n");
    21032104    fprintf(stderr, "  --options                  Dumps all JSC VM options and exits\n");
    2104     fprintf(stderr, "  --dumpOptions              Dumps all JSC VM options before continuing\n");
     2105    fprintf(stderr, "  --dumpOptions              Dumps all non-default JSC VM options before continuing\n");
    21052106    fprintf(stderr, "  --<jsc VM option>=<value>  Sets the specified JSC VM option\n");
    21062107    fprintf(stderr, "\n");
     
    21142115   
    21152116    int i = 1;
    2116     bool needToDumpOptions = false;
     2117    JSC::Options::DumpLevel dumpOptionsLevel = JSC::Options::DumpLevel::None;
    21172118    bool needToExit = false;
    21182119
     
    21722173
    21732174        if (!strcmp(arg, "--options")) {
    2174             needToDumpOptions = true;
     2175            dumpOptionsLevel = JSC::Options::DumpLevel::Verbose;
    21752176            needToExit = true;
    21762177            continue;
    21772178        }
    21782179        if (!strcmp(arg, "--dumpOptions")) {
    2179             needToDumpOptions = true;
     2180            dumpOptionsLevel = JSC::Options::DumpLevel::Overridden;
    21802181            continue;
    21812182        }
    2182         if (!strcmp(arg, "--reportSamplingProfilerData")) {
     2183        if (!strcmp(arg, "--sample")) {
    21832184            JSC::Options::useSamplingProfiler() = true;
    21842185            JSC::Options::collectSamplingProfilerDataForJSCShell() = true;
     
    22102211        m_arguments.append(argv[i]);
    22112212
    2212     if (needToDumpOptions)
    2213         JSC::Options::dumpAllOptions(stderr, JSC::Options::DumpLevel::Overridden, "All JSC runtime options:");
     2213    if (dumpOptionsLevel != JSC::Options::DumpLevel::None)
     2214        JSC::Options::dumpAllOptions(stderr, dumpOptionsLevel, "All JSC runtime options:");
    22142215    JSC::Options::ensureOptionsAreCoherent();
    22152216    if (needToExit)
Note: See TracChangeset for help on using the changeset viewer.