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
782158bd
Commit
782158bd
authored
Nov 12, 2015
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #290 from iovisor/bblanco_dev
Fix unary operator handling of probe reads with parens
parents
66a33c88
80667b7b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
src/cc/frontends/clang/b_frontend_action.cc
src/cc/frontends/clang/b_frontend_action.cc
+3
-0
tests/cc/test_clang.py
tests/cc/test_clang.py
+14
-0
No files found.
src/cc/frontends/clang/b_frontend_action.cc
View file @
782158bd
...
...
@@ -109,6 +109,9 @@ class ProbeChecker : public RecursiveASTVisitor<ProbeChecker> {
needs_probe_
=
false
;
return
false
;
}
bool
VisitParenExpr
(
ParenExpr
*
E
)
{
return
false
;
}
bool
VisitDeclRefExpr
(
DeclRefExpr
*
E
)
{
if
(
ptregs_
.
find
(
E
->
getDecl
())
!=
ptregs_
.
end
())
needs_probe_
=
true
;
...
...
tests/cc/test_clang.py
View file @
782158bd
...
...
@@ -249,5 +249,19 @@ int kprobe____kmalloc(struct pt_regs *ctx, size_t size) {
return 0;
}"""
,
debug
=
4
)
def
test_unop_probe_read
(
self
):
text
=
"""
#include <linux/blkdev.h>
int trace_entry(struct pt_regs *ctx, struct request *req) {
if (!(req->bio->bi_rw & 1))
return 1;
if (((req->bio->bi_rw)))
return 1;
return 0;
}
"""
b
=
BPF
(
text
=
text
)
fn
=
b
.
load_func
(
"trace_entry"
,
BPF
.
KPROBE
)
if
__name__
==
"__main__"
:
main
()
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