... | @@ -281,8 +281,8 @@ the `perf` utility to gather and annotate such data, for example: |
... | @@ -281,8 +281,8 @@ the `perf` utility to gather and annotate such data, for example: |
|
```wiki
|
|
```wiki
|
|
$ perf record ./fib
|
|
$ perf record ./fib
|
|
1134903170
|
|
1134903170
|
|
[ perf record: Woken up 9 times to write data ]
|
|
[perf record: Woken up 9 times to write data ]
|
|
[ perf record: Captured and wrote 2.027 MB perf.data (~88582 samples) ]
|
|
[perf record: Captured and wrote 2.027 MB perf.data (~88582 samples) ]
|
|
$ perf annotate
|
|
$ perf annotate
|
|
```
|
|
```
|
|
|
|
|
... | @@ -329,7 +329,7 @@ Process 1901610 stopped |
... | @@ -329,7 +329,7 @@ Process 1901610 stopped |
|
-> 3 fib 1 = 1
|
|
-> 3 fib 1 = 1
|
|
4 fib n = fib (n-1) + fib (n-2)
|
|
4 fib n = fib (n-1) + fib (n-2)
|
|
5 main :: IO ()
|
|
5 main :: IO ()
|
|
6 main = print $ sum [ fib i | i <- [3..20]]
|
|
6 main = print $ sum [fib i | i <- [3..20]]
|
|
(lldb) image lookup -a 0x00000000004056f7 -v
|
|
(lldb) image lookup -a 0x00000000004056f7 -v
|
|
Address: fib[0x00000000004056f7] (fib..text + 10967)
|
|
Address: fib[0x00000000004056f7] (fib..text + 10967)
|
|
Summary: fib`rnf_info + 207 [inlined] c2rw_entry
|
|
Summary: fib`rnf_info + 207 [inlined] c2rw_entry
|
... | @@ -447,7 +447,7 @@ Performance problems: |
... | @@ -447,7 +447,7 @@ Performance problems: |
|
|
|
|
|
Currently we use `libdw` (part of `elf-utils`) for stack unwinding and DWARF reading. While `libdw` has the advantage of being comprehensive () and widely used (used by `perf`, among others), it only targets ELF platforms. There are a few alternatives that were considered,
|
|
Currently we use `libdw` (part of `elf-utils`) for stack unwinding and DWARF reading. While `libdw` has the advantage of being comprehensive () and widely used (used by `perf`, among others), it only targets ELF platforms. There are a few alternatives that were considered,
|
|
|
|
|
|
- `libdwarf` ([ https://www.prevanders.net/dwarf.html](https://www.prevanders.net/dwarf.html)): not widely available; questionable upstream maintenance practices
|
|
- `libdwarf` ([https://www.prevanders.net/dwarf.html](https://www.prevanders.net/dwarf.html)): not widely available; questionable upstream maintenance practices
|
|
- `libdw` ([ https://sourceware.org/elfutils/](https://sourceware.org/elfutils/)): widely available and used, offering both unwinding and ELF/DWARF parsing, reasonably active upstream, only supports ELF, poor documentation
|
|
- `libdw` ([https://sourceware.org/elfutils/](https://sourceware.org/elfutils/)): widely available and used, offering both unwinding and ELF/DWARF parsing, reasonably active upstream, only supports ELF, poor documentation
|
|
- `libbacktrace` ([ https://github.com/gcc-mirror/gcc/tree/master/libbacktrace](https://github.com/gcc-mirror/gcc/tree/master/libbacktrace)): Supports ELF and XCOFF, not widely available
|
|
- `libbacktrace` ([https://github.com/gcc-mirror/gcc/tree/master/libbacktrace](https://github.com/gcc-mirror/gcc/tree/master/libbacktrace)): Supports ELF and XCOFF, not widely available
|
|
- `libunwind` ([ http://www.nongnu.org/libunwind/](http://www.nongnu.org/libunwind/)): well documented, also no MachO support |
|
- `libunwind` ([http://www.nongnu.org/libunwind/](http://www.nongnu.org/libunwind/)): well documented, also no MachO support |