Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
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
bcc
Commits
9733011a
Commit
9733011a
authored
May 18, 2018
by
yonghong-song
Committed by
GitHub
May 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1762 from javierhonduco/usdt-inexistent-path
usdt: fail when binary doesn't exist. Fixes #1749
parents
19b7f74f
dcb9b9ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
src/cc/usdt/usdt.cc
src/cc/usdt/usdt.cc
+12
-2
No files found.
src/cc/usdt/usdt.cc
View file @
9733011a
...
...
@@ -19,6 +19,7 @@
#include <unordered_set>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
...
...
@@ -393,10 +394,19 @@ extern "C" {
void
*
bcc_usdt_new_frompid
(
int
pid
,
const
char
*
path
)
{
USDT
::
Context
*
ctx
;
if
(
!
path
)
if
(
!
path
)
{
ctx
=
new
USDT
::
Context
(
pid
);
else
}
else
{
struct
stat
buffer
;
if
(
strlen
(
path
)
>=
1
&&
path
[
0
]
!=
'/'
)
{
fprintf
(
stderr
,
"HINT: Binary path should be absolute.
\n\n
"
);
return
nullptr
;
}
else
if
(
stat
(
path
,
&
buffer
)
==
-
1
)
{
fprintf
(
stderr
,
"HINT: Specified binary doesn't exist.
\n\n
"
);
return
nullptr
;
}
ctx
=
new
USDT
::
Context
(
pid
,
path
);
}
if
(
!
ctx
->
loaded
())
{
delete
ctx
;
return
nullptr
;
...
...
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