|
1 | 1 | # goroutine trace
|
2 | 2 |
|
3 |
| -TODO: make this work and implement the documentation |
| 3 | +**UNFINISHED YET**: The offset of goid field is hardcoded. It was only tested on the bundled `go-server-http`. It MAY NOT WORK on other go programs. |
| 4 | + |
| 5 | +The bundled fo program was compiled using go 1.17.0. The executable and source could be found at folder `go-server-http`. |
| 6 | + |
| 7 | +This example traces the state switch of goroutines, and prints the corresponding state, goid, pid and tgid. |
| 8 | + |
| 9 | +```console |
| 10 | +root@mnfe-pve:~/bpf-developer-tutorial/src/31-goroutine# ecc goroutine.bpf.c goroutine.h |
| 11 | +INFO [ecc_rs::bpf_compiler] Compiling bpf object... |
| 12 | +INFO [ecc_rs::bpf_compiler] Generating export types... |
| 13 | +INFO [ecc_rs::bpf_compiler] Generating package json.. |
| 14 | +INFO [ecc_rs::bpf_compiler] Packing ebpf object and config into package.json... |
| 15 | +root@mnfe-pve:~/bpf-developer-tutorial/src/31-goroutine# ecli-rs run package.json |
| 16 | +INFO [faerie::elf] strtab: 0x6fb symtab 0x738 relocs 0x780 sh_offset 0x780 |
| 17 | +INFO [bpf_loader_lib::skeleton::preload::section_loader] User didn't specify custom value for variable __eunomia_dummy_goroutine_execute_data_ptr, use the default one in ELF |
| 18 | +TIME STATE GOID PID TGID |
| 19 | +INFO [bpf_loader_lib::skeleton] Running ebpf program... |
| 20 | +21:00:47 DEAD(6) 0 2542844 2542844 |
| 21 | +21:00:47 RUNNABLE(1) 0 2542844 2542844 |
| 22 | +21:00:47 DEAD(6) 0 2542844 2542844 |
| 23 | +21:00:47 RUNNING(2) 1 2542844 2542844 |
| 24 | +21:00:47 DEAD(6) 0 2542844 2542844 |
| 25 | +21:00:47 RUNNABLE(1) 0 2542844 2542844 |
| 26 | +21:00:47 RUNNABLE(1) 1 2542844 2542844 |
| 27 | +21:00:47 RUNNING(2) 2 2542847 2542844 |
| 28 | +21:00:47 WAITING(4) 2 2542847 2542844 |
| 29 | +.... |
| 30 | +``` |
4 | 31 |
|
5 |
| -Modify from https://github.com/deepflowio/deepflow |
6 | 32 |
|
7 | 33 | This example is provided as GPL license
|
0 commit comments