0

Im looking for a way to map cpuid function usage by process (a qemu vm in my case) running on top of Ubuntu.

Eventually I woukd like to know what cpuid functions a qemu instance or a pid is using.

Any ideas ?

Thabks

chegov
  • 13
  • 5
  • Are you wanting to count how many times the [`cpuid`](https://www.felixcloutier.com/x86/cpuid) instruction executes? Or find where in the binary it's run from? Or find what library wrapper function the program is using to run cpuid from C? GCC's `cpuid.h` header has inline asm wrappers for it. – Peter Cordes Jun 26 '22 at 20:06
  • Find out what library wrapper function tge program is using, yes. How can I use cpuid.h for it ? Thanks – chegov Jun 26 '22 at 20:13
  • Programs use `` as described in [How do I call "cpuid" in Linux?](https://stackoverflow.com/q/14266772). The source is https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/cpuid.h - so you can see it's just inline assembly that will inline into the program wherever those functions are used, not separate library involved. – Peter Cordes Jun 26 '22 at 20:17
  • Hmm, I wonder if I have access to the source code (written in c) then I can cross check the cpuid functions ? @PeterCordes are u familiar with a list of all c fubctions that utilize cpu this way ? – chegov Jun 27 '22 at 10:53

0 Answers0