6 #include <asm/unistd.h>
13 void open_perf_fds(void)
15 struct syscallrecord
* sc
;
18 while (i
< MAX_PERF_FDS
) {
21 sanitise_perf_event_open(0);
22 sc
= &shm
->syscall
[0];
23 fd
= syscall(__NR_perf_event_open
, sc
->a1
, sc
->a2
, sc
->a3
, sc
->a4
, sc
->a5
);
25 shm
->perf_fds
[i
] = fd
;
26 output(2, "fd[%d] = perf\n", shm
->perf_fds
[i
]);
35 int rand_perf_fd(void)
37 return shm
->perf_fds
[rand() % MAX_PERF_FDS
];