A couple months back I recorded this line on my blog as part of investigating perf:
perf record --branch-filter any,save_type,u true
What is the interface between the perf binary and the linux Kernel when I run this? There is a system call to open a file handle. The man page says this:
int syscall(SYS_perf_event_open, struct perf_event_attr *attr,
pid_t pid, int cpu, int group_fd,
unsigned long flags);
But how does that get called by the perf binary…the answer is trickier than I originally thought.

