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
eea18dc8
Commit
eea18dc8
authored
Mar 10, 2017
by
4ast
Committed by
GitHub
Mar 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1044 from goldshtn/ausyscall
syscount: Use ausyscalls if available to get syscall list
parents
3da7b4a3
51803bfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
tools/syscount.py
tools/syscount.py
+16
-0
No files found.
tools/syscount.py
View file @
eea18dc8
...
...
@@ -13,6 +13,7 @@ from bcc import BPF
from
itertools
import
izip_longest
from
time
import
sleep
,
strftime
import
argparse
import
subprocess
import
sys
#
...
...
@@ -343,6 +344,21 @@ syscalls = {
313
:
"finit_module"
,
}
# Try to use ausyscall if it is available, because it can give us an up-to-date
# list of syscalls for various architectures, rather than the x86-64 hardcoded
# list above.
def
parse_syscall
(
line
):
parts
=
line
.
split
()
return
(
int
(
parts
[
0
]),
parts
[
1
].
strip
())
try
:
# Skip the first line, which is a header. The rest of the lines are simply
# SYSCALL_NUM\tSYSCALL_NAME pairs.
out
=
subprocess
.
check_output
(
'ausyscall --dump | tail -n +2'
,
shell
=
True
)
syscalls
=
dict
(
map
(
parse_syscall
,
out
.
strip
().
split
(
'
\
n
'
)))
except
Exception
as
e
:
pass
parser
=
argparse
.
ArgumentParser
(
description
=
"Summarize syscall counts and latencies."
)
parser
.
add_argument
(
"-p"
,
"--pid"
,
type
=
int
,
help
=
"trace only this pid"
)
...
...
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