History

Merge tag 'perf-core-for-mingo-5.8-20200420' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core fixes and improvements from Arnaldo Carvalho de Melo: kernel + tools/perf: Alexey Budankov: - Introduce CAP_PERFMON to kernel and user space. callchains: Adrian Hunter: - Allow using Intel PT to synthesize callchains for regular events. Kan Liang: - Stitch LBR records from multiple samples to get deeper backtraces, there are caveats, see the csets for details. perf script: Andreas Gerstmayr: - Add flamegraph.py script BPF: Jiri Olsa: - Synthesize bpf_trampoline/dispatcher ksymbol events. perf stat: Arnaldo Carvalho de Melo: - Honour --timeout for forked workloads. Stephane Eranian: - Force error in fallback on :k events, to avoid counting nothing when the user asks for kernel events but is not allowed to. perf bench: Ian Rogers: - Add event synthesis benchmark. tools api fs: Stephane Eranian: - Make xxx__mountpoint() more scalable libtraceevent: He Zhe: - Handle return value of asprintf.

Ingo Molnar committed 6 years ago

Commit 87cfeb12 parents 18bf340 12e89e685 files · +1851 −513Browse files

Showing the changes to include/linux (2 of 85 files). Show all

Unified · Split

2 files
  1. include/linux/capability.h +4 −0
  2. include/linux/perf_event.h +3 −3
include/linux/capability.h+4−0
@@ -251,6 +251,10 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct · 250 unmodified lines
251extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);251extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap);
252extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);252extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
253extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);253extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns);
254static inline bool perfmon_capable(void)
255{
256 return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN);
257}
254 258
255/* audit system wants to get cap info from files as well */259/* audit system wants to get cap info from files as well */
256extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);260extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
include/linux/perf_event.h+3−3
@@ -1305,7 +1305,7 @@ static inline int perf_is_paranoid(void) · 1304 unmodified lines
1305 1305
1306static inline int perf_allow_kernel(struct perf_event_attr *attr)1306static inline int perf_allow_kernel(struct perf_event_attr *attr)
1307{1307{
1308 if (sysctl_perf_event_paranoid > 1 && !capable(CAP_SYS_ADMIN))1308 if (sysctl_perf_event_paranoid > 1 && !perfmon_capable())
1309 return -EACCES;1309 return -EACCES;
1310 1310
1311 return security_perf_event_open(attr, PERF_SECURITY_KERNEL);1311 return security_perf_event_open(attr, PERF_SECURITY_KERNEL);
@@ -1313,7 +1313,7 @@ static inline int perf_allow_kernel(struct perf_event_attr *attr) · 1 unmodified line
1313 1313
1314static inline int perf_allow_cpu(struct perf_event_attr *attr)1314static inline int perf_allow_cpu(struct perf_event_attr *attr)
1315{1315{
1316 if (sysctl_perf_event_paranoid > 0 && !capable(CAP_SYS_ADMIN))1316 if (sysctl_perf_event_paranoid > 0 && !perfmon_capable())
1317 return -EACCES;1317 return -EACCES;
1318 1318
1319 return security_perf_event_open(attr, PERF_SECURITY_CPU);1319 return security_perf_event_open(attr, PERF_SECURITY_CPU);
@@ -1321,7 +1321,7 @@ static inline int perf_allow_cpu(struct perf_event_attr *attr) · 1 unmodified line
1321 1321
1322static inline int perf_allow_tracepoint(struct perf_event_attr *attr)1322static inline int perf_allow_tracepoint(struct perf_event_attr *attr)
1323{1323{
1324 if (sysctl_perf_event_paranoid > -1 && !capable(CAP_SYS_ADMIN))1324 if (sysctl_perf_event_paranoid > -1 && !perfmon_capable())
1325 return -EPERM;1325 return -EPERM;
1326 1326
1327 return security_perf_event_open(attr, PERF_SECURITY_TRACEPOINT);1327 return security_perf_event_open(attr, PERF_SECURITY_TRACEPOINT);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t