Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
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
bpftrace
Commits
64f706ce
Commit
64f706ce
authored
Sep 26, 2018
by
Brendan Gregg
Committed by
GitHub
Sep 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #115 from iovisor/bug
allow u32 binops and map keys
parents
8fef8ec5
053cd6c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
src/ast/codegen_llvm.cpp
src/ast/codegen_llvm.cpp
+4
-0
src/bpftrace.cpp
src/bpftrace.cpp
+7
-0
No files found.
src/ast/codegen_llvm.cpp
View file @
64f706ce
...
@@ -656,6 +656,10 @@ void CodegenLLVM::visit(Binop &binop)
...
@@ -656,6 +656,10 @@ void CodegenLLVM::visit(Binop &binop)
binop
.
right
->
accept
(
*
this
);
binop
.
right
->
accept
(
*
this
);
rhs
=
expr_
;
rhs
=
expr_
;
// promote int to 64-bit
lhs
=
b_
.
CreateIntCast
(
lhs
,
b_
.
getInt64Ty
(),
false
);
rhs
=
b_
.
CreateIntCast
(
rhs
,
b_
.
getInt64Ty
(),
false
);
switch
(
binop
.
op
)
{
switch
(
binop
.
op
)
{
case
bpftrace
:
:
Parser
::
token
::
EQ
:
expr_
=
b_
.
CreateICmpEQ
(
lhs
,
rhs
);
break
;
case
bpftrace
:
:
Parser
::
token
::
EQ
:
expr_
=
b_
.
CreateICmpEQ
(
lhs
,
rhs
);
break
;
case
bpftrace
:
:
Parser
::
token
::
NE
:
expr_
=
b_
.
CreateICmpNE
(
lhs
,
rhs
);
break
;
case
bpftrace
:
:
Parser
::
token
::
NE
:
expr_
=
b_
.
CreateICmpNE
(
lhs
,
rhs
);
break
;
...
...
src/bpftrace.cpp
View file @
64f706ce
...
@@ -1384,6 +1384,13 @@ void BPFtrace::sort_by_key(std::vector<SizedType> key_args,
...
@@ -1384,6 +1384,13 @@ void BPFtrace::sort_by_key(std::vector<SizedType> key_args,
return
*
(
uint64_t
*
)(
a
.
first
.
data
()
+
arg_offset
)
<
*
(
uint64_t
*
)(
b
.
first
.
data
()
+
arg_offset
);
return
*
(
uint64_t
*
)(
a
.
first
.
data
()
+
arg_offset
)
<
*
(
uint64_t
*
)(
b
.
first
.
data
()
+
arg_offset
);
});
});
}
}
else
if
(
arg
.
size
==
4
)
{
std
::
stable_sort
(
values_by_key
.
begin
(),
values_by_key
.
end
(),
[
&
](
auto
&
a
,
auto
&
b
)
{
return
*
(
uint32_t
*
)(
a
.
first
.
data
()
+
arg_offset
)
<
*
(
uint32_t
*
)(
b
.
first
.
data
()
+
arg_offset
);
});
}
else
else
abort
();
abort
();
}
}
...
...
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