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
22dc8d45
Commit
22dc8d45
authored
Dec 28, 2018
by
williangaspar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow help to be printed
parent
99dd7733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/main.cpp
src/main.cpp
+13
-2
No files found.
src/main.cpp
View file @
22dc8d45
...
...
@@ -53,14 +53,19 @@ static void enforce_infinite_rlimit() {
"
\"
ulimit -l 8192
\"
to fix the problem"
<<
std
::
endl
;
}
int
main
(
int
argc
,
char
*
argv
[]
)
bool
is_root
(
)
{
if
(
geteuid
()
!=
0
)
{
std
::
cerr
<<
"ERROR: bpftrace currently only supports running as the root user."
<<
std
::
endl
;
exit
(
0
)
;
return
false
;
}
else
return
true
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
err
;
Driver
driver
;
char
*
pid_str
=
NULL
;
...
...
@@ -107,6 +112,9 @@ int main(int argc, char *argv[])
// Listing probes
if
(
listing
)
{
if
(
!
is_root
())
return
1
;
if
(
optind
==
argc
-
1
)
list_probes
(
argv
[
optind
]);
else
if
(
optind
==
argc
)
...
...
@@ -140,6 +148,9 @@ int main(int argc, char *argv[])
err
=
driver
.
parse_str
(
script
);
}
if
(
!
is_root
())
return
1
;
if
(
err
)
return
err
;
...
...
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