diff options
author | sps-gold <79571312+sps-gold@users.noreply.github.com> | 2022-07-26 03:56:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 12:56:41 -0700 |
commit | 3a8d28f421a9452aff8f7ed2b140e12e2f314322 (patch) | |
tree | 8c67e20249568785d89796a24780c50640091463 /test/lit/help | |
parent | 68e2ed11e86e72cc4e12a1b4026ef19d5149fda9 (diff) | |
download | binaryen-3a8d28f421a9452aff8f7ed2b140e12e2f314322.tar.gz binaryen-3a8d28f421a9452aff8f7ed2b140e12e2f314322.tar.bz2 binaryen-3a8d28f421a9452aff8f7ed2b140e12e2f314322.zip |
[wasm-split] Add --print-profile option (#4771)
There are several reasons why a function may not be trained in deterministically.
So to perform quick validation we need to inspect profile.data (another ways requires split to be performed). However as profile.data is a binary file and is not self sufficient, so we cannot currently use it to perform such validation.
Therefore to allow quick check on whether a particular function has been trained in, we need to dump profile.data in a more readable format.
This PR, allows us to output, the list of functions to be kept (in main wasm) and those split functions (to be moved to deferred.wasm) in a readable format, to console.
Added a new option `--print-profile`
- input path to orig.wasm (its the original wasm file that will be used later during split)
- input path to profile.data that we need to output
optionally pass `--unescape`
to unescape the function names
Usage:
```
binaryen\build>bin\wasm-split.exe test\profile_data\MY.orig.wasm --print-profile=test\profile_data\profile.data > test\profile_data\out.log
```
note: meaning of prefixes
`+` => fn to be kept in main wasm
`-` => fn to be split and moved to deferred wasm
Diffstat (limited to 'test/lit/help')
-rw-r--r-- | test/lit/help/wasm-split.test | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lit/help/wasm-split.test b/test/lit/help/wasm-split.test index 05a7df910..2bc015027 100644 --- a/test/lit/help/wasm-split.test +++ b/test/lit/help/wasm-split.test @@ -22,6 +22,9 @@ ;; CHECK-NEXT: --merge-profiles Merge multiple profiles for the same ;; CHECK-NEXT: module into a single profile. ;; CHECK-NEXT: +;; CHECK-NEXT: --print-profile [print-profile] Print profile contents in +;; CHECK-NEXT: a human-readable format. +;; CHECK-NEXT: ;; CHECK-NEXT: --profile [split] The profile to use to guide ;; CHECK-NEXT: splitting. ;; CHECK-NEXT: @@ -105,6 +108,9 @@ ;; CHECK-NEXT: ;; CHECK-NEXT: --output,-o [instrument, merge-profiles] Output file. ;; CHECK-NEXT: +;; CHECK-NEXT: --unescape,-u Un-escape function names (in +;; CHECK-NEXT: print-profile output) +;; CHECK-NEXT: ;; CHECK-NEXT: --verbose,-v Verbose output mode. Prints the functions ;; CHECK-NEXT: that will be kept and split out when ;; CHECK-NEXT: splitting a module. |