Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bpftrace
Commits
3a9c9d0f
Commit
3a9c9d0f
authored
Feb 05, 2019
by
Brendan Gregg
Committed by
GitHub
Feb 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #391 from sourabhtk37/enforce_rlimit_cleanup#240
Cleanup enforce_infinite_rlimits
parents
a261317b
d76465f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
src/main.cpp
src/main.cpp
+6
-8
No files found.
src/main.cpp
View file @
3a9c9d0f
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include <signal.h>
#include <signal.h>
#include <sys/resource.h>
#include <sys/resource.h>
#include <unistd.h>
#include <unistd.h>
#include <string.h>
#include "bpforc.h"
#include "bpforc.h"
#include "bpftrace.h"
#include "bpftrace.h"
...
@@ -42,16 +43,13 @@ void usage()
...
@@ -42,16 +43,13 @@ void usage()
static
void
enforce_infinite_rlimit
()
{
static
void
enforce_infinite_rlimit
()
{
struct
rlimit
rl
=
{};
struct
rlimit
rl
=
{};
if
(
getrlimit
(
RLIMIT_MEMLOCK
,
&
rl
)
!=
0
)
{
int
err
;
std
::
cerr
<<
"Warning: couldn't set RLIMIT for bpftrace. "
<<
"If your program is not loading, you can try "
<<
"
\"
ulimit -l 8192
\"
to fix the problem"
<<
std
::
endl
;
return
;
}
rl
.
rlim_max
=
RLIM_INFINITY
;
rl
.
rlim_max
=
RLIM_INFINITY
;
rl
.
rlim_cur
=
rl
.
rlim_max
;
rl
.
rlim_cur
=
rl
.
rlim_max
;
if
(
setrlimit
(
RLIMIT_MEMLOCK
,
&
rl
)
!=
0
)
err
=
setrlimit
(
RLIMIT_MEMLOCK
,
&
rl
);
std
::
cerr
<<
"Warning: couldn't set RLIMIT for bpftrace. "
<<
if
(
err
)
std
::
cerr
<<
std
::
strerror
(
err
)
<<
": couldn't set RLIMIT for bpftrace. "
<<
"If your program is not loading, you can try "
<<
"If your program is not loading, you can try "
<<
"
\"
ulimit -l 8192
\"
to fix the problem"
<<
std
::
endl
;
"
\"
ulimit -l 8192
\"
to fix the problem"
<<
std
::
endl
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment