From 5078d4daffb39edb91785e5fd6d28c5ff92478e4 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 30 Jul 2024 14:29:28 -0700 Subject: Add a customizable title to Metrics reporting (#6792) Before the PR: $ bin/wasm-opt test/hello_world.wat --metrics total [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 0 [memories] : 1 [memory-data] : 0 [tables] : 0 [tags] : 0 [total] : 3 [vars] : 0 Binary : 1 LocalGet : 2 After the PR: $ bin/wasm-opt test/hello_world.wat --metrics Metrics total [exports] : 1 [funcs] : 1 ... Note the "Metrics" addition at the top. And the title can be customized: $ bin/wasm-opt test/hello_world.wat --metrics=text Metrics: text total [exports] : 1 [funcs] : 1 The custom title can be helpful when multiple invocations of metrics are used at once, e.g. --metrics=before -O3 --metrics=after. --- test/lit/help/wasm2js.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/lit/help/wasm2js.test') diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index 45bef7d73..0b87ad0aa 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -214,7 +214,9 @@ ;; CHECK-NEXT: --merge-similar-functions merges similar functions when ;; CHECK-NEXT: benefical ;; CHECK-NEXT: -;; CHECK-NEXT: --metrics reports metrics +;; CHECK-NEXT: --metrics reports metrics (with an +;; CHECK-NEXT: optional title, +;; CHECK-NEXT: --metrics[=TITLE]) ;; CHECK-NEXT: ;; CHECK-NEXT: --minify-imports minifies import names (only ;; CHECK-NEXT: those, and not export names), -- cgit v1.2.3