X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=26a02edcb0a82231bad60526b3a688eb941fe5c3;hb=d9a7cf0364a00f1560ed3d6585bd58553474d9d7;hp=d15e3f83a66a68af207820b0c5f6770ba67d12b5;hpb=a90917c3f8c4ed79117f1caa333b29a2108084ec;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index d15e3f83..26a02edc 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -1,10 +1,25 @@ /* * lttng-abi.c * - * Copyright 2010-2011 (c) - Mathieu Desnoyers - * * LTTng ABI * + * Copyright (C) 2010-2012 Mathieu Desnoyers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; only + * version 2.1 of the License. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * * Mimic system calls for: * - session creation, returns a file descriptor or failure. * - channel creation, returns a file descriptor or failure. @@ -20,8 +35,6 @@ * - Takes an instrumentation source as parameter * - e.g. tracepoints, dynamic_probes... * - Takes instrumentation source specific arguments. - * - * Dual LGPL v2.1/GPL v2 license. */ #include @@ -135,9 +148,9 @@ long lttng_abi_tracer_version(struct file *file, { struct lttng_kernel_tracer_version v; - v.version = LTTNG_VERSION; - v.patchlevel = LTTNG_PATCHLEVEL; - v.sublevel = LTTNG_SUBLEVEL; + v.major = LTTNG_MODULES_MAJOR_VERSION; + v.minor = LTTNG_MODULES_MINOR_VERSION; + v.patchlevel = LTTNG_MODULES_PATCHLEVEL_VERSION; if (copy_to_user(uversion_param, &v, sizeof(v))) return -EFAULT; @@ -175,7 +188,7 @@ long lttng_abi_add_context(struct file *file, case LTTNG_KERNEL_CONTEXT_VPPID: return lttng_add_vppid_to_ctx(ctx); case LTTNG_KERNEL_CONTEXT_PERF_COUNTER: - context_param.u.perf_counter.name[LTTNG_SYM_NAME_LEN - 1] = '\0'; + context_param.u.perf_counter.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; return lttng_add_perf_counter_to_ctx(context_param.u.perf_counter.type, context_param.u.perf_counter.config, context_param.u.perf_counter.name, @@ -500,16 +513,16 @@ int lttng_abi_create_event(struct file *channel_file, if (copy_from_user(&event_param, uevent_param, sizeof(event_param))) return -EFAULT; - event_param.name[LTTNG_SYM_NAME_LEN - 1] = '\0'; + event_param.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; switch (event_param.instrumentation) { case LTTNG_KERNEL_KRETPROBE: - event_param.u.kretprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0'; + event_param.u.kretprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; break; case LTTNG_KERNEL_KPROBE: - event_param.u.kprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0'; + event_param.u.kprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; break; case LTTNG_KERNEL_FUNCTION: - event_param.u.ftrace.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0'; + event_param.u.ftrace.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; break; default: break; @@ -749,10 +762,10 @@ int __init lttng_abi_init(void) int ret = 0; wrapper_vmalloc_sync_all(); - lttng_proc_dentry = proc_create_data("lttng", S_IWUSR, NULL, + lttng_proc_dentry = proc_create_data("lttng", S_IRUSR | S_IWUSR, NULL, <tng_fops, NULL); - if (lttng_proc_dentry) { + if (!lttng_proc_dentry) { printk(KERN_ERR "Error creating LTTng control file\n"); ret = -ENOMEM; goto error;