X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Flttng-syscall.h;fp=src%2Fbin%2Flttng-sessiond%2Flttng-syscall.h;h=a2708619c1357ff40c0bde20b112d25e5213e673;hb=0dbc2034c9571ec342d382bf87231775563f8624;hp=0000000000000000000000000000000000000000;hpb=36e6632013ee40eabfbe50db19ebd8e606ba0204;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/lttng-syscall.h b/src/bin/lttng-sessiond/lttng-syscall.h new file mode 100644 index 000000000..a2708619c --- /dev/null +++ b/src/bin/lttng-sessiond/lttng-syscall.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2014 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef LTTNG_SYSCALL_H +#define LTTNG_SYSCALL_H + +#include +#include + +#include "trace-kernel.h" + +/* + * 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(void); +ssize_t syscall_table_list(struct lttng_event **events); + +#endif /* LTTNG_SYSCALL_H */