Best way to trace every executed instruction?


I would like to capture a complete execution trace of the process being debugged, i.e. save the PC of every executed instruction (preferably, in the least performance-intensive way possible), but I am not sure where to start.

Using an external profiling tool or instrumentation (e.g. by injecting instructions in LLVM IR) is not an option.

Thank you very much, in advance! :slightly_smiling_face:

― Vangelis