18 #include <linux/compiler.h> 20 #ifdef HAVE_SYSCALL_TABLE_SUPPORT 25 #if defined(__x86_64__) 29 #elif defined(__s390x__) 31 const int syscalltbl_native_max_id = SYSCALLTBL_S390_64_MAX_ID;
32 static const char **syscalltbl_native = syscalltbl_s390_64;
33 #elif defined(__powerpc64__) 35 const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_64_MAX_ID;
36 static const char **syscalltbl_native = syscalltbl_powerpc_64;
37 #elif defined(__powerpc__) 38 #include <asm/syscalls_32.c> 39 const int syscalltbl_native_max_id = SYSCALLTBL_POWERPC_32_MAX_ID;
40 static const char **syscalltbl_native = syscalltbl_powerpc_32;
48 static int syscallcmpname(
const void *vkey,
const void *ventry)
50 const char *
key = vkey;
53 return strcmp(key, entry->
name);
56 static int syscallcmp(
const void *va,
const void *vb)
58 const struct syscall *a = va, *b = vb;
60 return strcmp(a->
name, b->name);
63 static int syscalltbl__init_native(
struct syscalltbl *tbl)
65 int nr_entries = 0, i, j;
68 for (i = 0; i <= syscalltbl_native_max_id; ++i)
69 if (syscalltbl_native[i])
76 for (i = 0, j = 0; i <= syscalltbl_native_max_id; ++i) {
77 if (syscalltbl_native[i]) {
78 entries[j].
name = syscalltbl_native[i];
84 qsort(tbl->
syscalls.entries, nr_entries,
sizeof(
struct syscall), syscallcmp);
85 tbl->
syscalls.nr_entries = nr_entries;
93 if (syscalltbl__init_native(tbl)) {
109 return id <= syscalltbl_native_max_id ? syscalltbl_native[id]: NULL;
115 tbl->
syscalls.nr_entries,
sizeof(*sc),
118 return sc ? sc->id : -1;
126 for (i = *idx + 1; i < tbl->
syscalls.nr_entries; ++i) {
129 return syscalls[i].id;
144 #include <libaudit.h> 170 const char *syscall_glob __maybe_unused,
int *idx __maybe_unused)
struct syscalltbl::@150::@152 syscalls
int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx)
void syscalltbl__delete(struct syscalltbl *tbl)
static const char * syscalltbl_x86_64[]
bool strglobmatch(const char *str, const char *pat)
static int entry(u64 ip, struct unwind_info *ui)
int syscalltbl__strglobmatch_next(struct syscalltbl *tbl __maybe_unused, const char *syscall_glob __maybe_unused, int *idx __maybe_unused)
const char * syscalltbl__name(const struct syscalltbl *tbl, int id)
int syscalltbl__id(struct syscalltbl *tbl, const char *name)
struct syscalltbl * syscalltbl__new(void)
#define SYSCALLTBL_x86_64_MAX_ID