Title: [275534] trunk/Tools
Revision
275534
Author
[email protected]
Date
2021-04-06 11:02:25 -0700 (Tue, 06 Apr 2021)

Log Message

set-webkit-configuration should print current settings
<https://webkit.org/b/224190>

Reviewed by Mark Lam.

* Scripts/set-webkit-configuration:
- Reorder switches to put sanitizers together.
- Declare subroutines.
- Call printCurrentSettings() or printUsage() as needed.
(printCurrentSettings): Add.
(printUsage): Add.
* Scripts/webkitdirs.pm:
- Reorder switch variables to match other code.
(coverageIsEnabled): Add for set-webkit-configuration.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (275533 => 275534)


--- trunk/Tools/ChangeLog	2021-04-06 18:00:33 UTC (rev 275533)
+++ trunk/Tools/ChangeLog	2021-04-06 18:02:25 UTC (rev 275534)
@@ -1,3 +1,20 @@
+2021-04-06  David Kilzer  <[email protected]>
+
+        set-webkit-configuration should print current settings
+        <https://webkit.org/b/224190>
+
+        Reviewed by Mark Lam.
+
+        * Scripts/set-webkit-configuration:
+        - Reorder switches to put sanitizers together.
+        - Declare subroutines.
+        - Call printCurrentSettings() or printUsage() as needed.
+        (printCurrentSettings): Add.
+        (printUsage): Add.
+        * Scripts/webkitdirs.pm:
+        - Reorder switch variables to match other code.
+        (coverageIsEnabled): Add for set-webkit-configuration.
+
 2021-04-06  Philippe Normand  <[email protected]>
 
         [WPE] Enable Cog's GTK4 backend

Modified: trunk/Tools/Scripts/set-webkit-configuration (275533 => 275534)


--- trunk/Tools/Scripts/set-webkit-configuration	2021-04-06 18:00:33 UTC (rev 275533)
+++ trunk/Tools/Scripts/set-webkit-configuration	2021-04-06 18:02:25 UTC (rev 275534)
@@ -39,9 +39,9 @@
   --32-bit                           Set the default architecture to 32-bit
   --64-bit                           Set the default architecture to 64-bit
   --[no-]asan                        Enable or disable clang address sanitizer
-  --[no-]coverage                    Enable or disable LLVM Source-based Code Coverage
   --[no-]tsan                        Enable or disable clang thread sanitizer
   --[no-]ubsan                       Enable or disable clang undefined behavior sanitizer
+  --[no-]coverage                    Enable or disable LLVM Source-based Code Coverage
   --force-optimization-level=<level> Optimization level: O3, O2, O1, O0, Os, Ofast, Og, or none
   --lto-mode=<mode>                  Set LTO mode: full, thin, or none
   --debug                            Set the default configuration to debug
@@ -49,16 +49,20 @@
   --reset                            Reset configurations
 EOF
 
+sub printCurrentSettings();
+sub printUsage();
+sub updateOrDeleteConfigurationFile($$);
+
 my $configuration = passedConfiguration();
 my $architecture = passedArchitecture();
 my $enableASAN = checkForArgumentAndRemoveFromARGV("--asan");
 my $disableASAN = checkForArgumentAndRemoveFromARGV("--no-asan");
-my $enableCoverage = checkForArgumentAndRemoveFromARGV("--coverage");
-my $disableCoverage = checkForArgumentAndRemoveFromARGV("--no-coverage");
 my $enableTSAN = checkForArgumentAndRemoveFromARGV("--tsan");
 my $disableTSAN = checkForArgumentAndRemoveFromARGV("--no-tsan");
 my $enableUBSAN = checkForArgumentAndRemoveFromARGV("--ubsan");
 my $disableUBSAN = checkForArgumentAndRemoveFromARGV("--no-ubsan");
+my $enableCoverage = checkForArgumentAndRemoveFromARGV("--coverage");
+my $disableCoverage = checkForArgumentAndRemoveFromARGV("--no-coverage");
 my $ltoMode;
 if (!checkForArgumentAndRemoveFromARGVGettingValue("--lto-mode", \$ltoMode)) {
     $ltoMode="";
@@ -87,6 +91,7 @@
     for my $fileName (qw(Architecture ASan Configuration Coverage ForceOptimizationLevel LTO TSan UBSan)) {
         unlink File::Spec->catfile($baseProductDir, $fileName);
     }
+    printCurrentSettings();
     exit 0;
 }
 
@@ -96,18 +101,18 @@
     || ($enableTSAN && $disableTSAN)
     || ($enableUBSAN && $disableUBSAN)
     ) {
-    print STDERR $usage;
+    printUsage();
     exit 1;
 }
 
 if ($enableASAN && $enableTSAN) {
     print STDERR "ERROR: Address Sanitizer and Thread Sanitzer can't be enabled together.\n";
-    print STDERR $usage;
+    printUsage();
     exit 1;
 }
 
 if ($ltoMode && $ltoMode ne "full" && $ltoMode ne "thin" && $ltoMode ne "none") {
-    print STDERR $usage;
+    printUsage();
     exit 1;
 }
 
@@ -120,7 +125,7 @@
     && $forceOptimizationLevel ne "Os"
     && $forceOptimizationLevel ne "Ofast"
     && $forceOptimizationLevel ne "Og") {
-    print STDERR $usage;
+    printUsage();
     exit 1;
 }
 
@@ -171,3 +176,28 @@
     print LTO "$ltoMode";
     close LTO;
 }
+
+printCurrentSettings();
+
+exit 0;
+
+sub printCurrentSettings()
+{
+    my $result = "Current settings:";
+    $result .= " Configuration:" . configuration();
+    $result .= " Arch:" . architecture() if architecture();
+    $result .= " ASan" if asanIsEnabled();
+    $result .= " TSan" if tsanIsEnabled();
+    $result .= " UBSan" if ubsanIsEnabled();
+    $result .= " Coverage" if coverageIsEnabled();
+    $result .= " LTOMode:" . ltoMode() if ltoMode();
+    $result .= " ForceOptimizationLevel:O" . forceOptimizationLevel() if forceOptimizationLevel();
+
+    print STDERR $result, "\n";
+}
+
+sub printUsage()
+{
+    print STDERR $usage, "\n";
+    printCurrentSettings();
+}

Modified: trunk/Tools/Scripts/webkitdirs.pm (275533 => 275534)


--- trunk/Tools/Scripts/webkitdirs.pm	2021-04-06 18:00:33 UTC (rev 275533)
+++ trunk/Tools/Scripts/webkitdirs.pm	2021-04-06 18:02:25 UTC (rev 275534)
@@ -132,8 +132,8 @@
 my $asanIsEnabled;
 my $tsanIsEnabled;
 my $ubsanIsEnabled;
+my $coverageIsEnabled;
 my $forceOptimizationLevel;
-my $coverageIsEnabled;
 my $ltoMode;
 my $numberOfCPUs;
 my $maxCPULoad;
@@ -935,6 +935,12 @@
     return $ubsanIsEnabled;
 }
 
+sub coverageIsEnabled()
+{
+    determineCoverageIsEnabled();
+    return $coverageIsEnabled;
+}
+
 sub forceOptimizationLevel()
 {
     determineForceOptimizationLevel();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to