From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

perf: generate $(out)/osv.kallsyms from osv.syms

One can easily run perf top/record/report against running OSv:

```
perf kvm --guest --guestkallsyms=build/last/osv.kallsyms top -e "cycles:ppp" -p 
$(pgrep qemu-system)

perf kvm --guest --guestkallsyms=build/last/osv.kallsyms record -e "cycles:ppp" 
-p $(pgrep qemu-system) -v
perf kvm --guest --guestkallsyms=build/last/osv.kallsyms report --stdio
```

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -2139,6 +2139,9 @@ $(out)/loader.elf: $(stage1_targets) 
arch/$(arch)/loader.ld $(out)/bootfs.o $(ou
        @# rule because that caused bug #545.
        @readelf --dyn-syms --wide $(out)/loader.elf > $(out)/osv.syms
        @scripts/libosv.py $(out)/osv.syms $(out)/libosv.ld 
`scripts/osv-version.sh` | $(CC) -c -o $(out)/osv.o -x assembler -
+       @echo '0000000000000000 T _text' > $(out)/osv.kallsyms
+       @echo '0000000000000000 T _stext' >> $(out)/osv.kallsyms
+       @grep ': 0000' $(out)/osv.syms | grep -v 'NOTYPE' | awk '{ print $$2 " 
T " $$8 }' | c++filt >> $(out)/osv.kallsyms
        $(call quiet, $(CC) $(out)/osv.o -nostdlib -shared -o $(out)/libosv.so 
-T $(out)/libosv.ld, LIBOSV.SO)
 
 $(out)/zfs_builder.elf: $(stage1_targets) arch/$(arch)/loader.ld 
$(out)/zfs_builder_bootfs.o $(out)/libvdso-content.o $(loader_options_dep) 
$(version_script_file)

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000f0c05e060bf28a7d%40google.com.

Reply via email to