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
f5dbbdbb
Commit
f5dbbdbb
authored
Feb 08, 2017
by
ShelbyFrances
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: support -I abspath in trace, argdist
parent
86cd5351
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
tools/argdist.py
tools/argdist.py
+8
-2
tools/trace.py
tools/trace.py
+7
-2
No files found.
tools/argdist.py
View file @
f5dbbdbb
...
@@ -619,7 +619,8 @@ argdist -p 2780 -z 120 \\
...
@@ -619,7 +619,8 @@ argdist -p 2780 -z 120 \\
"
(
see
examples
below
)
")
"
(
see
examples
below
)
")
parser.add_argument("
-
I
", "
--
include
", action="
append
",
parser.add_argument("
-
I
", "
--
include
", action="
append
",
metavar="
header
",
metavar="
header
",
help="
additional
header
files
to
include
in
the
BPF
program
")
help="
additional
header
files
to
include
in
the
BPF
program
"
"
as
either
full
path
,
or
relative
to
'/usr/include'")
self.args = parser.parse_args()
self.args = parser.parse_args()
self.usdt_ctx = None
self.usdt_ctx = None
...
@@ -640,7 +641,12 @@ struct __string_t { char s[%d]; };
...
@@ -640,7 +641,12 @@ struct __string_t { char s[%d]; };
#include <uapi/linux/ptrace.h>
#include <uapi/linux/ptrace.h>
""" % self.args.string_size
""" % self.args.string_size
for include in (self.args.include or []):
for include in (self.args.include or []):
if include.startswith(("
.
", "
/
")):
include = os.path.abspath(include)
bpf_source += "
#include \"%s\"\n" % include
else
:
bpf_source
+=
"#include <%s>
\
n
"
%
include
bpf_source
+=
"#include <%s>
\
n
"
%
include
bpf_source
+=
BPF
.
generate_auto_includes
(
bpf_source
+=
BPF
.
generate_auto_includes
(
map
(
lambda
p
:
p
.
raw_spec
,
self
.
probes
))
map
(
lambda
p
:
p
.
raw_spec
,
self
.
probes
))
for
probe
in
self
.
probes
:
for
probe
in
self
.
probes
:
...
...
tools/trace.py
View file @
f5dbbdbb
...
@@ -624,7 +624,8 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
...
@@ -624,7 +624,8 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
help
=
"probe specifier (see examples)"
)
help
=
"probe specifier (see examples)"
)
parser
.
add_argument
(
"-I"
,
"--include"
,
action
=
"append"
,
parser
.
add_argument
(
"-I"
,
"--include"
,
action
=
"append"
,
metavar
=
"header"
,
metavar
=
"header"
,
help
=
"additional header files to include in the BPF program"
)
help
=
"additional header files to include in the BPF program "
"as either full path, or relative to '/usr/include'"
)
self
.
args
=
parser
.
parse_args
()
self
.
args
=
parser
.
parse_args
()
if
self
.
args
.
tgid
and
self
.
args
.
pid
:
if
self
.
args
.
tgid
and
self
.
args
.
pid
:
parser
.
error
(
"only one of -p and -t may be specified"
)
parser
.
error
(
"only one of -p and -t may be specified"
)
...
@@ -644,6 +645,10 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
...
@@ -644,6 +645,10 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
"""
"""
for
include
in
(
self
.
args
.
include
or
[]):
for
include
in
(
self
.
args
.
include
or
[]):
if
include
.
startswith
((
"."
,
"/"
)):
include
=
os
.
path
.
abspath
(
include
)
self
.
program
+=
"#include
\
"
%s
\
"
\
n
"
%
include
else
:
self
.
program
+=
"#include <%s>
\
n
"
%
include
self
.
program
+=
"#include <%s>
\
n
"
%
include
self
.
program
+=
BPF
.
generate_auto_includes
(
self
.
program
+=
BPF
.
generate_auto_includes
(
map
(
lambda
p
:
p
.
raw_probe
,
self
.
probes
))
map
(
lambda
p
:
p
.
raw_probe
,
self
.
probes
))
...
...
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