diff --git a/CMakeLists.txt b/CMakeLists.txt index 18f50bc9b..a3c110e93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -557,10 +557,10 @@ if (BUILD_TOOLS) INSTALL ) - # wasm-opcodecnt + # wasm-stats wabt_executable( - NAME wasm-opcodecnt - SOURCES src/tools/wasm-opcodecnt.cc src/binary-reader-opcnt.cc + NAME wasm-stats + SOURCES src/tools/wasm-stats.cc src/binary-reader-stats.cc INSTALL ) diff --git a/README.md b/README.md index 882a1180c..99634b8d8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ WABT (we pronounce it "wabbit") is a suite of tools for WebAssembly, including: - [**wasm-strip**](https://webassembly.github.io/wabt/doc/wasm-strip.1.html): remove sections of a WebAssembly binary file - [**wasm-validate**](https://webassembly.github.io/wabt/doc/wasm-validate.1.html): validate a file in the WebAssembly binary format - [**wast2json**](https://webassembly.github.io/wabt/doc/wast2json.1.html): convert a file in the wasm spec test format to a JSON file and associated wasm binary files - - [**wasm-opcodecnt**](https://webassembly.github.io/wabt/doc/wasm-opcodecnt.1.html): count opcode usage for instructions + - [**wasm-stats**](https://webassembly.github.io/wabt/doc/wasm-stats.1.html): output stats for a module - [**spectest-interp**](https://webassembly.github.io/wabt/doc/spectest-interp.1.html): read a Spectest JSON file, and run its tests in the interpreter These tools are intended for use in (or for development of) toolchains or other diff --git a/docs/doc/spectest-interp.1.html b/docs/doc/spectest-interp.1.html index b02f9e10f..2c0a26542 100644 --- a/docs/doc/spectest-interp.1.html +++ b/docs/doc/spectest-interp.1.html @@ -90,7 +90,7 @@
wasm-opcodecnt
—
-wasm-stats
—
+wasm-opcodecnt |
+ wasm-stats |
[options] file ... |
wasm-opcodecnt
reads a file in the wasm binary format,
- and counts opcode usage for instructions.
+wasm-stats
reads a file in the wasm binary format,
+ and shows stats.
The options are as follows:
$ wasm-opcodecnt test.wasm -o
+$ wasm-stats test.wasm -o
test.dist
diff --git a/docs/doc/wasm-strip.1.html b/docs/doc/wasm-strip.1.html
index 036e54d24..6ca008501 100644
--- a/docs/doc/wasm-strip.1.html
+++ b/docs/doc/wasm-strip.1.html
@@ -60,7 +60,7 @@ SEE
ALSO
wasm-interp(1),
wasm-objdump(1),
- wasm-opcodecnt(1),
+ wasm-stats(1),
wasm-validate(1),
wasm2c(1),
wasm2wat(1),
diff --git a/docs/doc/wasm-validate.1.html b/docs/doc/wasm-validate.1.html
index 909c731a3..ea2081e99 100644
--- a/docs/doc/wasm-validate.1.html
+++ b/docs/doc/wasm-validate.1.html
@@ -84,7 +84,7 @@ SEE
ALSO
wasm-interp(1),
wasm-objdump(1),
- wasm-opcodecnt(1),
+ wasm-stats(1),
wasm-strip(1),
wasm2c(1),
wasm2wat(1),
diff --git a/docs/doc/wasm2c.1.html b/docs/doc/wasm2c.1.html
index 172f7be43..854f21528 100644
--- a/docs/doc/wasm2c.1.html
+++ b/docs/doc/wasm2c.1.html
@@ -86,7 +86,7 @@ SEE
ALSO
wasm-interp(1),
wasm-objdump(1),
- wasm-opcodecnt(1),
+ wasm-stats(1),
wasm-strip(1),
wasm-validate(1),
wasm2wat(1),
diff --git a/docs/doc/wasm2wat.1.html b/docs/doc/wasm2wat.1.html
index 728f2e505..43dc6aca0 100644
--- a/docs/doc/wasm2wat.1.html
+++ b/docs/doc/wasm2wat.1.html
@@ -97,7 +97,7 @@ SEE
ALSO
wasm-interp(1),
wasm-objdump(1),
- wasm-opcodecnt(1),
+ wasm-stats(1),
wasm-strip(1),
wasm-validate(1),
wasm2c(1),
diff --git a/docs/doc/wast2json.1.html b/docs/doc/wast2json.1.html
index fe550fce3..07ddeb752 100644
--- a/docs/doc/wast2json.1.html
+++ b/docs/doc/wast2json.1.html
@@ -97,7 +97,7 @@ SEE
ALSO
wasm-interp(1),
wasm-objdump(1),
- wasm-opcodecnt(1),
+ wasm-stats(1),
wasm-strip(1),
wasm-validate(1),
wasm2c(1),
diff --git a/docs/doc/wat-desugar.1.html b/docs/doc/wat-desugar.1.html
index 9a57fc4ca..e4bb892af 100644
--- a/docs/doc/wat-desugar.1.html
+++ b/docs/doc/wat-desugar.1.html
@@ -95,7 +95,7 @@ SEE
ALSO
wasm-interp(1),
wasm-objdump(1),
- wasm-opcodecnt(1),
+ wasm-stats(1),
wasm-strip(1),
wasm-validate(1),
wasm2c(1),
diff --git a/docs/doc/wat2wasm.1.html b/docs/doc/wat2wasm.1.html
index 425ba3e14..638934ce1 100644
--- a/docs/doc/wat2wasm.1.html
+++ b/docs/doc/wat2wasm.1.html
@@ -102,7 +102,7 @@ SEE
ALSO
wasm-interp(1),
wasm-objdump(1),
- wasm-opcodecnt(1),
+ wasm-stats(1),
wasm-strip(1),
wasm-validate(1),
wasm2c(1),
diff --git a/include/wabt/binary-reader-opcnt.h b/include/wabt/binary-reader-stats.h
similarity index 100%
rename from include/wabt/binary-reader-opcnt.h
rename to include/wabt/binary-reader-stats.h
diff --git a/man/spectest-interp.1 b/man/spectest-interp.1
index 2322435e9..791fdb3ec 100644
--- a/man/spectest-interp.1
+++ b/man/spectest-interp.1
@@ -72,7 +72,7 @@ Parse test.json and run the spec tests
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/man/wasm-decompile.1 b/man/wasm-decompile.1
index 5ddeb6f51..1f65ca9cc 100644
--- a/man/wasm-decompile.1
+++ b/man/wasm-decompile.1
@@ -66,7 +66,7 @@ Parse binary file test.wasm and write text file test.dcmp
.Sh SEE ALSO
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/man/wasm-interp.1 b/man/wasm-interp.1
index e4de437ff..7055a2df8 100644
--- a/man/wasm-interp.1
+++ b/man/wasm-interp.1
@@ -95,7 +95,7 @@ Parse test.wasm and run all its exported functions, setting the value stack size
.Sh SEE ALSO
.Xr wasm-decompile 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
@@ -107,4 +107,4 @@ Parse test.wasm and run all its exported functions, setting the value stack size
.Sh BUGS
If you find a bug, please report it at
.br
-.Lk https://github.com/WebAssembly/wabt/issues .
\ No newline at end of file
+.Lk https://github.com/WebAssembly/wabt/issues .
diff --git a/man/wasm-objdump.1 b/man/wasm-objdump.1
index 448a9a4d9..5994c79ad 100644
--- a/man/wasm-objdump.1
+++ b/man/wasm-objdump.1
@@ -40,7 +40,7 @@ Print section offsets instead of file offsets in code disassembly
.Sh SEE ALSO
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/man/wasm-opcodecnt.1 b/man/wasm-stats.1
similarity index 87%
rename from man/wasm-opcodecnt.1
rename to man/wasm-stats.1
index 5fcc30126..1c4b80119 100644
--- a/man/wasm-opcodecnt.1
+++ b/man/wasm-stats.1
@@ -2,15 +2,15 @@
.Dt WABT 1
.Os
.Sh NAME
-.Nm wasm-opcodecnt
-.Nd count opcode usage for instructions
+.Nm wasm-stats
+.Nd show stats for a module
.Sh SYNOPSIS
-.Nm wasm-opcodecnt
+.Nm wasm-stats
.Op options
.Ar
.Sh DESCRIPTION
.Nm
-Read a file in the wasm binary format, and count opcode usage for instructions.
+Read a file in the wasm binary format, and show stats.
.Pp
The options are as follows:
.Bl -tag -width Ds
@@ -64,9 +64,9 @@ Cutoff for reporting counts less than N
Separator text between element and count when reporting counts
.El
.Sh EXAMPLES
-Parse binary file test.wasm and write pcode dist file test.dist
+Parse binary file test.wasm and write opcode dist file test.dist
.Pp
-.Dl $ wasm-opcodecnt test.wasm -o test.dist
+.Dl $ wasm-stats test.wasm -o test.dist
.Sh SEE ALSO
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
diff --git a/man/wasm-strip.1 b/man/wasm-strip.1
index 943bd3f90..fe51b6b57 100644
--- a/man/wasm-strip.1
+++ b/man/wasm-strip.1
@@ -29,7 +29,7 @@ Remove all custom sections from test.wasm
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/man/wasm-validate.1 b/man/wasm-validate.1
index 6bfacf5f4..489801413 100644
--- a/man/wasm-validate.1
+++ b/man/wasm-validate.1
@@ -69,7 +69,7 @@ Validate binary file test.wasm
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm2c 1 ,
.Xr wasm2wat 1 ,
diff --git a/man/wasm2c.1 b/man/wasm2c.1
index 40d38eef2..0b8900c2a 100644
--- a/man/wasm2c.1
+++ b/man/wasm2c.1
@@ -75,7 +75,7 @@ Parse test.wasm, write test.c and test.h, but ignore the debug names, if any
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2wat 1 ,
diff --git a/man/wasm2wat.1 b/man/wasm2wat.1
index 6a0006684..7840f21a6 100644
--- a/man/wasm2wat.1
+++ b/man/wasm2wat.1
@@ -85,7 +85,7 @@ Parse test.wasm, write test.wat, but ignore the debug names, if any
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/man/wast2json.1 b/man/wast2json.1
index 77f37a5d8..88a1d80a8 100644
--- a/man/wast2json.1
+++ b/man/wast2json.1
@@ -78,7 +78,7 @@ Modules are written to spec-test.0.wasm, spec-test.1.wasm, etc.
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/man/wat-desugar.1 b/man/wat-desugar.1
index 56537e0c5..07e693be4 100644
--- a/man/wat-desugar.1
+++ b/man/wat-desugar.1
@@ -83,7 +83,7 @@ Generate names for indexed variables
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/man/wat2wasm.1 b/man/wat2wasm.1
index f13966530..b9cba0ac7 100644
--- a/man/wat2wasm.1
+++ b/man/wat2wasm.1
@@ -87,7 +87,7 @@ Parse spec-test.wast, and write verbose output to stdout (including the meaning
.Xr wasm-decompile 1 ,
.Xr wasm-interp 1 ,
.Xr wasm-objdump 1 ,
-.Xr wasm-opcodecnt 1 ,
+.Xr wasm-stats 1 ,
.Xr wasm-strip 1 ,
.Xr wasm-validate 1 ,
.Xr wasm2c 1 ,
diff --git a/scripts/help2man.lua b/scripts/help2man.lua
index ed128b0c7..ab23733e7 100644
--- a/scripts/help2man.lua
+++ b/scripts/help2man.lua
@@ -2,7 +2,7 @@
local format_br = '\n.br\n'
local tools = {
- "wasm-decompile", "wasm-interp", "wasm-objdump", "wasm-opcodecnt",
+ "wasm-decompile", "wasm-interp", "wasm-objdump", "wasm-stats",
"wasm-strip", "wasm-validate", "wasm2c", "wasm2wat",
"wast2json", "wat-desugar", "wat2wasm", "spectest-interp"
}
diff --git a/src/binary-reader-opcnt.cc b/src/binary-reader-stats.cc
similarity index 99%
rename from src/binary-reader-opcnt.cc
rename to src/binary-reader-stats.cc
index 3177dbb7e..df0c438fd 100644
--- a/src/binary-reader-opcnt.cc
+++ b/src/binary-reader-stats.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "wabt/binary-reader-opcnt.h"
+#include "wabt/binary-reader-stats.h"
#include
#include
diff --git a/src/tools/wasm-opcodecnt.cc b/src/tools/wasm-stats.cc
similarity index 93%
rename from src/tools/wasm-opcodecnt.cc
rename to src/tools/wasm-stats.cc
index 058d807fd..d8fb1fb43 100644
--- a/src/tools/wasm-opcodecnt.cc
+++ b/src/tools/wasm-stats.cc
@@ -24,7 +24,7 @@
#include