I am developing an OS (as a hobby) using QEMU and GDB but I'm now facing some performance issues. Therefore, I would like to know which functions should be optimized.
So basically, my needs are mainly to know:
Do you know how can I do that? I would accept a solution using Bochs too.
As far as I can see, there is no web-based documentation available for QEMU profiling, although I would be very surprised if there was no way at all to do profiling. If QEMU is using kvm
virtualization (as opposed to simulation), there might also be some profiling tools available specifically for kvm
.
However, since QEMU provides access to GDB, you can still use that! The poor man's profiler uses GDB's backtrace
periodically to figure out what all your threads are doing, which can be pretty helpful. This will give data about blocked threads as well as unblocked threads, but since you don't seem to know whether your performance problems are due to blocking or not, this should be much more useful than nothing. If you were feeling especially determined, you could use this data to create a more helpful visualization such as Brendan Gregg's flame graphs.
The worst (but usually easiest) technique is always going to be picking some random functions in the code which might be a bottleneck and outputting how long each call takes. Inelegant for sure, but mighty useful when nothing else is available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With