summaryrefslogtreecommitdiff
path: root/src/tools/wasm-split/split-options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm-split/split-options.cpp')
-rw-r--r--src/tools/wasm-split/split-options.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/wasm-split/split-options.cpp b/src/tools/wasm-split/split-options.cpp
index b5929aad7..b8ccde83e 100644
--- a/src/tools/wasm-split/split-options.cpp
+++ b/src/tools/wasm-split/split-options.cpp
@@ -67,6 +67,9 @@ std::ostream& operator<<(std::ostream& o, WasmSplitOptions::Mode& mode) {
case WasmSplitOptions::Mode::MergeProfiles:
o << "merge-profiles";
break;
+ case WasmSplitOptions::Mode::PrintProfile:
+ o << "print-profile";
+ break;
}
return o;
}
@@ -105,6 +108,16 @@ WasmSplitOptions::WasmSplitOptions()
[&](Options* o, const std::string& argument) {
mode = Mode::MergeProfiles;
})
+ .add("--print-profile",
+ "",
+ "Print profile contents in a human-readable format.",
+ WasmSplitOption,
+ {Mode::PrintProfile},
+ Options::Arguments::One,
+ [&](Options* o, const std::string& argument) {
+ mode = Mode::PrintProfile;
+ profileFile = argument;
+ })
.add(
"--profile",
"",
@@ -278,6 +291,12 @@ WasmSplitOptions::WasmSplitOptions()
{Mode::Instrument, Mode::MergeProfiles},
Options::Arguments::One,
[&](Options* o, const std::string& argument) { output = argument; })
+ .add("--unescape",
+ "-u",
+ "Un-escape function names (in print-profile output)",
+ WasmSplitOption,
+ Options::Arguments::Zero,
+ [&](Options* o, const std::string& argument) { unescape = true; })
.add("--verbose",
"-v",
"Verbose output mode. Prints the functions that will be kept "
@@ -362,6 +381,11 @@ bool WasmSplitOptions::validate() {
case Mode::MergeProfiles:
// Any number >= 1 allowed.
break;
+ case Mode::PrintProfile:
+ if (inputFiles.size() != 1) {
+ fail("Must have exactly one profile path.");
+ }
+ break;
}
// Validate that all used options are allowed in the current mode.