[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-5f970521d3279d99adcdebf329631e36cb9f0deb@git.kernel.org>
Date: Mon, 12 Mar 2018 23:21:13 -0700
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: torvalds@...ux-foundation.org, mingo@...nel.org, jolsa@...hat.com,
tglx@...utronix.de, peterz@...radead.org, yao.jin@...ux.intel.com,
namhyung@...nel.org, mpe@...erman.id.au,
alexander.shishkin@...ux.intel.com, hbathini@...ux.vnet.ibm.com,
hpa@...or.com, kan.liang@...el.com, dsahern@...il.com,
sukadev@...ux.vnet.ibm.com, fweisbec@...il.com,
chabbi.milind@...il.com, acme@...hat.com, will.deacon@....com,
linux-kernel@...r.kernel.org, onestero@...hat.com,
a.p.zijlstra@...llo.nl, jolsa@...nel.org
Subject: [tip:perf/core] perf/core: Move perf_event_attr::sample_max_stack
into perf_copy_attr()
Commit-ID: 5f970521d3279d99adcdebf329631e36cb9f0deb
Gitweb: https://git.kernel.org/tip/5f970521d3279d99adcdebf329631e36cb9f0deb
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Mon, 12 Mar 2018 14:45:46 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 13 Mar 2018 06:56:08 +0100
perf/core: Move perf_event_attr::sample_max_stack into perf_copy_attr()
Move the sample_max_stack check and setup into perf_copy_attr(),
so we have all perf_event_attr initial setup in one place
and can easily compare attrs in the new ioctl introduced
in following change.
Suggested-by: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Hari Bathini <hbathini@...ux.vnet.ibm.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Kan Liang <kan.liang@...el.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Milind Chabbi <chabbi.milind@...il.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Oleg Nesterov <onestero@...hat.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Will Deacon <will.deacon@....com>
Link: http://lkml.kernel.org/r/20180312134548.31532-7-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/events/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 969f865f9f1c..ee145bdee6ed 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10125,6 +10125,9 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
ret = -EINVAL;
}
+ if (!attr->sample_max_stack)
+ attr->sample_max_stack = sysctl_perf_event_max_stack;
+
if (attr->sample_type & PERF_SAMPLE_REGS_INTR)
ret = perf_reg_validate(attr->sample_regs_intr);
out:
@@ -10338,9 +10341,6 @@ SYSCALL_DEFINE5(perf_event_open,
perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN))
return -EACCES;
- if (!attr.sample_max_stack)
- attr.sample_max_stack = sysctl_perf_event_max_stack;
-
/*
* In cgroup mode, the pid argument is used to pass the fd
* opened to the cgroup directory in cgroupfs. The cpu argument
Powered by blists - more mailing lists