summaryrefslogtreecommitdiff
path: root/internal/tracepoints
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-02-19 11:27:00 +0200
committerPaul Buetow <paul@buetow.org>2024-02-19 11:27:00 +0200
commit954197aa34ebc59becd56f093d3690ab65f1d8a4 (patch)
treeb61af32f8aab1e99b06fb4144eec0682839bf3f0 /internal/tracepoints
parent72185eae0eefed8f6d5a899c10dfea1d41e57690 (diff)
restructure
Diffstat (limited to 'internal/tracepoints')
-rw-r--r--internal/tracepoints/syscalls.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/tracepoints/syscalls.go b/internal/tracepoints/syscalls.go
index c5bdabf..ccc4f58 100644
--- a/internal/tracepoints/syscalls.go
+++ b/internal/tracepoints/syscalls.go
@@ -27,20 +27,21 @@ func filterLines(lines []string) ([]string, error) {
}
// Filter out all used syscall tracepoints from *.bpf.c
-func usedSyscalls() ([]string, error) {
+func tracedSyscalls() ([]string, error) {
var syscalls []string
+ const syscallDir = "internal/c/tracepoints"
- files, err := os.ReadDir(".")
+ files, err := os.ReadDir(syscallDir)
if err != nil {
return syscalls, err
}
for _, file := range files {
fileName := file.Name()
- if !strings.HasSuffix(fileName, ".bpf.c") {
+ if !strings.HasSuffix(fileName, ".c") {
continue
}
- content, err := os.ReadFile(fileName)
+ content, err := os.ReadFile(fmt.Sprintf("%s/%s", syscallDir, fileName))
if err != nil {
return syscalls, err
}
@@ -55,7 +56,7 @@ func usedSyscalls() ([]string, error) {
}
func AttachSyscalls(bpfModule *bpf.Module) error {
- syscalls, err := usedSyscalls()
+ syscalls, err := tracedSyscalls()
if err != nil {
return err
}