Skip to content

Commit 82ab69b

Browse files
Documentation updates from Promptless
1 parent be248f5 commit 82ab69b

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

pages/runtime/cli.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ You can also pass environment variables:
5959
wasmer run my_wasi_program.wasm --env MYVAR=MYVALUE -- arg1 arg2 arg3
6060
```
6161

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+
6274

6375
## Help
6476

@@ -135,6 +147,14 @@ Options:
135147
136148
Available for cranelift, LLVM and singlepass.
137149
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+
138158
--llvm-debug-dir <LLVM_DEBUG_DIR>
139159
LLVM debug directory, where IR and object files will be written to.
140160
@@ -277,4 +297,4 @@ Options:
277297
278298
-h, --help
279299
Print help (see a summary with '-h')
280-
```
300+
```

pages/runtime/features.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Each of this backends support different features, and have different support for
3131
### Wasmer features
3232
- **Caching**: compiled WebAssembly modules can be reused so subsequent runs of a Wasm file will have very little start up time;
3333
- **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;
3435

3536
## Support of features by backend
3637

@@ -58,6 +59,7 @@ Wasmer features:
5859
| -------- | ---------- | --------- | ---- | -- | ----- | -------------- | ------- |
5960
| Caching ||||||||
6061
| Metering ||||||||
62+
| Profiling||||||||
6163

6264

6365
## Backend support by Operating System
@@ -82,4 +84,4 @@ Wasmer features:
8284
| V8 |||||
8385
| Wasmi |||||
8486
| JavascriptCore |||||
85-
| Browser |||||
87+
| Browser |||||

0 commit comments

Comments
 (0)