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
e0604644
Commit
e0604644
authored
Feb 09, 2018
by
Teng Qin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Destruct USDTContext correctly in Python
parent
e01c993a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
src/cc/usdt/usdt.cc
src/cc/usdt/usdt.cc
+4
-2
src/python/bcc/usdt.py
src/python/bcc/usdt.py
+3
-0
No files found.
src/cc/usdt/usdt.cc
View file @
e0604644
...
...
@@ -414,8 +414,10 @@ void *bcc_usdt_new_frompath(const char *path) {
}
void
bcc_usdt_close
(
void
*
usdt
)
{
USDT
::
Context
*
ctx
=
static_cast
<
USDT
::
Context
*>
(
usdt
);
delete
ctx
;
if
(
usdt
)
{
USDT
::
Context
*
ctx
=
static_cast
<
USDT
::
Context
*>
(
usdt
);
delete
ctx
;
}
}
int
bcc_usdt_enable_probe
(
void
*
usdt
,
const
char
*
probe_name
,
...
...
src/python/bcc/usdt.py
View file @
e0604644
...
...
@@ -142,6 +142,9 @@ class USDT(object):
raise
USDTException
(
"either a pid or a binary path must be specified"
)
def
__del__
(
self
):
lib
.
bcc_usdt_close
(
self
.
context
)
def
enable_probe
(
self
,
probe
,
fn_name
):
if
lib
.
bcc_usdt_enable_probe
(
self
.
context
,
probe
.
encode
(
'ascii'
),
fn_name
.
encode
(
'ascii'
))
!=
0
:
...
...
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