Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bcc
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
la
platform
external
bcc
Commits
f5dbbdbb
Commit
f5dbbdbb
authored
8 years ago
by
ShelbyFrances
Browse files
Options
Downloads
Patches
Plain Diff
tools: support -I abspath in trace, argdist
parent
86cd5351
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/argdist.py
+8
-2
8 additions, 2 deletions
tools/argdist.py
tools/trace.py
+7
-2
7 additions, 2 deletions
tools/trace.py
with
15 additions
and
4 deletions
tools/argdist.py
+
8
−
2
View file @
f5dbbdbb
...
...
@@ -619,7 +619,8 @@ argdist -p 2780 -z 120 \\
"
(see examples below)
"
)
parser
.
add_argument
(
"
-I
"
,
"
--include
"
,
action
=
"
append
"
,
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
.
usdt_ctx
=
None
...
...
@@ -640,7 +641,12 @@ struct __string_t { char s[%d]; };
#include <uapi/linux/ptrace.h>
"""
%
self
.
args
.
string_size
for
include
in
(
self
.
args
.
include
or
[]):
bpf_source
+=
"
#include <%s>
\n
"
%
include
if
include
.
startswith
((
"
.
"
,
"
/
"
)):
include
=
os
.
path
.
abspath
(
include
)
bpf_source
+=
"
#include
\"
%s
\"\n
"
%
include
else
:
bpf_source
+=
"
#include <%s>
\n
"
%
include
bpf_source
+=
BPF
.
generate_auto_includes
(
map
(
lambda
p
:
p
.
raw_spec
,
self
.
probes
))
for
probe
in
self
.
probes
:
...
...
This diff is collapsed.
Click to expand it.
tools/trace.py
+
7
−
2
View file @
f5dbbdbb
...
...
@@ -624,7 +624,8 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
help
=
"
probe specifier (see examples)
"
)
parser
.
add_argument
(
"
-I
"
,
"
--include
"
,
action
=
"
append
"
,
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
()
if
self
.
args
.
tgid
and
self
.
args
.
pid
:
parser
.
error
(
"
only one of -p and -t may be specified
"
)
...
...
@@ -644,7 +645,11 @@ trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec'
"""
for
include
in
(
self
.
args
.
include
or
[]):
self
.
program
+=
"
#include <%s>
\n
"
%
include
if
include
.
startswith
((
"
.
"
,
"
/
"
)):
include
=
os
.
path
.
abspath
(
include
)
self
.
program
+=
"
#include
\"
%s
\"\n
"
%
include
else
:
self
.
program
+=
"
#include <%s>
\n
"
%
include
self
.
program
+=
BPF
.
generate_auto_includes
(
map
(
lambda
p
:
p
.
raw_probe
,
self
.
probes
))
for
probe
in
self
.
probes
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment