]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - tools/perf/perf-sys.h
net: rds: force to destroy connection if t_sock is NULL in rds_tcp_kill_sock().
[mirror_ubuntu-bionic-kernel.git] / tools / perf / perf-sys.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
43599d1f
JO
2#ifndef _PERF_SYS_H
3#define _PERF_SYS_H
4
82baa0eb
JO
5#include <unistd.h>
6#include <sys/types.h>
7#include <sys/syscall.h>
8#include <linux/types.h>
14f0652b 9#include <linux/compiler.h>
82baa0eb 10#include <linux/perf_event.h>
361c564e 11#include <asm/barrier.h>
43599d1f 12
43599d1f 13#ifdef __powerpc__
493c3031 14#define CPUINFO_PROC {"cpu"}
43599d1f
JO
15#endif
16
17#ifdef __s390__
493c3031 18#define CPUINFO_PROC {"vendor_id"}
43599d1f
JO
19#endif
20
21#ifdef __sh__
493c3031 22#define CPUINFO_PROC {"cpu type"}
43599d1f
JO
23#endif
24
25#ifdef __hppa__
493c3031 26#define CPUINFO_PROC {"cpu"}
43599d1f
JO
27#endif
28
29#ifdef __sparc__
493c3031 30#define CPUINFO_PROC {"cpu"}
43599d1f
JO
31#endif
32
33#ifdef __alpha__
493c3031 34#define CPUINFO_PROC {"cpu model"}
43599d1f
JO
35#endif
36
43599d1f 37#ifdef __arm__
493c3031 38#define CPUINFO_PROC {"model name", "Processor"}
43599d1f
JO
39#endif
40
43599d1f 41#ifdef __mips__
493c3031 42#define CPUINFO_PROC {"cpu model"}
43599d1f
JO
43#endif
44
45#ifdef __arc__
493c3031 46#define CPUINFO_PROC {"Processor"}
43599d1f
JO
47#endif
48
49#ifdef __metag__
493c3031 50#define CPUINFO_PROC {"CPU"}
43599d1f
JO
51#endif
52
53#ifdef __xtensa__
493c3031 54#define CPUINFO_PROC {"core ID"}
43599d1f
JO
55#endif
56
9a57eaf1
ACM
57#ifndef CPUINFO_PROC
58#define CPUINFO_PROC { "model name", }
43599d1f
JO
59#endif
60
82baa0eb
JO
61static inline int
62sys_perf_event_open(struct perf_event_attr *attr,
63 pid_t pid, int cpu, int group_fd,
64 unsigned long flags)
65{
66 int fd;
67
68 fd = syscall(__NR_perf_event_open, attr, pid, cpu,
69 group_fd, flags);
70
71#ifdef HAVE_ATTR_TEST
72 if (unlikely(test_attr__enabled))
73 test_attr__open(attr, pid, cpu, fd, group_fd, flags);
74#endif
75 return fd;
76}
77
43599d1f 78#endif /* _PERF_SYS_H */