mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
Update CPU profiling using perf
@@ -15,14 +15,14 @@ sudo dnf install perf flamegraph
|
|||||||
|
|
||||||
Replace calls to `inferno` with `flamegraph.pl` if necessary.
|
Replace calls to `inferno` with `flamegraph.pl` if necessary.
|
||||||
|
|
||||||
1. *Optional* Enable profiling without `root` access:
|
2. *Optional* Enable profiling without `root` access:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
|
echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
|
||||||
echo 0 | sudo tee /proc/sys/kernel/nmi_watchdog
|
echo 0 | sudo tee /proc/sys/kernel/nmi_watchdog
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Ensure you have compiled `named` with debug symbols. Optionally, set up a prefix
|
3. Ensure you have compiled `named` with debug symbols. Optionally, set up a prefix
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd ~/Path/to/bind9/checkout
|
cd ~/Path/to/bind9/checkout
|
||||||
@@ -30,13 +30,13 @@ cd ~/Path/to/bind9/checkout
|
|||||||
make clean && make
|
make clean && make
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install `named`. Normally `libtool` runs `named` through a wrapper shell script that can make perf results more difficult to read.
|
4. Install `named`. Normally `libtool` runs `named` through a wrapper shell script that can make perf results more difficult to read.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make install
|
make install
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Run `named` under `perf`.
|
5. Run `named` under `perf`.
|
||||||
```sh
|
```sh
|
||||||
perf record --compression-level=1 --user-callchains -g --call-graph=dwarf,65528 -e cycles:ppp --output=$OUTPUT_FILE -- $YOUR_NAMED_CMDLINE_GOES_HERE
|
perf record --compression-level=1 --user-callchains -g --call-graph=dwarf,65528 -e cycles:ppp --output=$OUTPUT_FILE -- $YOUR_NAMED_CMDLINE_GOES_HERE
|
||||||
```
|
```
|
||||||
@@ -54,7 +54,7 @@ perf record --compression-level=1 --user-callchains -g --call-graph=dwarf,65528
|
|||||||
|
|
||||||
`--output=$OUTPUT_FILE` Name of the output file. Otherwise it defaults to perf.data.
|
`--output=$OUTPUT_FILE` Name of the output file. Otherwise it defaults to perf.data.
|
||||||
|
|
||||||
4. Generate a flamegraph with `inferno`:
|
6. Generate a flamegraph with `inferno`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
perf script --input=$INPUT_DATA | inferno-collapse-perf | inferno-flamegraph --width=1920 > $OUTPUT_SVG
|
perf script --input=$INPUT_DATA | inferno-collapse-perf | inferno-flamegraph --width=1920 > $OUTPUT_SVG
|
||||||
|
Reference in New Issue
Block a user