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
73b5401f
Commit
73b5401f
authored
Dec 18, 2017
by
Brendan Gregg
Committed by
Sasha Goldshtein
Dec 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add way to debug generated BPF code (#1494)
parent
c8177e9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
tools/tcpretrans.py
tools/tcpretrans.py
+6
-2
No files found.
tools/tcpretrans.py
View file @
73b5401f
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# tcpretrans Trace TCP retransmits and TLPs.
# tcpretrans Trace
or count
TCP retransmits and TLPs.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: tcpretrans [-h] [-l]
# USAGE: tcpretrans [-
c] [-
h] [-l]
#
# This uses dynamic tracing of kernel functions, and will need to be updated
# to match kernel changes.
...
...
@@ -38,6 +38,7 @@ parser.add_argument("-l", "--lossprobe", action="store_true",
parser
.
add_argument
(
"-c"
,
"--count"
,
action
=
"store_true"
,
help
=
"count occurred retransmits per flow"
)
args
=
parser
.
parse_args
()
debug
=
0
# define BPF program
bpf_text
=
"""
...
...
@@ -188,6 +189,9 @@ else:
bpf_text
=
bpf_text
.
replace
(
"IPV4_CORE"
,
"ipv4_events.perf_submit(ctx, &data4, sizeof(data4));"
)
bpf_text
=
bpf_text
.
replace
(
"IPV6_CORE"
,
"ipv6_events.perf_submit(ctx, &data6, sizeof(data6));"
)
if
debug
:
print
(
bpf_text
)
# event data
class
Data_ipv4
(
ct
.
Structure
):
_fields_
=
[
...
...
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