提交 616ad3f4 编写于 作者: N Naveen N. Rao 提交者: Michael Ellerman

selftests/powerpc: Bump up rlimit for perf-hwbreak test

The systemwide perf hardware breakpoint test tries to open a perf event
on each cpu. On large systems, we run out of file descriptors and fail
the test. Instead, have the test set the file descriptor limit to an
arbitraty high value.
Reported-by: NRohan Deshpande <rohan_d@linux.vnet.ibm.com>
Signed-off-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/187fed5843cecc1e5066677b6296ee88337d7bef.1669096083.git.naveen.n.rao@linux.vnet.ibm.com
上级 71ae6305
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <sys/resource.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <elf.h> #include <elf.h>
...@@ -140,8 +141,19 @@ static void disable_fds(int *fd, int n) ...@@ -140,8 +141,19 @@ static void disable_fds(int *fd, int n)
static int perf_systemwide_event_open(int *fd, __u32 type, __u64 addr, __u64 len) static int perf_systemwide_event_open(int *fd, __u32 type, __u64 addr, __u64 len)
{ {
struct rlimit rlim;
int i = 0; int i = 0;
if (getrlimit(RLIMIT_NOFILE, &rlim)) {
perror("getrlimit");
return -1;
}
rlim.rlim_cur = 65536;
if (setrlimit(RLIMIT_NOFILE, &rlim)) {
perror("setrlimit");
return -1;
}
/* Assume online processors are 0 to nprocs for simplisity */ /* Assume online processors are 0 to nprocs for simplisity */
for (i = 0; i < nprocs; i++) { for (i = 0; i < nprocs; i++) {
fd[i] = perf_cpu_event_open(i, type, addr, len); fd[i] = perf_cpu_event_open(i, type, addr, len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册