diff --git a/dev/codeserver/java/com/google/gwt/dev/codeserver/CodeServer.java b/dev/codeserver/java/com/google/gwt/dev/codeserver/CodeServer.java index e46b49a532..91db45b209 100644 --- a/dev/codeserver/java/com/google/gwt/dev/codeserver/CodeServer.java +++ b/dev/codeserver/java/com/google/gwt/dev/codeserver/CodeServer.java @@ -24,6 +24,7 @@ import com.google.gwt.dev.javac.UnitCacheSingleton; import com.google.gwt.dev.util.DiskCachingUtil; import com.google.gwt.dev.util.log.PrintWriterTreeLogger; +import com.google.gwt.dev.util.log.perf.GwtStartupEvent; import com.google.gwt.thirdparty.guava.common.collect.ImmutableMap; import java.io.File; @@ -51,6 +52,7 @@ public static void main(String[] args) throws Exception { if (!options.parseArgs(args)) { System.exit(1); } + new GwtStartupEvent(CodeServer.class); main(options); } diff --git a/dev/core/src/com/google/gwt/dev/About.java b/dev/core/src/com/google/gwt/dev/About.java index 6b70efd04d..ce9f4ca7f1 100644 --- a/dev/core/src/com/google/gwt/dev/About.java +++ b/dev/core/src/com/google/gwt/dev/About.java @@ -24,7 +24,7 @@ */ public class About { /** - * Tag used for text replacement of the SVN version (split up to avoid + * Tag used for text replacement of the Git version (split up to avoid * replacing it here). */ private static final String GWT_GITREV_TAG = "@GWT_" + "GITREV@"; @@ -35,7 +35,7 @@ public class About { */ private static final String GWT_VERSION_TAG = "@GWT_" + "VERSION@"; - private static final String gwtName = "Google Web Toolkit"; + private static final String gwtName = "GWT Web Toolkit"; private static final String gwtGitRev; private static final GwtVersion gwtVersion; diff --git a/dev/core/src/com/google/gwt/dev/CompilePermsServer.java b/dev/core/src/com/google/gwt/dev/CompilePermsServer.java index fe7889fdb0..bfcd54a711 100644 --- a/dev/core/src/com/google/gwt/dev/CompilePermsServer.java +++ b/dev/core/src/com/google/gwt/dev/CompilePermsServer.java @@ -26,6 +26,7 @@ import com.google.gwt.dev.util.arg.ArgHandlerLogLevel; import com.google.gwt.dev.util.arg.OptionLogLevel; import com.google.gwt.dev.util.log.PrintWriterTreeLogger; +import com.google.gwt.dev.util.log.perf.GwtStartupEvent; import com.google.gwt.util.tools.ArgHandlerString; import java.io.File; @@ -234,6 +235,7 @@ public static void main(String[] args) { int exitCode = -1; final CompileServerOptions options = new CompileServerOptionsImpl(); if (new ArgProcessor(options).processArgs(args)) { + new GwtStartupEvent(CompilePermsServer.class); PrintWriterTreeLogger logger = new PrintWriterTreeLogger(); logger.setMaxDetail(options.getLogLevel()); if (run(options, logger)) { diff --git a/dev/core/src/com/google/gwt/dev/Compiler.java b/dev/core/src/com/google/gwt/dev/Compiler.java index d8fe2da887..4b1c9300fc 100644 --- a/dev/core/src/com/google/gwt/dev/Compiler.java +++ b/dev/core/src/com/google/gwt/dev/Compiler.java @@ -35,6 +35,7 @@ import com.google.gwt.dev.util.arg.ArgHandlerWarDir; import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional; import com.google.gwt.dev.util.arg.OptionOptimize; +import com.google.gwt.dev.util.log.perf.GwtStartupEvent; import com.google.gwt.dev.util.log.perf.SimpleEvent; import com.google.gwt.thirdparty.guava.common.collect.Sets; import com.google.gwt.thirdparty.guava.common.io.MoreFiles; @@ -101,6 +102,7 @@ public static void main(String[] args) { */ final CompilerOptions options = new CompilerOptionsImpl(); if (new ArgProcessor(options).processArgs(args)) { + new GwtStartupEvent(Compiler.class); CompileTask task = new CompileTask() { @Override public boolean run(TreeLogger logger) throws UnableToCompleteException { diff --git a/dev/core/src/com/google/gwt/dev/DevMode.java b/dev/core/src/com/google/gwt/dev/DevMode.java index db802d36d6..3134cc41d4 100644 --- a/dev/core/src/com/google/gwt/dev/DevMode.java +++ b/dev/core/src/com/google/gwt/dev/DevMode.java @@ -46,6 +46,7 @@ import com.google.gwt.dev.util.arg.ArgHandlerWarDir; import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional; import com.google.gwt.dev.util.arg.OptionModulePathPrefix; +import com.google.gwt.dev.util.log.perf.GwtStartupEvent; import com.google.gwt.dev.util.log.perf.SimpleEvent; import com.google.gwt.thirdparty.guava.common.io.MoreFiles; import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption; @@ -473,6 +474,7 @@ public static void main(String[] args) { */ DevMode hostedMode = new DevMode(); if (new ArgProcessor(hostedMode.options).processArgs(args)) { + new GwtStartupEvent(DevMode.class); hostedMode.run(); // Exit w/ success code. System.exit(0); diff --git a/dev/core/src/com/google/gwt/dev/util/log/perf/GwtStartupEvent.java b/dev/core/src/com/google/gwt/dev/util/log/perf/GwtStartupEvent.java new file mode 100644 index 0000000000..bbaed7fc5b --- /dev/null +++ b/dev/core/src/com/google/gwt/dev/util/log/perf/GwtStartupEvent.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 GWT Project Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.dev.util.log.perf; + +import com.google.gwt.dev.About; + +import jdk.jfr.Category; +import jdk.jfr.Description; +import jdk.jfr.Event; +import jdk.jfr.Name; +import jdk.jfr.StackTrace; + +/** + * Logs the class that was used to run GWT and the GWT build in use. + */ +@Name("gwt.Startup") +@Description("Basic startup info about the current GWT process") +@Category("GWT") +@StackTrace(false) +public class GwtStartupEvent extends Event { + @Description("GWT compiler version") + final String gwtVersion = About.getGwtVersion(); + + @Description("Git revision of the GWT compiler build") + final String gwtCommit = About.getGwtGitRev(); + + @Description("Class being invoked to start the compiler") + final Class main; + + public GwtStartupEvent(Class main) { + this.main = main; + commit(); + } +} diff --git a/dev/core/test/com/google/gwt/dev/AboutTest.java b/dev/core/test/com/google/gwt/dev/AboutTest.java index 52e33e5a3c..66eb094e19 100644 --- a/dev/core/test/com/google/gwt/dev/AboutTest.java +++ b/dev/core/test/com/google/gwt/dev/AboutTest.java @@ -24,7 +24,7 @@ public class AboutTest extends TestCase { public void testGwtName() { String result = About.getGwtName(); - assertTrue("Google Web Toolkit".equals(result)); + assertTrue("GWT Web Toolkit".equals(result)); } public void testGwtSvnRev() { @@ -32,6 +32,11 @@ public void testGwtSvnRev() { assertFalse(result.length() == 0); } + public void testGwtGitRev() { + String result = About.getGwtGitRev(); + assertFalse(result.length() == 0); + } + public void testGwtVersion() { String result = About.getGwtVersion(); assertFalse(result.length() == 0); diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java index 842c1ad979..bf79cccabc 100644 --- a/user/src/com/google/gwt/junit/JUnitShell.java +++ b/user/src/com/google/gwt/junit/JUnitShell.java @@ -63,6 +63,7 @@ import com.google.gwt.dev.util.arg.ArgHandlerStrict; import com.google.gwt.dev.util.arg.ArgHandlerWarDir; import com.google.gwt.dev.util.arg.ArgHandlerWorkDirOptional; +import com.google.gwt.dev.util.log.perf.GwtStartupEvent; import com.google.gwt.junit.JUnitMessageQueue.ClientStatus; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.junit.client.TimeoutException; @@ -694,6 +695,8 @@ static JUnitShell getUnitTestShell() { if (!argProcessor.processArgs(args)) { throw new JUnitFatalLaunchException("Error processing shell arguments"); } + new GwtStartupEvent(JUnitShell.class); + // Always bind to the wildcard address and substitute the host address in // URLs. Note that connectAddress isn't actually used here, as we // override it from the runsStyle in getModuleUrl, but we set it to match