Skip to content

Commit

Permalink
cleanup: dropped syscall_table ia32 support.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP authored and poiana committed Apr 11, 2023
1 parent 2f7297f commit 4d5a462
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ func generateReport(systemMap SyscallMap) {
if !strings.HasPrefix(line, "[__NR_") {
return "", -1
}
if strings.HasPrefix(line, "[__NR_ia32_") {
return "", -1
}
// Drop lines without an event associated
if strings.Index(line, "PPME") == -1 {
return "", -1
Expand Down Expand Up @@ -243,9 +240,6 @@ func loadLibsMap() SyscallMap {
if !strings.HasPrefix(line, "[__NR_") {
return "", -1
}
if strings.HasPrefix(line, "[__NR_ia32_") {
return "", -1
}
line = strings.TrimPrefix(line, "[")
fields := strings.Fields(line)
return fields[0], -1 // no syscallnr available
Expand Down Expand Up @@ -329,22 +323,15 @@ func loadSyscallMap(filepath string, filter func(string) (string, int64)) Syscal
}

func updateLibsSyscallTable(syscallMap SyscallMap) {
isIA32 := false
updateLibsMap(*libsRepoRoot+"/driver/syscall_table.c",
func(lines *[]string, line string) bool {
if line == "};" {
for key := range syscallMap {
ppmSc := "PPM_SC_" + strings.ToUpper(key)
if isIA32 {
*lines = append(*lines, "#ifdef __NR_ia32_"+key)
*lines = append(*lines, "\t[__NR_ia32_"+key+" - SYSCALL_TABLE_ID0] = {.ppm_sc = "+ppmSc+"},")
} else {
*lines = append(*lines, "#ifdef __NR_"+key)
*lines = append(*lines, "\t[__NR_"+key+" - SYSCALL_TABLE_ID0] = {.ppm_sc = "+ppmSc+"},")
}
*lines = append(*lines, "#ifdef __NR_"+key)
*lines = append(*lines, "\t[__NR_"+key+" - SYSCALL_TABLE_ID0] = {.ppm_sc = "+ppmSc+"},")
*lines = append(*lines, "#endif")
}
isIA32 = true // next time print ia32 instead!
}
return false
})
Expand Down

0 comments on commit 4d5a462

Please sign in to comment.