X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Flttng-syscall.hpp;fp=src%2Fbin%2Flttng-sessiond%2Flttng-syscall.hpp;h=78691f95dc7eb2c6658c7c32970e605712539422;hp=0000000000000000000000000000000000000000;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hpb=4878de5c7deb512bbdac4fdfc498907efa06fb7c diff --git a/src/bin/lttng-sessiond/lttng-syscall.hpp b/src/bin/lttng-sessiond/lttng-syscall.hpp new file mode 100644 index 000000000..78691f95d --- /dev/null +++ b/src/bin/lttng-sessiond/lttng-syscall.hpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014 David Goulet + * + * SPDX-License-Identifier: GPL-2.0-only + * + */ + +#ifndef LTTNG_SYSCALL_H +#define LTTNG_SYSCALL_H + +#include +#include + +#include "trace-kernel.hpp" + +/* + * Default size of the kernel system call array. With this size, we usually + * reallocate twice considering a 32 bit compat layer also. + */ +#define SYSCALL_TABLE_INIT_SIZE 256 + +/* Maximum length of a syscall name. */ +#define SYSCALL_NAME_LEN 255 + +/* + * Represent a kernel syscall and used when we are populating the internal + * list. + */ +struct syscall { + uint32_t index; + uint32_t bitness; + char name[SYSCALL_NAME_LEN]; + /* Used by the list syscalls command. */ + struct lttng_ht_node_str node; +}; + +/* + * Allocated once when listing all syscalls at boot time. This is an array + * indexed by the syscall index provided in the listing. + */ +extern struct syscall *syscall_table; + +/* Use to list kernel system calls. */ +int syscall_init_table(int tracer_fd); +ssize_t syscall_table_list(struct lttng_event **events); + +#endif /* LTTNG_SYSCALL_H */