aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkg/host/syscalls_linux.go2
-rw-r--r--pkg/host/syscalls_linux_test.go16
2 files changed, 18 insertions, 0 deletions
diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go
index 4efd28907..8481d7749 100644
--- a/pkg/host/syscalls_linux.go
+++ b/pkg/host/syscalls_linux.go
@@ -82,6 +82,8 @@ func parseKallsyms(kallsyms []byte, arch string) map[string]bool {
re = regexp.MustCompile(` T sys_(mips_)?([^\n]+)\n`)
case "s390x":
re = regexp.MustCompile(` T (__s390_|__s390x_)?sys_([^\n]+)\n`)
+ case "riscv64":
+ re = regexp.MustCompile(` T sys_(riscv_)?([^\n]+)\n`)
default:
panic("unsupported arch for kallsyms parsing")
}
diff --git a/pkg/host/syscalls_linux_test.go b/pkg/host/syscalls_linux_test.go
index aa44369f0..8e9feeba2 100644
--- a/pkg/host/syscalls_linux_test.go
+++ b/pkg/host/syscalls_linux_test.go
@@ -144,6 +144,22 @@ c00000000037eb00 T sys_newstat
[]string{"bind", "listen", "accept4"},
[]string{"bind", "listen", "accept4"},
},
+ {
+ "riscv64",
+ []byte(`
+ffffffe0005c9b02 T __sys_bind
+ffffffe0005c9ba0 T sys_bind
+ffffffe0005c9ba0 T __se_sys_bind
+ffffffe0005c9e72 T __sys_accept4
+ffffffe0005c9f00 T sys_accept4
+ffffffe0005c9f00 T __se_sys_accept4
+ffffffe0005c9bd8 T __sys_listen
+ffffffe0005c9c76 T sys_listen
+ffffffe0005c9c76 T __se_sys_listen
+ `),
+ []string{"bind", "listen", "accept4"},
+ []string{"bind", "listen", "accept4"},
+ },
}
for _, test := range tests {