X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsyscall.h;fp=src%2Fbin%2Flttng-sessiond%2Fsyscall.h;h=97fb66960d11bc87e31ac6821f397102526b9fa5;hp=0000000000000000000000000000000000000000;hb=834978fd9e2392f20867351ca99bf7bdf31b4f56;hpb=5a510c9fc5ac8b5292a497192bd47aeec07112e3 diff --git a/src/bin/lttng-sessiond/syscall.h b/src/bin/lttng-sessiond/syscall.h new file mode 100644 index 000000000..97fb66960 --- /dev/null +++ b/src/bin/lttng-sessiond/syscall.h @@ -0,0 +1,59 @@ +/* + * 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 SYSCALL_H +#define 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); +ssize_t syscall_list_channel(struct ltt_kernel_channel *kchan, + struct lttng_event **_events, size_t size); + +#endif /* SYSCALL_H */