X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Fbackend_types.h;h=6813dd8b47a4127c3dbacc717c50742f96bbe561;hb=886d51a3d7ed5fa6b41d7f19b3e14ae6c535a44c;hp=3d1fcc064a332973ce64449596866027bbfc6008;hpb=9cccf98a6efe4d77d247610fbab29305159a9b46;p=lttng-modules.git diff --git a/lib/ringbuffer/backend_types.h b/lib/ringbuffer/backend_types.h index 3d1fcc06..6813dd8b 100644 --- a/lib/ringbuffer/backend_types.h +++ b/lib/ringbuffer/backend_types.h @@ -1,14 +1,26 @@ -#ifndef _LINUX_RING_BUFFER_BACKEND_TYPES_H -#define _LINUX_RING_BUFFER_BACKEND_TYPES_H +#ifndef _LIB_RING_BUFFER_BACKEND_TYPES_H +#define _LIB_RING_BUFFER_BACKEND_TYPES_H /* - * linux/ringbuffer/backend_types.h - * - * Copyright (C) 2008-2010 - Mathieu Desnoyers + * lib/ringbuffer/backend_types.h * * Ring buffer backend (types). * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2008-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 */ #include @@ -72,9 +84,14 @@ struct channel_backend { u64 start_tsc; /* Channel creation TSC value */ void *priv; /* Client-specific information */ struct notifier_block cpu_hp_notifier; /* CPU hotplug notifier */ - const struct lib_ring_buffer_config *config; /* Ring buffer configuration */ + /* + * We need to copy config because the module containing the + * source config can vanish before the last reference to this + * channel's streams is released. + */ + struct lib_ring_buffer_config config; /* Ring buffer configuration */ cpumask_var_t cpumask; /* Allocated per-cpu buffers cpumask */ char name[NAME_MAX]; /* Channel name */ }; -#endif /* _LINUX_RING_BUFFER_BACKEND_TYPES_H */ +#endif /* _LIB_RING_BUFFER_BACKEND_TYPES_H */