Skip to content

Commit 4701046

Browse files
giordanoZentrik
authored andcommitted
Add more references for syscall codes
1 parent 03282fe commit 4701046

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/LinuxPerf.jl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,25 @@ function Base.show(io::IO, e::EventType)
157157
end
158158
end
159159

160+
# To support a new architecture, look for the code corresponding to the `perf_event_open`
161+
# syscall in https://gpages.juszkiewicz.com.pl/syscalls-table/syscalls.html
160162
const SYS_perf_event_open = if Sys.ARCH === :x86_64
163+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/x86/entry/syscalls/syscall_64.tbl
161164
Clong(298)
162165
elseif Sys.ARCH === :i686
166+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/x86/entry/syscalls/syscall_32.tbl
163167
Clong(336)
164168
elseif Sys.ARCH === :aarch64
169+
# See also https://arm64.syscall.sh/
165170
Clong(241)
166171
elseif Sys.ARCH === :arm
172+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/arm/tools/syscall.tbl
167173
Clong(364)
168174
elseif Sys.ARCH === :powerpc64le || Sys.ARCH === :ppc64le
175+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/powerpc/kernel/syscalls/syscall.tbl
169176
Clong(319)
170177
elseif Sys.ARCH === :riscv64 || Sys.ARCH === :rv64
171-
# See syscalls table at https://jborza.com/post/2021-05-11-riscv-linux-syscalls/
178+
# See also https://jborza.com/post/2021-05-11-riscv-linux-syscalls/
172179
Clong(241)
173180
else
174181
Clong(-1) # sentinel for unknown syscall ID
@@ -343,18 +350,25 @@ function Base.show(io::IO, g::EventGroup)
343350
print(io, "\t", g.event_types[end], ")")
344351
end
345352

353+
# To support a new architecture, look for the code corresponding to the `prctl` syscall in
354+
# https://gpages.juszkiewicz.com.pl/syscalls-table/syscalls.html
346355
const SYS_prctl = if Sys.ARCH === :x86_64
356+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/x86/entry/syscalls/syscall_64.tbl
347357
Clong(157)
348358
elseif Sys.ARCH === :i686
359+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/x86/entry/syscalls/syscall_32.tbl
349360
Clong(172)
350361
elseif Sys.ARCH === :aarch64
362+
# See also https://arm64.syscall.sh/
351363
Clong(167)
352364
elseif Sys.ARCH === :arm
365+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/arm/tools/syscall.tbl
353366
Clong(172)
354367
elseif Sys.ARCH === :powerpc64le || Sys.ARCH === :ppc64le
368+
# See also https://github.com/torvalds/linux/blob/b62cef9a5c673f1b8083159f5dc03c1c5daced2f/arch/powerpc/kernel/syscalls/syscall.tbl
355369
Clong(171)
356370
elseif Sys.ARCH === :riscv64 || Sys.ARCH === :rv64
357-
# See syscalls table at https://jborza.com/post/2021-05-11-riscv-linux-syscalls/
371+
# See also https://jborza.com/post/2021-05-11-riscv-linux-syscalls/
358372
Clong(167)
359373
else
360374
Clong(-1) # sentinel for unknown syscall ID

0 commit comments

Comments
 (0)