You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/runtime/cli.mdx
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,18 @@ You can also pass environment variables:
59
59
wasmer run my_wasi_program.wasm --env MYVAR=MYVALUE -- arg1 arg2 arg3
60
60
```
61
61
62
+
### Profiling WebAssembly Code
63
+
64
+
You can enable profiling data generation for your WebAssembly code using the `--profiler` option:
65
+
66
+
```bash copy
67
+
wasmer run my_program.wasm --profiler=perfmap
68
+
```
69
+
70
+
This generates profiling information in the [perfmap format](https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt), which can be used with Linux perf tools to analyze the performance of your WebAssembly code. The profiler data is written to `/tmp/perf-{PID}.map`.
71
+
72
+
This option is available for the Cranelift, LLVM, and Singlepass compiler backends.
73
+
62
74
63
75
## Help
64
76
@@ -135,6 +147,14 @@ Options:
135
147
136
148
Available for cranelift, LLVM and singlepass.
137
149
150
+
--profiler <PROFILER>
151
+
Enable a profiler.
152
+
153
+
Available for cranelift, LLVM and singlepass.
154
+
155
+
Possible values:
156
+
- perfmap: Generate profiling data in perfmap format
157
+
138
158
--llvm-debug-dir <LLVM_DEBUG_DIR>
139
159
LLVM debug directory, where IR and object files will be written to.
Copy file name to clipboardExpand all lines: pages/runtime/features.mdx
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ Each of this backends support different features, and have different support for
31
31
### Wasmer features
32
32
-**Caching**: compiled WebAssembly modules can be reused so subsequent runs of a Wasm file will have very little start up time;
33
33
-**Metering**: computation time and other resources can be monitored and limits set to control how the Wasm code runs. This is also known as "gas metering";
34
+
-**Profiling**: generate profiling data for WebAssembly code to analyze performance using tools like Linux perf;
0 commit comments