---
# System prepended metadata

title: 'Benchmarking and Introspection, January 18, 2023'
tags: [' introspection', ' profiling', ' benchmarking', unikraft]

---

---
title: "Benchmarking and Introspection, January 18, 2023"
tags: unikraft, profiling, introspection, benchmarking
datetime: 2023-01-18T10:00:00+02:00
location: Online, Discord (https://bit.ly/UnikraftDiscord), the `#monkey-business` voice channel
teams:
- bench-prof
participants:
- Marc
- Marco
- Alex
- Gabi
- Adina
---

## :dart: Agenda

- Status update
- Next steps

## :closed_book: Discussions

### Hooking

GM: Right now I made a simple hook that overwrite the first instrusction from a function with a `jmp` instruction

MR: You need to store what you replace
MR: Check if the function is long enough

MR: There might be some problems regarding multithreading
MR: I think we should keep the `jmp` instruction always there

MS: Check this document: https://docs.kernel.org/trace/kprobes.html#how-does-a-kprobe-work



### VMI Support

AV: I made this document: https://docs.google.com/document/d/17ao1xYSfdBfjlmnlfwdBgC-WpHaXQbHeiG5jueezAf8/edit?usp=sharing
AV: Different implementation for kvmi
AV: LibVMI uses another wrapper Libkvmi for handshake between KVMi and QEMU

MR: Are all functions in the libVMI accesible? What requirements are in the guest?

AV: I tried to create the setup in order to see what works and what doesn't.
AV: The kernel version is too old(5.3).

MR: All the code should work also with a new version of kernel version


### GCov

AP: I tested how to compile with CLang and I think I didn't use the flags in a correct mode
AP: I think the next step is to compile Unikraft with Clang

MR: If all the counters information is in the data section this is good

MS: We can use the gdb stack traces to extract the coverage data

AP: Some defines are used to correlate the function with the address of counters 

MS: You can use a tool from llvm to extract data from a dump file with all counters

## :wrench: TODOs and Decisions

AP: Compile with Clang

AV: Update kernel version and build it to see how this works

GM: Continue working with PoC


Next meeting: Wednesday, February 01, 2023, 10am CET.