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
47fa8aa8
Commit
47fa8aa8
authored
Feb 05, 2019
by
Ali Saidi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for arm64 (aarch64)
Fixes issue #338
parent
ccac69c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
1 deletion
+97
-1
src/arch/CMakeLists.txt
src/arch/CMakeLists.txt
+5
-1
src/arch/aarch64.cpp
src/arch/aarch64.cpp
+92
-0
No files found.
src/arch/CMakeLists.txt
View file @
47fa8aa8
add_library
(
arch x86_64.cpp
)
if
(
CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL
"aarch64"
)
add_library
(
arch aarch64.cpp
)
else
()
add_library
(
arch x86_64.cpp
)
endif
()
src/arch/aarch64.cpp
0 → 100644
View file @
47fa8aa8
#include "arch.h"
#include <algorithm>
#include <array>
namespace
bpftrace
{
namespace
arch
{
static
std
::
array
<
std
::
string
,
35
>
registers
=
{
"r0"
,
"r1"
,
"r2"
,
"r3"
,
"r4"
,
"r5"
,
"r6"
,
"r7"
,
"r8"
,
"r9"
,
"r10"
,
"r11"
,
"r12"
,
"r13"
,
"r14"
,
"r15"
,
"r16"
,
"r17"
,
"r18"
,
"r19"
,
"r20"
,
"r21"
,
"r22"
,
"r23"
,
"r24"
,
"r25"
,
"r26"
,
"r27"
,
"r28"
,
"r29"
,
"r30"
,
"r31"
,
"sp"
,
"pc"
,
"pstate"
,
};
static
std
::
array
<
std
::
string
,
8
>
arg_registers
=
{
"r0"
,
"r1"
,
"r2"
,
"r3"
,
"r4"
,
"r5"
,
"r6"
,
"r7"
,
};
int
offset
(
std
::
string
reg_name
)
{
auto
it
=
find
(
registers
.
begin
(),
registers
.
end
(),
reg_name
);
if
(
it
==
registers
.
end
())
return
-
1
;
return
distance
(
registers
.
begin
(),
it
);
}
int
max_arg
()
{
return
arg_registers
.
size
()
-
1
;
}
int
arg_offset
(
int
arg_num
)
{
return
offset
(
arg_registers
.
at
(
arg_num
));
}
int
ret_offset
()
{
return
offset
(
"r0"
);
}
int
pc_offset
()
{
return
offset
(
"pc"
);
}
std
::
string
name
()
{
return
std
::
string
(
"aarch64"
);
}
}
// namespace arch
}
// namespace bpftrace
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