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
3083c85c
Commit
3083c85c
authored
Jan 14, 2016
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #312 from iovisor/ast_dev
fix pep8 lint errors in the rest of the tools
parents
a0aa7f28
bdf0773f
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
668 additions
and
660 deletions
+668
-660
tools/biolatency_example.txt
tools/biolatency_example.txt
+1
-1
tools/funccount
tools/funccount
+47
-46
tools/funclatency
tools/funclatency
+87
-86
tools/hardirqs
tools/hardirqs
+80
-79
tools/hardirqs_example.txt
tools/hardirqs_example.txt
+1
-1
tools/killsnoop
tools/killsnoop
+44
-43
tools/killsnoop_example.txt
tools/killsnoop_example.txt
+1
-1
tools/opensnoop
tools/opensnoop
+51
-48
tools/opensnoop_example.txt
tools/opensnoop_example.txt
+45
-51
tools/pidpersec
tools/pidpersec
+13
-13
tools/softirqs
tools/softirqs
+71
-70
tools/softirqs_example.txt
tools/softirqs_example.txt
+1
-1
tools/syncsnoop
tools/syncsnoop
+8
-7
tools/syncsnoop_example.txt
tools/syncsnoop_example.txt
+1
-1
tools/tcpaccept
tools/tcpaccept
+72
-71
tools/tcpaccept_example.txt
tools/tcpaccept_example.txt
+5
-5
tools/tcpconnect
tools/tcpconnect
+83
-82
tools/tcpconnect_example.txt
tools/tcpconnect_example.txt
+5
-5
tools/vfscount
tools/vfscount
+8
-7
tools/vfscount_example.txt
tools/vfscount_example.txt
+1
-1
tools/vfsstat
tools/vfsstat
+43
-41
No files found.
tools/biolatency_example.txt
View file @
3083c85c
tools/funccount
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# funccount Count kernel function calls.
# For Linux, uses BCC, eBPF. See .c file.
...
...
@@ -96,7 +97,7 @@ while (1):
try
:
sleep
(
int
(
args
.
interval
))
except
KeyboardInterrupt
:
exiting
=
1
exiting
=
1
# as cleanup can take many seconds, trap Ctrl-C:
signal
.
signal
(
signal
.
SIGINT
,
signal_ignore
)
...
...
tools/funclatency
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# funclatency Time kernel funcitons and print latency as a histogram.
# For Linux, uses BCC, eBPF.
...
...
@@ -168,7 +169,7 @@ while (1):
try
:
sleep
(
int
(
args
.
interval
))
except
KeyboardInterrupt
:
exiting
=
1
exiting
=
1
# as cleanup can take many seconds, trap Ctrl-C:
signal
.
signal
(
signal
.
SIGINT
,
signal_ignore
)
...
...
tools/hardirqs
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# hardirqs Summarize hard IRQ (interrupt) event time.
# For Linux, uses BCC, eBPF.
...
...
@@ -136,7 +137,7 @@ while (1):
try
:
sleep
(
int
(
args
.
interval
))
except
KeyboardInterrupt
:
exiting
=
1
exiting
=
1
print
()
if
args
.
timestamp
:
...
...
tools/hardirqs_example.txt
View file @
3083c85c
tools/killsnoop
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# killsnoop Trace signals issued by the kill() syscall.
# For Linux, uses BCC, eBPF. Embedded C.
...
...
tools/killsnoop_example.txt
View file @
3083c85c
tools/opensnoop
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# opensnoop Trace open() syscalls.
# For Linux, uses BCC, eBPF. Embedded C.
...
...
@@ -97,9 +98,11 @@ while 1:
# split return value into FD and errno columns
if
ret
>=
0
:
fd_s
=
ret
;
err
=
0
fd_s
=
ret
err
=
0
else
:
fd_s
=
"-1"
;
err
=
-
ret
fd_s
=
"-1"
err
=
-
ret
# print columns
if
args
.
timestamp
:
...
...
tools/opensnoop_example.txt
View file @
3083c85c
...
...
@@ -79,12 +79,6 @@ PID COMM FD ERR PATH
18384 df -1 2 /usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale/en/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale-langpack/en.utf8/LC_MESSAGES/coreutils.mo
18384 df -1 2 /usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo
18385 run -1 6 /dev/tty
18386 run -1 6 /dev/tty
...
...
tools/pidpersec
View file @
3083c85c
#!/usr/bin/python
#
vim: ts=8 noet sw=8
#
@lint-avoid-python-3-compatibility-imports
#
# pidpersec Count new processes (via fork).
# For Linux, uses BCC, eBPF. See .c file.
...
...
@@ -14,11 +14,11 @@
# 11-Aug-2015 Brendan Gregg Created this.
from
bcc
import
BPF
from
ctypes
import
c_
ushort
,
c_int
,
c_ulonglong
from
ctypes
import
c_
int
from
time
import
sleep
,
strftime
# load BPF program
b
=
BPF
(
src_file
=
"pidpersec.c"
)
b
=
BPF
(
src_file
=
"pidpersec.c"
)
b
.
attach_kprobe
(
event
=
"sched_fork"
,
fn_name
=
"do_count"
)
# stat indexes
...
...
tools/softirqs
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# softirqs Summarize soft IRQ (interrupt) event time.
# For Linux, uses BCC, eBPF.
...
...
@@ -126,7 +127,7 @@ while (1):
try
:
sleep
(
int
(
args
.
interval
))
except
KeyboardInterrupt
:
exiting
=
1
exiting
=
1
print
()
if
args
.
timestamp
:
...
...
tools/softirqs_example.txt
View file @
3083c85c
tools/syncsnoop
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# syncsnoop Trace sync() syscall.
# For Linux, uses BCC, eBPF. Embedded C.
...
...
@@ -15,7 +16,7 @@ from __future__ import print_function
from
bcc
import
BPF
# load BPF program
b
=
BPF
(
text
=
"""
b
=
BPF
(
text
=
"""
void kprobe__sys_sync(void *ctx) {
bpf_trace_printk("sync()
\
\
n");
};
...
...
tools/syncsnoop_example.txt
View file @
3083c85c
tools/tcpaccept
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# tcpaccept Trace TCP accept()s.
# For Linux, uses BCC, eBPF. Embedded C.
...
...
tools/tcpaccept_example.txt
View file @
3083c85c
tools/tcpconnect
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# tcpconnect Trace TCP connect()s.
# For Linux, uses BCC, eBPF. Embedded C.
...
...
tools/tcpconnect_example.txt
View file @
3083c85c
tools/vfscount
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# vfscount Count VFS calls ("vfs_*").
# For Linux, uses BCC, eBPF. See .c file.
...
...
@@ -15,7 +16,7 @@ from bcc import BPF
from
time
import
sleep
# load BPF program
b
=
BPF
(
src_file
=
"vfscount.c"
)
b
=
BPF
(
src_file
=
"vfscount.c"
)
b
.
attach_kprobe
(
event_re
=
"^vfs_.*"
,
fn_name
=
"do_count"
)
# header
...
...
tools/vfscount_example.txt
View file @
3083c85c
tools/vfsstat
View file @
3083c85c
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# vfsstat Count some VFS calls.
# For Linux, uses BCC, eBPF. See .c file.
...
...
@@ -14,7 +15,7 @@
from
__future__
import
print_function
from
bcc
import
BPF
from
ctypes
import
c_
ushort
,
c_int
,
c_ulonglong
from
ctypes
import
c_
int
from
time
import
sleep
,
strftime
from
sys
import
argv
...
...
@@ -36,7 +37,7 @@ if len(argv) > 1:
usage
()
# load BPF program
b
=
BPF
(
src_file
=
"vfsstat.c"
)
b
=
BPF
(
src_file
=
"vfsstat.c"
)
b
.
attach_kprobe
(
event
=
"vfs_read"
,
fn_name
=
"do_read"
)
b
.
attach_kprobe
(
event
=
"vfs_write"
,
fn_name
=
"do_write"
)
b
.
attach_kprobe
(
event
=
"vfs_fsync"
,
fn_name
=
"do_fsync"
)
...
...
@@ -45,11 +46,11 @@ b.attach_kprobe(event="vfs_create", fn_name="do_create")
# stat column labels and indexes
stat_types
=
{
"READ"
:
1
,
"WRITE"
:
2
,
"FSYNC"
:
3
,
"OPEN"
:
4
,
"CREATE"
:
5
"READ"
:
1
,
"WRITE"
:
2
,
"FSYNC"
:
3
,
"OPEN"
:
4
,
"CREATE"
:
5
}
# header
...
...
@@ -69,7 +70,8 @@ while (1):
try
:
sleep
(
interval
)
except
KeyboardInterrupt
:
pass
;
exit
()
pass
exit
()
print
(
"%-8s: "
%
strftime
(
"%H:%M:%S"
),
end
=
""
)
# print each statistic as a column
...
...
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