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
7fb7bfa6
Commit
7fb7bfa6
authored
Jan 19, 2017
by
Michael Przybylski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed TestUprobes.test_simple_library() in test_uprobes.lua
parent
70e20343
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
src/lua/bcc/bpf.lua
src/lua/bcc/bpf.lua
+1
-1
src/lua/bcc/sym.lua
src/lua/bcc/sym.lua
+2
-2
tests/lua/test_uprobes.lua
tests/lua/test_uprobes.lua
+2
-2
No files found.
src/lua/bcc/bpf.lua
View file @
7fb7bfa6
...
...
@@ -180,7 +180,7 @@ end
function
Bpf
:
attach_uprobe
(
args
)
Bpf
.
check_probe_quota
(
1
)
local
path
,
addr
=
Sym
.
check_path_symbol
(
args
.
name
,
args
.
sym
,
args
.
addr
)
local
path
,
addr
=
Sym
.
check_path_symbol
(
args
.
name
,
args
.
sym
,
args
.
addr
,
args
.
pid
)
local
fn
=
self
:
load_func
(
args
.
fn_name
,
'BPF_PROG_TYPE_KPROBE'
)
local
ptype
=
args
.
retprobe
and
"r"
or
"p"
local
ev_name
=
string.format
(
"%s_%s_0x%p"
,
ptype
,
path
:
gsub
(
"
[^
%a%d
]
"
,
"_"
),
addr
)
...
...
src/lua/bcc/sym.lua
View file @
7fb7bfa6
...
...
@@ -30,10 +30,10 @@ local function create_cache(pid)
}
end
local
function
check_path_symbol
(
module
,
symname
,
addr
)
local
function
check_path_symbol
(
module
,
symname
,
addr
,
pid
)
local
sym
=
SYM
()
local
module_path
if
libbcc
.
bcc_resolve_symname
(
module
,
symname
,
addr
or
0x0
,
0
,
sym
)
<
0
then
if
libbcc
.
bcc_resolve_symname
(
module
,
symname
,
addr
or
0x0
,
pid
or
0
,
sym
)
<
0
then
if
sym
[
0
].
module
==
nil
then
error
(
"could not find library '%s' in the library path"
%
module
)
else
...
...
tests/lua/test_uprobes.lua
View file @
7fb7bfa6
...
...
@@ -27,8 +27,8 @@ int count(struct pt_regs *ctx) {
local
text
=
text
:
gsub
(
"PID"
,
tostring
(
pid
))
local
b
=
BPF
:
new
{
text
=
text
}
b
:
attach_uprobe
{
name
=
"c"
,
sym
=
"malloc_stats"
,
fn_name
=
"count"
}
b
:
attach_uprobe
{
name
=
"c"
,
sym
=
"malloc_stats"
,
fn_name
=
"count"
,
retprobe
=
true
}
b
:
attach_uprobe
{
name
=
"c"
,
sym
=
"malloc_stats"
,
fn_name
=
"count"
,
pid
=
pid
}
b
:
attach_uprobe
{
name
=
"c"
,
sym
=
"malloc_stats"
,
fn_name
=
"count"
,
pid
=
pid
,
retprobe
=
true
}
assert_equals
(
BPF
.
num_open_uprobes
(),
2
)
...
...
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