Bug 176722 - Make jsc dump the command line if JSC_dumpOption environment variable is set with a non-zero value.
Summary: Make jsc dump the command line if JSC_dumpOption environment variable is set ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-11 12:46 PDT by Mark Lam
Modified: 2017-09-27 12:33 PDT (History)
8 users (show)

See Also:


Attachments
proposed patch. (1.34 KB, patch)
2017-09-11 12:48 PDT, Mark Lam
jfbastien: review+
Details | Formatted Diff | Diff
proposed patch. (1.90 KB, patch)
2017-09-11 13:53 PDT, Mark Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2017-09-11 12:46:30 PDT
Currently, specifying the JSC_dumpOption=<non zero value> environment variable will cause JSC options to be dumped via dataLog.  This is useful for debugging what options are used for any specific test run.  This patch adds the dumping of the command line as well so that it's easier to determine the command line that test scripts invoked jsc with for any given test run (without needing to decode the layers of test scripts).
Comment 1 Mark Lam 2017-09-11 12:48:55 PDT
Created attachment 320457 [details]
proposed patch.
Comment 2 JF Bastien 2017-09-11 12:51:53 PDT
Comment on attachment 320457 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=320457&action=review

> Source/JavaScriptCore/jsc.cpp:3846
> +    if (dumpOptionsOption && strcmp(dumpOptionsOption, "0")) {

OptionsOptionOptionsOptionsOptionOptions

Code seems to usually do:
!strcasecmp(string, "none") || !strcasecmp(string, "no") || !strcasecmp(string, "false") || !strcmp(string, "0")

?
Comment 3 Saam Barati 2017-09-11 12:56:43 PDT
Comment on attachment 320457 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=320457&action=review

>> Source/JavaScriptCore/jsc.cpp:3846
>> +    if (dumpOptionsOption && strcmp(dumpOptionsOption, "0")) {
> 
> OptionsOptionOptionsOptionsOptionOptions
> 
> Code seems to usually do:
> !strcasecmp(string, "none") || !strcasecmp(string, "no") || !strcasecmp(string, "false") || !strcmp(string, "0")
> 
> ?

let's use strncmp
Also, Options seems to allow for "false" and "False"
Comment 4 Saam Barati 2017-09-11 12:58:14 PDT
Comment on attachment 320457 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=320457&action=review

>>> Source/JavaScriptCore/jsc.cpp:3846
>>> +    if (dumpOptionsOption && strcmp(dumpOptionsOption, "0")) {
>> 
>> OptionsOptionOptionsOptionsOptionOptions
>> 
>> Code seems to usually do:
>> !strcasecmp(string, "none") || !strcasecmp(string, "no") || !strcasecmp(string, "false") || !strcmp(string, "0")
>> 
>> ?
> 
> let's use strncmp
> Also, Options seems to allow for "false" and "False"

I think you should do this after Options::initialize so you can just write code like:
if (Options::dumpOptions()) ....
Comment 5 Mark Lam 2017-09-11 13:48:41 PDT
Comment on attachment 320457 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=320457&action=review

>>>> Source/JavaScriptCore/jsc.cpp:3846
>>>> +    if (dumpOptionsOption && strcmp(dumpOptionsOption, "0")) {
>>> 
>>> OptionsOptionOptionsOptionsOptionOptions
>>> 
>>> Code seems to usually do:
>>> !strcasecmp(string, "none") || !strcasecmp(string, "no") || !strcasecmp(string, "false") || !strcmp(string, "0")
>>> 
>>> ?
>> 
>> let's use strncmp
>> Also, Options seems to allow for "false" and "False"
> 
> I think you should do this after Options::initialize so you can just write code like:
> if (Options::dumpOptions()) ....

I'll change to checking Options::dumpOptions() in CommandLine instead.  BTW, JSC_dumpOptions can only be set to an integer 0 to 3.  "false", "False", "none", etc are all invalid options.
Comment 6 Mark Lam 2017-09-11 13:53:23 PDT
Created attachment 320469 [details]
proposed patch.
Comment 7 Mark Lam 2017-09-11 13:55:33 PDT
Comment on attachment 320469 [details]
proposed patch.

Thanks for the review.
Comment 8 WebKit Commit Bot 2017-09-11 14:24:51 PDT
Comment on attachment 320469 [details]
proposed patch.

Clearing flags on attachment: 320469

Committed r221878: <http://trac.webkit.org/changeset/221878>
Comment 9 WebKit Commit Bot 2017-09-11 14:24:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2017-09-27 12:33:27 PDT
<rdar://problem/34693481>