If I need to get the values of some registers with ptrace for example I need r0 , r1 ,pc registers what way will give me better performance :
int pc= ptrace(PTRACE_PEEKUSER,pid,60,0);
r0 = ptrace(PTRACE_PEEKUSER, pid, 0, NULL);
r1 = ptrace(PTRACE_PEEKUSER, pid, 4, NULL);
Or get all registers with PTRACE_GETREGS and then use only the values I need?
How is that implement? Is PTRACE_GETREGS implement as a loop on PTRACE_PEEKUSER so if I don't need all the registers the best way is to use PTRACE_PEEKUSER as number of registers I need?
Is the performance depend on architecture (x86/Arm)?