Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v5.4-rc4 37 lines 827 B view raw
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _PERF_SYS_H 3#define _PERF_SYS_H 4 5#include <unistd.h> 6#include <sys/types.h> 7#include <sys/syscall.h> 8#include <linux/compiler.h> 9 10struct perf_event_attr; 11 12extern bool test_attr__enabled; 13void test_attr__ready(void); 14void test_attr__init(void); 15void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, 16 int fd, int group_fd, unsigned long flags); 17 18#define HAVE_ATTR_TEST 19 20static inline int 21sys_perf_event_open(struct perf_event_attr *attr, 22 pid_t pid, int cpu, int group_fd, 23 unsigned long flags) 24{ 25 int fd; 26 27 fd = syscall(__NR_perf_event_open, attr, pid, cpu, 28 group_fd, flags); 29 30#ifdef HAVE_ATTR_TEST 31 if (unlikely(test_attr__enabled)) 32 test_attr__open(attr, pid, cpu, fd, group_fd, flags); 33#endif 34 return fd; 35} 36 37#endif /* _PERF_SYS_H */