X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fsyscalls%2Flttng-syscalls-extractor%2Flttng-syscalls-extractor.c;h=0f683750a49673742db9b1cd8f2ac572a97357ac;hb=b7cdc18250880cc44edeef4a4b42c8ac7a135a6d;hp=71197468986377b30153683cd7f81bee6f01ee4a;hpb=7801e9f45613e82205af194218f1910c4640855f;p=lttng-modules.git diff --git a/instrumentation/syscalls/lttng-syscalls-extractor/lttng-syscalls-extractor.c b/instrumentation/syscalls/lttng-syscalls-extractor/lttng-syscalls-extractor.c index 71197468..0f683750 100644 --- a/instrumentation/syscalls/lttng-syscalls-extractor/lttng-syscalls-extractor.c +++ b/instrumentation/syscalls/lttng-syscalls-extractor/lttng-syscalls-extractor.c @@ -1,24 +1,11 @@ -/* +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * * lttng-syscalls-extractor.c * * Dump syscall metadata to console. * - * Copyright 2011 - Mathieu Desnoyers - * Copyright 2011 - Julien Desfossez - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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. + * Copyright 2011 Mathieu Desnoyers + * Copyright 2011 Julien Desfossez */ #include @@ -29,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -41,6 +28,13 @@ #error "You need to set CONFIG_KALLSYMS_ALL=y" #endif +/* + * The 'ident' parameter is prepended to each printk line to help + * extract the proper lines from dmesg. + */ +static char *ident = ""; +module_param(ident, charp, 0); + static struct syscall_metadata **__start_syscalls_metadata; static struct syscall_metadata **__stop_syscalls_metadata; @@ -65,36 +59,40 @@ int init_module(void) __start_syscalls_metadata = (void *) kallsyms_lookup_name("__start_syscalls_metadata"); __stop_syscalls_metadata = (void *) kallsyms_lookup_name("__stop_syscalls_metadata"); + printk("%s---START---\n", ident); for (i = 0; i < NR_syscalls; i++) { int j; meta = find_syscall_meta(i); if (!meta) continue; - printk("syscall %s nr %d nbargs %d ", - meta->name, meta->syscall_nr, meta->nb_args); - printk("types: ("); + printk("%ssyscall %s nr %d nbargs %d ", + ident, meta->name, meta->syscall_nr, meta->nb_args); + printk(KERN_CONT "types: ("); for (j = 0; j < meta->nb_args; j++) { if (j > 0) - printk(", "); - printk("%s", meta->types[j]); + printk(KERN_CONT ", "); + printk(KERN_CONT "%s", meta->types[j]); } - printk(") "); - printk("args: ("); + printk(KERN_CONT ") "); + printk(KERN_CONT "args: ("); for (j = 0; j < meta->nb_args; j++) { if (j > 0) - printk(", "); - printk("%s", meta->args[j]); + printk(KERN_CONT ", "); + printk(KERN_CONT "%s", meta->args[j]); } - printk(")\n"); + printk(KERN_CONT ")\n"); } - printk("SUCCESS\n"); + printk("%s---END---\n", ident); + /* + * This module always fails to load. + */ return -1; } void cleanup_module(void) { -} +} MODULE_LICENSE("GPL");