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
bee71b2d
Commit
bee71b2d
authored
Oct 26, 2016
by
Sasha Goldshtein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: Add block comments to u* scripts
parent
1cba422a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
tools/ugc.py
tools/ugc.py
+12
-0
tools/uobjnew.py
tools/uobjnew.py
+9
-0
No files found.
tools/ugc.py
View file @
bee71b2d
...
...
@@ -102,6 +102,9 @@ int trace_%s(struct pt_regs *ctx) {
probes
=
[]
#
# Java
#
if
args
.
language
==
"java"
:
# Oddly, the gc__begin/gc__end probes don't really have any useful
# information, while the mem__pool* ones do. There's also a bunch of
...
...
@@ -128,6 +131,9 @@ if args.language == "java":
begin_save
,
end_save
,
formatter
))
probes
.
append
(
Probe
(
"gc__begin"
,
"gc__end"
,
""
,
""
,
lambda
_
:
"no additional info available"
))
#
# Python
#
elif
args
.
language
==
"python"
:
begin_save
=
"""
int gen = 0;
...
...
@@ -144,12 +150,18 @@ elif args.language == "python":
(
event
.
field1
,
event
.
field2
)
probes
.
append
(
Probe
(
"gc__start"
,
"gc__done"
,
begin_save
,
end_save
,
formatter
))
#
# Ruby
#
elif
args
.
language
==
"ruby"
:
# Ruby GC probes do not have any additional information available.
probes
.
append
(
Probe
(
"gc__mark__begin"
,
"gc__mark__end"
,
""
,
""
,
lambda
_
:
"GC mark stage"
))
probes
.
append
(
Probe
(
"gc__sweep__begin"
,
"gc__sweep__end"
,
""
,
""
,
lambda
_
:
"GC sweep stage"
))
#
# Node
#
elif
args
.
language
==
"node"
:
end_save
=
"""
u32 gc_type = 0;
...
...
tools/uobjnew.py
View file @
bee71b2d
...
...
@@ -60,6 +60,9 @@ BPF_HASH(allocs, struct key_t, struct val_t);
usdt
=
USDT
(
pid
=
args
.
pid
)
#
# Java
#
if
args
.
language
==
"java"
:
program
+=
"""
int alloc_entry(struct pt_regs *ctx) {
...
...
@@ -76,6 +79,9 @@ int alloc_entry(struct pt_regs *ctx) {
}
"""
usdt
.
enable_probe
(
"object__alloc"
,
"alloc_entry"
)
#
# Ruby
#
elif
args
.
language
==
"ruby"
:
create_template
=
"""
int THETHING_alloc_entry(struct pt_regs *ctx) {
...
...
@@ -105,6 +111,9 @@ int object_alloc_entry(struct pt_regs *ctx) {
for
thing
in
[
"string"
,
"hash"
,
"array"
]:
program
+=
create_template
.
replace
(
"THETHING"
,
thing
)
usdt
.
enable_probe
(
"%s__create"
%
thing
,
"%s_alloc_entry"
%
thing
)
#
# C
#
elif
args
.
language
==
"c"
:
program
+=
"""
int alloc_entry(struct pt_regs *ctx, size_t size) {
...
...
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