From: Mathieu Desnoyers Date: Thu, 5 Apr 2012 17:21:08 +0000 (-0400) Subject: Merge branch 'dev' X-Git-Tag: v2.1.0-rc1~97 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=9501d22f55b3a23f382f631c99b2325d1419b5da;hp=49365f4b706194cafe75d8b759554bf9de743c1d;p=lttng-ust.git Merge branch 'dev' --- diff --git a/COPYING b/COPYING index daf0fafa..4191b661 100644 --- a/COPYING +++ b/COPYING @@ -1,12 +1,16 @@ -UST - Userspace Tracer +LTTng UST - Userspace Tracer -Copyright (C) 2009 Mathieu Desnoyers and others. +Copyright (C) 2009-2012 Mathieu Desnoyers Copyright (C) 2010 Pierre-Marc Fournier, Nils Carlson, David Goulet and others. + +* This library is licensed under the LGPL v2.1 license, except when + specified otherwise. + 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; either -version 2.1 of the License, or (at your option) any later version. +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 @@ -16,3 +20,33 @@ 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 + + +* System headers are MIT-licensed (BSD style): + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +* liblttng-ust-ctl/ustctl.c is GPL v2. It is only used by the + lttng-sessiond program. + +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; version 2 of the License only. + +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. diff --git a/ChangeLog b/ChangeLog index 70c0c7d8..7cafa1d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2012-03-29 lttng-ust 2.0.1 + * Use bsd-compatible fcntl for close-on-exec on socket + * Fix multi-session wildcard support + * Fix event lost count when buffer is full + * Remove inappropriate \n from easy-ust sample + +2012-03-20 lttng-ust 2.0.0 + * First STABLE version + * Add version name + +2012-03-20 lttng-ust 2.0.0-rc4 + * Fix out-of-bound write in ltt-events.c + * Document LTTNG_UST_DEBUG_VALGRIND compilation flag + * Update COPYING + * Add exception handling to lttng-gen-tp io operations + +2012-03-16 lttng-ust 2.0.0-rc3 + * Fix: sendmsg should retry on EINTR, and use MSG_NOSIGNAL + * fix: ustcomm_close_unix_sock should close, not shutdown + * Fix: do not print EPIPE perror, as it is an expected error + * Ensure that multiplication of clock offset is done on 64-bit + * Add 2 missing licenses in deprecated tests + * Remove unbuild and unused (deprecated) make_shared_lib test + * License text standardization, add missing licenses + * Cleanup: remove duplicate check for 0 num_subbuf and subbuf_size + * Fix: power of 2 size check should apply to size_t type, not uint32_t + * Fix: recvmsg should handle EINTR + * Make lttng-gen-tp work on python 2.6 + * Make lttng-gen-tp executable + 2012-03-02 lttng-ust 2.0.0-rc2 * Manpage fixes * Fix: dmesg printout should not print metadata warnings diff --git a/README b/README index 8193c660..52aebd89 100644 --- a/README +++ b/README @@ -113,6 +113,10 @@ ENVIRONMENT VARIABLES: recommended for applications with time constraints on the process startup time. + - The compilation flag "-DLTTNG_UST_DEBUG_VALGRIND" should be enabled + at build time to allow liblttng-ust to be used with valgrind + (side-effect: disables per-cpu buffering). + TRACE VIEWER: diff --git a/configure.ac b/configure.ac index 6c21ac73..294d4575 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([lttng-ust],[2.0.0-rc2],[mathieu dot desnoyers at efficios dot com]) +AC_INIT([lttng-ust],[2.0.1],[mathieu dot desnoyers at efficios dot com]) # Following the numbering scheme proposed by libtool for the library version # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html @@ -13,7 +13,7 @@ AC_CONFIG_AUX_DIR([config]) AC_CANONICAL_TARGET AC_CANONICAL_HOST AC_CONFIG_MACRO_DIR([config]) -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_SRCDIR([include/lttng/tracepoint.h]) @@ -34,6 +34,10 @@ AC_DEFINE_UNQUOTED([VERSION_MAJOR], $major_version, [UST major version number]) AC_DEFINE_UNQUOTED([VERSION_MINOR], $minor_version, [UST minor version number]) AC_DEFINE_UNQUOTED([VERSION_PATCHLEVEL], $patchlevel_version, [UST patchlevel version number]) +version_name="Annedd'ale" +version_description="New type of beer, 100% from Quebec, flavored with sapin beaumier needles, with a touch of hops." +AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], [UST version name]) +AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], [UST version description]) # Checks for programs. AC_PROG_CC @@ -312,6 +316,10 @@ AC_CONFIG_FILES([ AC_OUTPUT +AS_ECHO() +AS_ECHO("Version name: $version_name") +AS_ECHO("$version_description") + # Report on the configuration options AS_ECHO() AS_ECHO("LTTng-UST will be built with the following options:") diff --git a/doc/examples/easy-ust/sample.c b/doc/examples/easy-ust/sample.c index d030d700..ddc4de69 100644 --- a/doc/examples/easy-ust/sample.c +++ b/doc/examples/easy-ust/sample.c @@ -2,14 +2,15 @@ * Copyright (C) 2011-2012 Matthew Khouzam * Copyright (C) 2012 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include @@ -26,7 +27,7 @@ int main(int argc, char **argv) int i = 0; for (i = 0; i < 100000; i++) { - tracepoint(sample_component, message, "Hello World\n"); + tracepoint(sample_component, message, "Hello World"); usleep(1); } return 0; diff --git a/doc/examples/easy-ust/sample_component_provider.h b/doc/examples/easy-ust/sample_component_provider.h index d63ff5a8..eefac0e6 100644 --- a/doc/examples/easy-ust/sample_component_provider.h +++ b/doc/examples/easy-ust/sample_component_provider.h @@ -2,14 +2,15 @@ * Copyright (C) 2011-2012 Mathieu Desnoyers * Copyright (C) 2011-2012 Matthew Khouzam * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ /* diff --git a/doc/examples/easy-ust/tp.c b/doc/examples/easy-ust/tp.c index bf8e4c3f..94c98c21 100644 --- a/doc/examples/easy-ust/tp.c +++ b/doc/examples/easy-ust/tp.c @@ -3,14 +3,15 @@ * * Copyright (c) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ /* diff --git a/doc/examples/gen-tp/sample.c b/doc/examples/gen-tp/sample.c index 729258c2..185ea3fa 100644 --- a/doc/examples/gen-tp/sample.c +++ b/doc/examples/gen-tp/sample.c @@ -2,15 +2,17 @@ * Copyright (C) 2011-2012 Matthew Khouzam * Copyright (C) 2012 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ + #include #include "sample_tracepoint.h" diff --git a/include/lttng/align.h b/include/lttng/align.h index 28392682..9154051e 100644 --- a/include/lttng/align.h +++ b/include/lttng/align.h @@ -6,14 +6,15 @@ * * (C) Copyright 2010-2011 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/bug.h b/include/lttng/bug.h index d0e59800..9368c089 100644 --- a/include/lttng/bug.h +++ b/include/lttng/bug.h @@ -6,14 +6,15 @@ * * (C) Copyright 2010-2011 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/ringbuffer-abi.h b/include/lttng/ringbuffer-abi.h index da6f813a..9c8bc77e 100644 --- a/include/lttng/ringbuffer-abi.h +++ b/include/lttng/ringbuffer-abi.h @@ -1,24 +1,25 @@ -#ifndef _UST_RING_BUFFER_ABI_H -#define _UST_RING_BUFFER_ABI_H +#ifndef _LTTNG_RING_BUFFER_ABI_H +#define _LTTNG_RING_BUFFER_ABI_H /* - * ust/ringbuffer-abi.h + * lttng/ringbuffer-abi.h * - * (C) Copyright 2005-2010 - Mathieu Desnoyers + * (C) Copyright 2005-2012 - Mathieu Desnoyers * * Wait-free ring buffer ABI. * * Author: * Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #define _UST_CMD(minor) (minor) @@ -71,4 +72,4 @@ /* flush the current sub-buffer */ #define RING_BUFFER_FLUSH _UST_CMD(0x0C) -#endif /* _UST_RING_BUFFER_ABI_H */ +#endif /* _LTTNG_RING_BUFFER_ABI_H */ diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h index 5273f321..24fb1cc4 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -1,22 +1,23 @@ -#ifndef _LINUX_RING_BUFFER_CONFIG_H -#define _LINUX_RING_BUFFER_CONFIG_H +#ifndef _LTTNG_RING_BUFFER_CONFIG_H +#define _LTTNG_RING_BUFFER_CONFIG_H /* - * linux/ringbuffer/config.h + * lttng/ringbuffer-config.h * * Copyright (C) 2010 - Mathieu Desnoyers * * Ring buffer configuration header. Note: after declaring the standard inline * functions, clients should also include linux/ringbuffer/api.h. * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include @@ -324,4 +325,4 @@ int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config * return 0; } -#endif /* _LINUX_RING_BUFFER_CONFIG_H */ +#endif /* _LTTNG_RING_BUFFER_CONFIG_H */ diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h index 9d757940..e7bcea92 100644 --- a/include/lttng/tracepoint-event.h +++ b/include/lttng/tracepoint-event.h @@ -1,14 +1,15 @@ /* * Copyright (c) 2011 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #ifdef __cplusplus diff --git a/include/lttng/tracepoint-rcu.h b/include/lttng/tracepoint-rcu.h index 23dab7d6..918837e1 100644 --- a/include/lttng/tracepoint-rcu.h +++ b/include/lttng/tracepoint-rcu.h @@ -2,19 +2,17 @@ #define _LTTNG_TRACEPOINT_RCU_H /* - * Copyright (c) 2011 - Mathieu Desnoyers + * Copyright 2011-2012 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * - * This file allows weak linking on tracepoint RCU symbols for non-LGPL - * code. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/tracepoint-types.h b/include/lttng/tracepoint-types.h index 9b104b07..ee1cd78d 100644 --- a/include/lttng/tracepoint-types.h +++ b/include/lttng/tracepoint-types.h @@ -2,16 +2,17 @@ #define _LTTNG_TRACEPOINT_TYPES_H /* - * Copyright (c) 2011 - Mathieu Desnoyers + * Copyright 2011-2012 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ struct tracepoint_probe { diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index b1c2d360..4b773bbc 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -2,16 +2,17 @@ #define _LTTNG_TRACEPOINT_H /* - * Copyright (c) 2011 - Mathieu Desnoyers + * Copyright 2011-2012 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/ust-abi.h b/include/lttng/ust-abi.h index f726c8b5..b3af9bf4 100644 --- a/include/lttng/ust-abi.h +++ b/include/lttng/ust-abi.h @@ -4,18 +4,19 @@ /* * lttng/ust-abi.h * - * Copyright 2010-2011 (c) - Mathieu Desnoyers - * * LTTng-UST ABI header * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Copyright 2010-2012 - Mathieu Desnoyers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h index 1a4daaef..10602ee7 100644 --- a/include/lttng/ust-ctl.h +++ b/include/lttng/ust-ctl.h @@ -2,19 +2,18 @@ * Copyright (C) 2011 - Julien Desfossez * Mathieu Desnoyers * - * 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; only version 2 - * of the License. + * 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; version 2 of the License only. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * 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_UST_CTL_H diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index f1ef8c91..65f50236 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -4,18 +4,19 @@ /* * lttng/ust-events.h * - * Copyright 2010 (c) - Mathieu Desnoyers + * Copyright 2010-2012 (c) - Mathieu Desnoyers * * Holds LTTng per-session event registry. * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/ust-tracepoint-event-reset.h b/include/lttng/ust-tracepoint-event-reset.h index 43ea1342..31a533d5 100644 --- a/include/lttng/ust-tracepoint-event-reset.h +++ b/include/lttng/ust-tracepoint-event-reset.h @@ -1,14 +1,15 @@ /* * Copyright (c) 2011 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ /* Define to "nothing" all macros used for TRACEPOINT_EVENT */ diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 1dffd946..520f8c06 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -1,14 +1,15 @@ /* - * Copyright (c) 2011 - Mathieu Desnoyers + * Copyright (c) 2011-2012 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/ust-tracer.h b/include/lttng/ust-tracer.h index 205af942..7b371953 100644 --- a/include/lttng/ust-tracer.h +++ b/include/lttng/ust-tracer.h @@ -6,14 +6,17 @@ * * This contains the core definitions for the Linux Trace Toolkit. * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Copyright 2011-2012 - Mathieu Desnoyers * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/include/lttng/ust.h b/include/lttng/ust.h index 05f262be..a7d67f59 100644 --- a/include/lttng/ust.h +++ b/include/lttng/ust.h @@ -2,16 +2,17 @@ #define _LTTNG_UST_H /* - * Copyright (c) 2011 - Mathieu Desnoyers + * Copyright (c) 2011-2012 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #ifdef __cplusplus diff --git a/include/share.h b/include/share.h index 19644f12..4abd7b15 100644 --- a/include/share.h +++ b/include/share.h @@ -4,14 +4,15 @@ /* * Copyright (c) 2011 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/liblttng-ust-comm/lttng-ust-comm.c b/liblttng-ust-comm/lttng-ust-comm.c index 9baa4dc5..078b56a0 100644 --- a/liblttng-ust-comm/lttng-ust-comm.c +++ b/liblttng-ust-comm/lttng-ust-comm.c @@ -258,7 +258,7 @@ ssize_t ustcomm_recv_unix_sock(int sock, void *buf, size_t len) do { ret = recvmsg(sock, &msg, 0); } while (ret < 0 && errno == EINTR); - if (ret < 0) { + if (ret < 0 && errno != EPIPE) { perror("recvmsg"); } @@ -291,8 +291,10 @@ ssize_t ustcomm_send_unix_sock(int sock, void *buf, size_t len) * by ignoring SIGPIPE, but we don't have this luxury on the * libust side. */ - ret = sendmsg(sock, &msg, MSG_NOSIGNAL); - if (ret < 0) { + do { + ret = sendmsg(sock, &msg, MSG_NOSIGNAL); + } while (ret < 0 && errno == EINTR); + if (ret < 0 && errno != EPIPE) { perror("sendmsg"); } @@ -308,10 +310,9 @@ int ustcomm_close_unix_sock(int sock) { int ret; - /* Shutdown receptions and transmissions */ - ret = shutdown(sock, SHUT_RDWR); + ret = close(sock); if (ret < 0) { - perror("shutdown"); + perror("close"); } return ret; @@ -355,8 +356,10 @@ ssize_t ustcomm_send_fds_unix_sock(int sock, void *buf, int *fds, size_t nb_fd, msg.msg_iov = iov; msg.msg_iovlen = 1; - ret = sendmsg(sock, &msg, 0); - if (ret < 0) { + do { + ret = sendmsg(sock, &msg, MSG_NOSIGNAL); + } while (ret < 0 && errno == EINTR); + if (ret < 0 && errno != EPIPE) { perror("sendmsg"); } @@ -475,7 +478,9 @@ int ustcomm_recv_fd(int sock) ret = recvmsg(sock, &msg, 0); } while (ret < 0 && errno == EINTR); if (ret < 0) { - perror("recvmsg"); + if (errno != EPIPE) { + perror("recvmsg"); + } goto end; } if (ret != sizeof(data_fd)) { diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 5a025f2a..e4a29f99 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -2,19 +2,18 @@ * Copyright (C) 2011 - Julien Desfossez * Mathieu Desnoyers * - * 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; only version 2 - * of the License. + * 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; version 2 of the License only. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * 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. */ #define _GNU_SOURCE diff --git a/liblttng-ust-java/LTTNG_UST.c b/liblttng-ust-java/LTTNG_UST.c index 60514970..af29c1e9 100644 --- a/liblttng-ust-java/LTTNG_UST.c +++ b/liblttng-ust-java/LTTNG_UST.c @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2011-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 #define TRACEPOINT_DEFINE diff --git a/liblttng-ust-java/LTTNG_UST.java b/liblttng-ust-java/LTTNG_UST.java index 33fa73aa..7ec61103 100644 --- a/liblttng-ust-java/LTTNG_UST.java +++ b/liblttng-ust-java/LTTNG_UST.java @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2011-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 + */ + class LTTNG_UST { public static native void lttng_ust_java_string(String name, String arg); static { diff --git a/liblttng-ust-libc-wrapper/ust_libc.h b/liblttng-ust-libc-wrapper/ust_libc.h index b40548fd..87c3fc67 100644 --- a/liblttng-ust-libc-wrapper/ust_libc.h +++ b/liblttng-ust-libc-wrapper/ust_libc.h @@ -11,14 +11,15 @@ extern "C" { /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/liblttng-ust/compat.h b/liblttng-ust/compat.h index 004e60ac..58d8585c 100644 --- a/liblttng-ust/compat.h +++ b/liblttng-ust/compat.h @@ -2,16 +2,21 @@ #define _UST_COMPAT_H /* - * Copyright (C) 2011 Mathieu Desnoyers + * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * 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. * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * 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 */ /* diff --git a/liblttng-ust/ltt-context.c b/liblttng-ust/ltt-context.c index 70578a26..16894ec1 100644 --- a/liblttng-ust/ltt-context.c +++ b/liblttng-ust/ltt-context.c @@ -1,13 +1,26 @@ /* - * ltt-context.c - * - * Copyright 2011 (c) - Mathieu Desnoyers + * lttng-context.c * * LTTng UST trace/channel/event context management. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2011 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 #include #include diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index ac2b20f7..aafa126c 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -1,11 +1,23 @@ /* * ltt-events.c * - * Copyright 2010 (c) - Mathieu Desnoyers - * * Holds LTTng per-session event registry. * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #define _GNU_SOURCE @@ -167,20 +179,20 @@ int add_pending_probe(struct ltt_event *event, const char *name, { struct cds_hlist_head *head; struct ust_pending_probe *e; - size_t name_len = strlen(name); + size_t name_len = strlen(name) + 1; uint32_t hash; - if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) { - WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1); - name_len = LTTNG_UST_SYM_NAME_LEN - 1; + if (name_len > LTTNG_UST_SYM_NAME_LEN) { + WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN); + name_len = LTTNG_UST_SYM_NAME_LEN; } - hash = jhash(name, name_len, 0); + hash = jhash(name, name_len - 1, 0); head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)]; e = zmalloc(sizeof(struct ust_pending_probe) + name_len); if (!e) return -ENOMEM; - memcpy(&e->name[0], name, name_len + 1); - e->name[name_len] = '\0'; + memcpy(&e->name[0], name, name_len); + e->name[name_len - 1] = '\0'; e->loglevel_type = loglevel_type; e->loglevel = loglevel; cds_hlist_add_head(&e->node, head); @@ -216,7 +228,7 @@ int pending_probe_fix_events(const struct lttng_event_desc *desc) const char *name = desc->name; int ret = 0; struct lttng_ust_event event_param; - size_t name_len = strlen(name); + size_t name_len = strlen(name) + 1; uint32_t hash; /* Wildcard */ @@ -251,11 +263,11 @@ int pending_probe_fix_events(const struct lttng_event_desc *desc) } } - if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) { - WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1); - name_len = LTTNG_UST_SYM_NAME_LEN - 1; + if (name_len > LTTNG_UST_SYM_NAME_LEN) { + WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN); + name_len = LTTNG_UST_SYM_NAME_LEN; } - hash = jhash(name, name_len, 0); + hash = jhash(name, name_len - 1, 0); head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)]; cds_hlist_for_each_entry_safe(e, node, p, head, node) { struct ltt_event *event; @@ -1078,7 +1090,7 @@ uint64_t measure_clock_offset(void) return 0; monotonic[1] = trace_clock_read64(); offset = (monotonic[0] + monotonic[1]) >> 1; - realtime = rts.tv_sec * 1000000000ULL; + realtime = (uint64_t) rts.tv_sec * 1000000000ULL; realtime += rts.tv_nsec; offset = realtime - offset; return offset; @@ -1347,6 +1359,8 @@ struct session_wildcard *add_wildcard(struct ltt_channel *chan, if (!e) return ERR_PTR(-ENOMEM); memcpy(&e->name[0], event_param->name, name_len); + e->loglevel_type = event_param->loglevel_type; + e->loglevel = event_param->loglevel; cds_list_add(&e->list, &wildcard_list); CDS_INIT_LIST_HEAD(&e->session_list); } diff --git a/liblttng-ust/ltt-probes.c b/liblttng-ust/ltt-probes.c index 0de5c6a4..02df21b2 100644 --- a/liblttng-ust/ltt-probes.c +++ b/liblttng-ust/ltt-probes.c @@ -1,11 +1,23 @@ /* * ltt-probes.c * - * Copyright 2010 (c) - Mathieu Desnoyers - * * Holds LTTng probes registry. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright 2010-2012 (c) - 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 diff --git a/liblttng-ust/ltt-ring-buffer-client-discard.c b/liblttng-ust/ltt-ring-buffer-client-discard.c index a551ef9a..416984d4 100644 --- a/liblttng-ust/ltt-ring-buffer-client-discard.c +++ b/liblttng-ust/ltt-ring-buffer-client-discard.c @@ -1,11 +1,23 @@ /* * ltt-ring-buffer-client-discard.c * - * Copyright (C) 2010 - Mathieu Desnoyers - * * LTTng lib ring buffer client (discard mode). * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #define _GNU_SOURCE diff --git a/liblttng-ust/ltt-ring-buffer-client-overwrite.c b/liblttng-ust/ltt-ring-buffer-client-overwrite.c index 27693a26..de9d613a 100644 --- a/liblttng-ust/ltt-ring-buffer-client-overwrite.c +++ b/liblttng-ust/ltt-ring-buffer-client-overwrite.c @@ -1,11 +1,23 @@ /* * ltt-ring-buffer-client-overwrite.c * - * Copyright (C) 2010 - Mathieu Desnoyers - * * LTTng lib ring buffer client (overwrite mode). * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #define _GNU_SOURCE diff --git a/liblttng-ust/ltt-ring-buffer-client.h b/liblttng-ust/ltt-ring-buffer-client.h index cedbc31d..f18b4ed3 100644 --- a/liblttng-ust/ltt-ring-buffer-client.h +++ b/liblttng-ust/ltt-ring-buffer-client.h @@ -1,11 +1,23 @@ /* * ltt-ring-buffer-client.h * - * Copyright (C) 2010 - Mathieu Desnoyers - * * LTTng lib ring buffer client template. * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #include @@ -355,11 +367,8 @@ static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t ts header->ctx.timestamp_end = tsc; header->ctx.content_size = data_size * CHAR_BIT; /* in bits */ header->ctx.packet_size = PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */ - /* - * We do not care about the records lost count, because the metadata - * channel waits and retry. - */ - (void) lib_ring_buffer_get_records_lost_full(&client_config, buf); + + records_lost += lib_ring_buffer_get_records_lost_full(&client_config, buf); records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, buf); records_lost += lib_ring_buffer_get_records_lost_big(&client_config, buf); header->ctx.events_discarded = records_lost; diff --git a/liblttng-ust/ltt-ring-buffer-metadata-client.c b/liblttng-ust/ltt-ring-buffer-metadata-client.c index 9cf4c579..cc72a7fe 100644 --- a/liblttng-ust/ltt-ring-buffer-metadata-client.c +++ b/liblttng-ust/ltt-ring-buffer-metadata-client.c @@ -1,11 +1,23 @@ /* * ltt-ring-buffer-metadata-client.c * - * Copyright (C) 2010 - Mathieu Desnoyers - * * LTTng lib ring buffer metadta client. * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #define _GNU_SOURCE diff --git a/liblttng-ust/ltt-ring-buffer-metadata-client.h b/liblttng-ust/ltt-ring-buffer-metadata-client.h index dcbaacb6..acc56fdd 100644 --- a/liblttng-ust/ltt-ring-buffer-metadata-client.h +++ b/liblttng-ust/ltt-ring-buffer-metadata-client.h @@ -1,11 +1,23 @@ /* * ltt-ring-buffer-client.h * - * Copyright (C) 2010 - Mathieu Desnoyers - * * LTTng lib ring buffer client template. * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #include @@ -119,7 +131,11 @@ static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t ts header->content_size = data_size * CHAR_BIT; /* in bits */ header->packet_size = PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */ - records_lost += lib_ring_buffer_get_records_lost_full(&client_config, buf); + /* + * We do not care about the records lost count, because the metadata + * channel waits and retry. + */ + (void) lib_ring_buffer_get_records_lost_full(&client_config, buf); records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, buf); records_lost += lib_ring_buffer_get_records_lost_big(&client_config, buf); WARN_ON_ONCE(records_lost != 0); diff --git a/liblttng-ust/lttng-context-procname.c b/liblttng-ust/lttng-context-procname.c index b737084b..d165be88 100644 --- a/liblttng-ust/lttng-context-procname.c +++ b/liblttng-ust/lttng-context-procname.c @@ -1,10 +1,23 @@ /* - * (C) Copyright 2009-2011 - - * Mathieu Desnoyers + * lttng-context-procname.c * * LTTng UST procname context. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2009-2011 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 diff --git a/liblttng-ust/lttng-context-pthread-id.c b/liblttng-ust/lttng-context-pthread-id.c index 62eda808..44c60c3a 100644 --- a/liblttng-ust/lttng-context-pthread-id.c +++ b/liblttng-ust/lttng-context-pthread-id.c @@ -1,10 +1,23 @@ /* - * (C) Copyright 2009-2011 - - * Mathieu Desnoyers + * lttng-context-pthread-id.c * * LTTng UST pthread_id context. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2009-2011 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 diff --git a/liblttng-ust/lttng-context-vpid.c b/liblttng-ust/lttng-context-vpid.c index db76747a..fdf68fb1 100644 --- a/liblttng-ust/lttng-context-vpid.c +++ b/liblttng-ust/lttng-context-vpid.c @@ -1,10 +1,23 @@ /* - * (C) Copyright 2009-2011 - - * Mathieu Desnoyers + * lttng-context-vpid.c * * LTTng UST vpid context. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2009-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 diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c index c419d18b..81508515 100644 --- a/liblttng-ust/lttng-context-vtid.c +++ b/liblttng-ust/lttng-context-vtid.c @@ -1,10 +1,23 @@ /* - * (C) Copyright 2009-2011 - - * Mathieu Desnoyers + * lttng-context-vtid.c * * LTTng UST vtid context. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2009-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 diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index deb3311b..435763d7 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -1,10 +1,25 @@ /* * lttng-ust-abi.c * - * Copyright 2010-2011 (c) - Mathieu Desnoyers - * * LTTng UST 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 an object descriptor or failure. * - channel creation, returns an object 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 diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 1815801a..099a6c85 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -391,7 +391,7 @@ void cleanup_sock_info(struct sock_info *sock_info, int exiting) int ret; if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing apps socket"); } @@ -671,7 +671,7 @@ restart: } if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing %s apps socket", sock_info->name); } diff --git a/liblttng-ust/probes/lttng-probe-ust.c b/liblttng-ust/probes/lttng-probe-ust.c index a5594c95..2f83e28c 100644 --- a/liblttng-ust/probes/lttng-probe-ust.c +++ b/liblttng-ust/probes/lttng-probe-ust.c @@ -1,11 +1,23 @@ /* * probes/lttng-probe-ust.c * - * Copyright 2010 (c) - Mathieu Desnoyers - * * LTTng UST core probes. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright 2010-2012 (c) - 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 */ #define TRACEPOINT_DEFINE diff --git a/libringbuffer/api.h b/libringbuffer/api.h index 25474e77..2ceae504 100644 --- a/libringbuffer/api.h +++ b/libringbuffer/api.h @@ -1,14 +1,26 @@ -#ifndef _LINUX_RING_BUFFER_API_H -#define _LINUX_RING_BUFFER_API_H +#ifndef _LTTNG_RING_BUFFER_API_H +#define _LTTNG_RING_BUFFER_API_H /* - * linux/ringbuffer/api.h - * - * Copyright (C) 2010 - Mathieu Desnoyers "mathieu.desnoyers@efficios.com" + * libringbuffer/api.h * * Ring Buffer API. * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #include "backend.h" @@ -22,4 +34,4 @@ */ #include "frontend_api.h" -#endif /* _LINUX_RING_BUFFER_API_H */ +#endif /* _LTTNG_RING_BUFFER_API_H */ diff --git a/libringbuffer/backend.h b/libringbuffer/backend.h index d4824d63..125d0a50 100644 --- a/libringbuffer/backend.h +++ b/libringbuffer/backend.h @@ -1,14 +1,26 @@ -#ifndef _LINUX_RING_BUFFER_BACKEND_H -#define _LINUX_RING_BUFFER_BACKEND_H +#ifndef _LTTNG_RING_BUFFER_BACKEND_H +#define _LTTNG_RING_BUFFER_BACKEND_H /* - * linux/ringbuffer/backend.h - * - * Copyright (C) 2008-2010 - Mathieu Desnoyers + * libringbuffer/backend.h * * Ring buffer backend (API). * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2011-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 * * Credits to Steven Rostedt for proposing to use an extra-subbuffer owned by * the reader in flight recorder mode. @@ -122,4 +134,4 @@ unsigned long lib_ring_buffer_get_records_unread( return records_unread; } -#endif /* _LINUX_RING_BUFFER_BACKEND_H */ +#endif /* _LTTNG_RING_BUFFER_BACKEND_H */ diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index c9ed81be..050c98ac 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -1,14 +1,26 @@ -#ifndef _LINUX_RING_BUFFER_BACKEND_INTERNAL_H -#define _LINUX_RING_BUFFER_BACKEND_INTERNAL_H +#ifndef _LTTNG_RING_BUFFER_BACKEND_INTERNAL_H +#define _LTTNG_RING_BUFFER_BACKEND_INTERNAL_H /* - * linux/ringbuffer/backend_internal.h - * - * Copyright (C) 2008-2010 - Mathieu Desnoyers + * libringbuffer/backend_internal.h * * Ring buffer backend (internal helpers). * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2005-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 @@ -475,20 +487,4 @@ static inline int get_count_order(unsigned int count) return order; } -static inline -unsigned int hweight32(unsigned int value) -{ - unsigned int r; - - r = value; - r = r - ((r >> 1) & 0x55555555); - r = (r & 0x33333333) + ((r >> 2) & 0x33333333); - r += r >> 4; - r &= 0x0F0F0F0F; - r += r >> 8; - r += r >> 16; - r &= 0x000000FF; - return r; -} - -#endif /* _LINUX_RING_BUFFER_BACKEND_INTERNAL_H */ +#endif /* _LTTNG_RING_BUFFER_BACKEND_INTERNAL_H */ diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index 81e67119..a53fb322 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -1,14 +1,26 @@ -#ifndef _LINUX_RING_BUFFER_BACKEND_TYPES_H -#define _LINUX_RING_BUFFER_BACKEND_TYPES_H +#ifndef _LTTNG_RING_BUFFER_BACKEND_TYPES_H +#define _LTTNG_RING_BUFFER_BACKEND_TYPES_H /* * linux/ringbuffer/backend_types.h * - * Copyright (C) 2008-2010 - Mathieu Desnoyers - * * 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 @@ -84,4 +96,4 @@ struct channel_backend { struct lttng_ust_lib_ring_buffer_shmp buf[]; }; -#endif /* _LINUX_RING_BUFFER_BACKEND_TYPES_H */ +#endif /* _LTTNG_RING_BUFFER_BACKEND_TYPES_H */ diff --git a/libringbuffer/frontend.h b/libringbuffer/frontend.h index ce79cdee..b1ccddec 100644 --- a/libringbuffer/frontend.h +++ b/libringbuffer/frontend.h @@ -1,19 +1,32 @@ -#ifndef _LINUX_RING_BUFFER_FRONTEND_H -#define _LINUX_RING_BUFFER_FRONTEND_H +#ifndef _LTTNG_RING_BUFFER_FRONTEND_H +#define _LTTNG_RING_BUFFER_FRONTEND_H /* - * linux/ringbuffer/frontend.h - * - * (C) Copyright 2005-2010 - Mathieu Desnoyers + * libringbuffer/frontend.h * * Ring Buffer Library Synchronization Header (API). * + * Copyright (C) 2005-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 + * + * * Author: * Mathieu Desnoyers * * See ring_buffer_frontend.c for more information on wait-free algorithms. - * - * Dual LGPL v2.1/GPL v2 license. */ #include @@ -244,4 +257,4 @@ unsigned long lib_ring_buffer_get_records_read( return v_read(config, &buf->backend.records_read); } -#endif /* _LINUX_RING_BUFFER_FRONTEND_H */ +#endif /* _LTTNG_RING_BUFFER_FRONTEND_H */ diff --git a/libringbuffer/frontend_api.h b/libringbuffer/frontend_api.h index 49f6e4c2..6a06bba2 100644 --- a/libringbuffer/frontend_api.h +++ b/libringbuffer/frontend_api.h @@ -1,20 +1,33 @@ -#ifndef _LINUX_RING_BUFFER_FRONTEND_API_H -#define _LINUX_RING_BUFFER_FRONTEND_API_H +#ifndef _LTTNG_RING_BUFFER_FRONTEND_API_H +#define _LTTNG_RING_BUFFER_FRONTEND_API_H /* - * linux/ringbuffer/frontend_api.h + * libringbuffer/frontend_api.h * - * (C) Copyright 2005-2010 - Mathieu Desnoyers + * Copyright (C) 2005-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 * * Ring Buffer Library Synchronization Header (buffer write API). * * Author: - * Mathieu Desnoyers - * - * See ring_buffer_frontend.c for more information on wait-free algorithms. - * See linux/ringbuffer/frontend.h for channel allocation and read-side API. + * Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * See ring_buffer_frontend.c for more information on wait-free + * algorithms. + * See frontend.h for channel allocation and read-side API. */ #include "frontend.h" @@ -351,4 +364,4 @@ void lib_ring_buffer_record_enable(const struct lttng_ust_lib_ring_buffer_config uatomic_dec(&buf->record_disabled); } -#endif /* _LINUX_RING_BUFFER_FRONTEND_API_H */ +#endif /* _LTTNG_RING_BUFFER_FRONTEND_API_H */ diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index aa7876e8..6d1a75bd 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -1,13 +1,28 @@ -#ifndef _LINUX_RING_BUFFER_FRONTEND_INTERNAL_H -#define _LINUX_RING_BUFFER_FRONTEND_INTERNAL_H +#ifndef _LTTNG_RING_BUFFER_FRONTEND_INTERNAL_H +#define _LTTNG_RING_BUFFER_FRONTEND_INTERNAL_H /* - * linux/ringbuffer/frontend_internal.h - * - * (C) Copyright 2005-2010 - Mathieu Desnoyers + * libringbuffer/frontend_internal.h * * Ring Buffer Library Synchronization Header (internal helpers). * + * Copyright (C) 2005-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 + * + * * Author: * Mathieu Desnoyers * @@ -462,4 +477,4 @@ extern void lib_ring_buffer_free(struct lttng_ust_lib_ring_buffer *buf, /* Keep track of trap nesting inside ring buffer code */ extern __thread unsigned int lib_ring_buffer_nesting; -#endif /* _LINUX_RING_BUFFER_FRONTEND_INTERNAL_H */ +#endif /* _LTTNG_RING_BUFFER_FRONTEND_INTERNAL_H */ diff --git a/libringbuffer/frontend_types.h b/libringbuffer/frontend_types.h index 1d47b275..37fabad3 100644 --- a/libringbuffer/frontend_types.h +++ b/libringbuffer/frontend_types.h @@ -1,19 +1,31 @@ -#ifndef _LINUX_RING_BUFFER_FRONTEND_TYPES_H -#define _LINUX_RING_BUFFER_FRONTEND_TYPES_H +#ifndef _LTTNG_RING_BUFFER_FRONTEND_TYPES_H +#define _LTTNG_RING_BUFFER_FRONTEND_TYPES_H /* - * linux/ringbuffer/frontend_types.h - * - * (C) Copyright 2005-2010 - Mathieu Desnoyers + * libringbuffer/frontend_types.h * * Ring Buffer Library Synchronization Header (types). * + * Copyright (C) 2005-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 + * * Author: * Mathieu Desnoyers * * See ring_buffer_frontend.c for more information on wait-free algorithms. - * - * Dual LGPL v2.1/GPL v2 license. */ #include @@ -153,4 +165,4 @@ void *channel_get_private(struct channel *chan) _____ret; \ }) -#endif /* _LINUX_RING_BUFFER_FRONTEND_TYPES_H */ +#endif /* _LTTNG_RING_BUFFER_FRONTEND_TYPES_H */ diff --git a/libringbuffer/getcpu.h b/libringbuffer/getcpu.h index 3474bfe0..0a619417 100644 --- a/libringbuffer/getcpu.h +++ b/libringbuffer/getcpu.h @@ -21,7 +21,7 @@ #include -#ifdef UST_VALGRIND +#ifdef LTTNG_UST_DEBUG_VALGRIND /* * Fallback on cpu 0 if liblttng-ust is build with Valgrind support. diff --git a/libringbuffer/nohz.h b/libringbuffer/nohz.h index 3c310725..28334310 100644 --- a/libringbuffer/nohz.h +++ b/libringbuffer/nohz.h @@ -1,12 +1,24 @@ -#ifndef _LINUX_RING_BUFFER_NOHZ_H -#define _LINUX_RING_BUFFER_NOHZ_H +#ifndef _LTTNG_RING_BUFFER_NOHZ_H +#define _LTTNG_RING_BUFFER_NOHZ_H /* - * ringbuffer/nohz.h + * libringbuffer/nohz.h * - * Copyright (C) 2011 Mathieu Desnoyers + * Copyright (C) 2011-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #ifdef CONFIG_LIB_RING_BUFFER @@ -27,4 +39,4 @@ static inline void lib_ring_buffer_tick_nohz_restart(void) } #endif -#endif /* _LINUX_RING_BUFFER_NOHZ_H */ +#endif /* _LTTNG_RING_BUFFER_NOHZ_H */ diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index 769e24bf..ae836522 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -1,9 +1,21 @@ /* * ring_buffer_backend.c * - * Copyright (C) 2005-2010 - Mathieu Desnoyers + * Copyright (C) 2005-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #define _GNU_SOURCE @@ -210,19 +222,17 @@ int channel_backend_init(struct channel_backend *chanb, if (!name) return -EPERM; - if (!(subbuf_size && num_subbuf)) - return -EPERM; - /* Check that the subbuffer size is larger than a page. */ if (subbuf_size < PAGE_SIZE) return -EINVAL; /* - * Make sure the number of subbuffers and subbuffer size are power of 2. + * Make sure the number of subbuffers and subbuffer size are + * power of 2, and nonzero. */ - if (hweight32(subbuf_size) != 1) + if (!subbuf_size || (subbuf_size & (subbuf_size - 1))) return -EINVAL; - if (hweight32(num_subbuf) != 1) + if (!num_subbuf || (num_subbuf & (num_subbuf - 1))) return -EINVAL; ret = subbuffer_id_check_index(config, num_subbuf); diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 728cbf9b..d1704dbf 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -1,7 +1,22 @@ /* * ring_buffer_frontend.c * - * (C) Copyright 2005-2010 - Mathieu Desnoyers + * Copyright (C) 2005-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 + * * * Ring buffer wait-free buffer synchronization. Producer-consumer and flight * recorder (overwrite) modes. See thesis: @@ -34,8 +49,6 @@ * - splice one subbuffer worth of data to a pipe * - splice the data from pipe to disk/network * - put_subbuf - * - * Dual LGPL v2.1/GPL v2 license. */ #define _GNU_SOURCE diff --git a/libringbuffer/shm.c b/libringbuffer/shm.c index c10e58a2..d1e50449 100644 --- a/libringbuffer/shm.c +++ b/libringbuffer/shm.c @@ -1,9 +1,21 @@ /* * libringbuffer/shm.c * - * Copyright 2011 (c) - Mathieu Desnoyers + * Copyright (C) 2005-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 "shm.h" diff --git a/libringbuffer/shm.h b/libringbuffer/shm.h index 104eece6..8987f72a 100644 --- a/libringbuffer/shm.h +++ b/libringbuffer/shm.h @@ -4,9 +4,21 @@ /* * libringbuffer/shm.h * - * Copyright 2011 (c) - Mathieu Desnoyers + * Copyright (C) 2011-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 diff --git a/libringbuffer/shm_internal.h b/libringbuffer/shm_internal.h index 77f345d3..06a47ab6 100644 --- a/libringbuffer/shm_internal.h +++ b/libringbuffer/shm_internal.h @@ -4,9 +4,21 @@ /* * libringbuffer/shm_internal.h * - * Copyright 2011 (c) - Mathieu Desnoyers + * Copyright (C) 2011-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ struct shm_ref { diff --git a/libringbuffer/shm_types.h b/libringbuffer/shm_types.h index 08226bdd..8b01d803 100644 --- a/libringbuffer/shm_types.h +++ b/libringbuffer/shm_types.h @@ -4,9 +4,21 @@ /* * libringbuffer/shm_types.h * - * Copyright 2011 (c) - Mathieu Desnoyers + * Copyright (C) 2011-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 diff --git a/libringbuffer/smp.c b/libringbuffer/smp.c index 9bf5da19..410e4c18 100644 --- a/libringbuffer/smp.c +++ b/libringbuffer/smp.c @@ -1,9 +1,21 @@ /* * libringbuffer/smp.c * - * Copyright 2011 (c) - Mathieu Desnoyers + * Copyright (C) 2011-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #define _GNU_SOURCE diff --git a/libringbuffer/smp.h b/libringbuffer/smp.h index 034058e9..479a9dc6 100644 --- a/libringbuffer/smp.h +++ b/libringbuffer/smp.h @@ -4,9 +4,21 @@ /* * libringbuffer/smp.h * - * Copyright 2011 (c) - Mathieu Desnoyers + * Copyright (C) 2011-2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 "getcpu.h" diff --git a/libringbuffer/tlsfixup.h b/libringbuffer/tlsfixup.h index 84ba889e..125742ef 100644 --- a/libringbuffer/tlsfixup.h +++ b/libringbuffer/tlsfixup.h @@ -4,9 +4,21 @@ /* * libringbuffer/tlsfixup.h * - * Copyright 2011 (c) - Mathieu Desnoyers + * Copyright (C) 2012 Mathieu Desnoyers * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ void lttng_fixup_ringbuffer_tls(void); diff --git a/libringbuffer/vatomic.h b/libringbuffer/vatomic.h index 29bb67d7..900b9b95 100644 --- a/libringbuffer/vatomic.h +++ b/libringbuffer/vatomic.h @@ -1,19 +1,20 @@ -#ifndef _LINUX_RING_BUFFER_VATOMIC_H -#define _LINUX_RING_BUFFER_VATOMIC_H +#ifndef _LTTNG_RING_BUFFER_VATOMIC_H +#define _LTTNG_RING_BUFFER_VATOMIC_H /* - * linux/ringbuffer/vatomic.h + * libringbuffer/vatomic.h * - * Copyright (C) 2010 - Mathieu Desnoyers + * Copyright (C) 2010-2012 - Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include @@ -78,4 +79,4 @@ long v_cmpxchg(const struct lttng_ust_lib_ring_buffer_config *config, union v_at return uatomic_cmpxchg(&v_a->a, old, _new); } -#endif /* _LINUX_RING_BUFFER_VATOMIC_H */ +#endif /* _LTTNG_RING_BUFFER_VATOMIC_H */ diff --git a/tests/benchmark/bench.c b/tests/benchmark/bench.c index ce476f9b..212baeff 100644 --- a/tests/benchmark/bench.c +++ b/tests/benchmark/bench.c @@ -2,6 +2,22 @@ * bench.c * * LTTng Userspace Tracer (UST) - benchmark tool + * + * Copyright 2010 - Douglas Santos + * + * 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. */ #define _GNU_SOURCE diff --git a/tests/demo/tp.c b/tests/demo/tp.c index d65b66d9..288ce614 100644 --- a/tests/demo/tp.c +++ b/tests/demo/tp.c @@ -3,14 +3,15 @@ * * Copyright (c) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #define TRACEPOINT_CREATE_PROBES diff --git a/tests/demo/tp2.c b/tests/demo/tp2.c index 577e2e2d..718c9db2 100644 --- a/tests/demo/tp2.c +++ b/tests/demo/tp2.c @@ -3,14 +3,15 @@ * * Copyright (c) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #define TRACEPOINT_CREATE_PROBES diff --git a/tests/demo/tp3.c b/tests/demo/tp3.c index 80a0a33a..b1babc73 100644 --- a/tests/demo/tp3.c +++ b/tests/demo/tp3.c @@ -3,14 +3,15 @@ * * Copyright (c) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #define TRACEPOINT_CREATE_PROBES diff --git a/tests/demo/ust_tests_demo.h b/tests/demo/ust_tests_demo.h index 7740d98c..1b761f9f 100644 --- a/tests/demo/ust_tests_demo.h +++ b/tests/demo/ust_tests_demo.h @@ -11,14 +11,15 @@ extern "C" { /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/tests/demo/ust_tests_demo2.h b/tests/demo/ust_tests_demo2.h index a763e028..97a55a21 100644 --- a/tests/demo/ust_tests_demo2.h +++ b/tests/demo/ust_tests_demo2.h @@ -11,14 +11,15 @@ extern "C" { /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/tests/demo/ust_tests_demo3.h b/tests/demo/ust_tests_demo3.h index aaa5a0f8..338e7975 100644 --- a/tests/demo/ust_tests_demo3.h +++ b/tests/demo/ust_tests_demo3.h @@ -11,14 +11,15 @@ extern "C" { /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/tests/fork/ust_tests_fork.h b/tests/fork/ust_tests_fork.h index 3d7eb342..d8962c93 100644 --- a/tests/fork/ust_tests_fork.h +++ b/tests/fork/ust_tests_fork.h @@ -7,14 +7,15 @@ /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/tests/hello-static-lib/tp.c b/tests/hello-static-lib/tp.c index 71a01c81..1806b420 100644 --- a/tests/hello-static-lib/tp.c +++ b/tests/hello-static-lib/tp.c @@ -3,14 +3,15 @@ * * Copyright (c) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #define TRACEPOINT_CREATE_PROBES diff --git a/tests/hello-static-lib/ust_tests_hello.h b/tests/hello-static-lib/ust_tests_hello.h index a54bc595..8a4063f6 100644 --- a/tests/hello-static-lib/ust_tests_hello.h +++ b/tests/hello-static-lib/ust_tests_hello.h @@ -11,14 +11,15 @@ extern "C" { /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/tests/hello.cxx/tp.c b/tests/hello.cxx/tp.c index 71a01c81..1806b420 100644 --- a/tests/hello.cxx/tp.c +++ b/tests/hello.cxx/tp.c @@ -3,14 +3,15 @@ * * Copyright (c) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #define TRACEPOINT_CREATE_PROBES diff --git a/tests/hello.cxx/ust_tests_hello.h b/tests/hello.cxx/ust_tests_hello.h index 7ce547ed..e16fe469 100644 --- a/tests/hello.cxx/ust_tests_hello.h +++ b/tests/hello.cxx/ust_tests_hello.h @@ -7,14 +7,15 @@ /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/tests/hello/tp.c b/tests/hello/tp.c index 71a01c81..1806b420 100644 --- a/tests/hello/tp.c +++ b/tests/hello/tp.c @@ -3,14 +3,15 @@ * * Copyright (c) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #define TRACEPOINT_CREATE_PROBES diff --git a/tests/hello/ust_tests_hello.h b/tests/hello/ust_tests_hello.h index a54bc595..8a4063f6 100644 --- a/tests/hello/ust_tests_hello.h +++ b/tests/hello/ust_tests_hello.h @@ -11,14 +11,15 @@ extern "C" { /* * Copyright (C) 2011 Mathieu Desnoyers * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. */ #include diff --git a/tests/make_shared_lib/Makefile b/tests/make_shared_lib/Makefile deleted file mode 100644 index 5164ba92..00000000 --- a/tests/make_shared_lib/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -#all: libbasic.so prog libbasic-noscript.so prog_noscript -all: libbasic.so prog - -libbasic.so: basic_lib.o - gcc -g $(LDFLAGS) -fPIC -o libbasic.so -shared -lust basic_lib.o -libbasic-noscript.so: basic_lib_noscript.o - gcc -g $(LDFLAGS) -fPIC -o libbasic-noscript.so -shared basic_lib_noscript.o /usr/local/lib/libust.so.0 /usr/local/lib/libust-initializer.o - -basic_lib.o: basic_lib.c - gcc -g $(CFLAGS) -fPIC -c basic_lib.c -basic_lib_noscript.o: basic_lib.c - gcc -g -fPIC -o basic_lib_noscript.o -c basic_lib.c - -prog: prog.c - gcc -g $(CFLAGS) $(LDFLAGS) -o prog -L . -lbasic -lust prog.c -prog_noscript: prog.c - gcc -g -o prog_noscript -L . -lbasic-noscript prog.c /usr/local/lib/libust.so.0 /usr/local/lib/libust-initializer.o - -.PHONY: clean -clean: - rm -f basic_lib.o libbasic.so prog basic_lib_noscript.o libbasic-noscript.so diff --git a/tests/make_shared_lib/basic_lib.c b/tests/make_shared_lib/basic_lib.c deleted file mode 100644 index 4facd9dc..00000000 --- a/tests/make_shared_lib/basic_lib.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -void myfunc(void) -{ - ust_marker(in_lib, MARK_NOARGS); - printf("testfunc\n"); -} - -//UST_MARKER_LIB diff --git a/tests/make_shared_lib/prog.c b/tests/make_shared_lib/prog.c deleted file mode 100644 index 7b7357ad..00000000 --- a/tests/make_shared_lib/prog.c +++ /dev/null @@ -1,10 +0,0 @@ -#include - -extern myfunc(void); - -int main(void) -{ - myfunc(); - ust_marker(in_prog, MARK_NOARGS); - return 0; -} diff --git a/tests/tracepoint/tracepoint_test.h b/tests/tracepoint/tracepoint_test.h index bca4be2f..717fda7d 100644 --- a/tests/tracepoint/tracepoint_test.h +++ b/tests/tracepoint/tracepoint_test.h @@ -1,3 +1,20 @@ +/* + * Copyright 2010 - David Goulet + * + * 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. + */ #include DECLARE_TRACEPOINT(ust_event, TP_PROTO(unsigned int v), TP_VARS(v)); diff --git a/tests/ust-basic-tracing/ust-basic-tracing.c b/tests/ust-basic-tracing/ust-basic-tracing.c index 0705a48c..004974b5 100644 --- a/tests/ust-basic-tracing/ust-basic-tracing.c +++ b/tests/ust-basic-tracing/ust-basic-tracing.c @@ -4,18 +4,18 @@ * Copyright (C) 2011 - Mathieu Desnoyers * Copyright (C) 2011 - David Goulet * - * 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; only version 2 of the License. + * 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; version 2 of the License only. * - * 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. + * 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., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307, USA. + * 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. */ #define _LARGEFILE64_SOURCE diff --git a/tests/ust-multi-test/ust-multi-test.c b/tests/ust-multi-test/ust-multi-test.c index dc91b847..3f0cf1d5 100644 --- a/tests/ust-multi-test/ust-multi-test.c +++ b/tests/ust-multi-test/ust-multi-test.c @@ -4,18 +4,18 @@ * Copyright (C) 2011 - Mathieu Desnoyers * Copyright (C) 2011 - David Goulet * - * 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; only version 2 of the License. + * 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; version 2 of the License only. * - * 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. + * 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., 59 Temple - * Place - Suite 330, Boston, MA 02111-1307, USA. + * 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. */ #define _LARGEFILE64_SOURCE diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp index 828bee6e..03a85fcb 100755 --- a/tools/lttng-gen-tp +++ b/tools/lttng-gen-tp @@ -207,6 +207,8 @@ def main(argv=None): opts, args = getopt.gnu_getopt(argv[1:], "ho:a", ["help"]) except getopt.error, msg: raise Usage(msg) + if len(args) == 0: + raise Usage("No template file given") except Usage, err: print >>sys.stderr, err.msg @@ -256,28 +258,37 @@ def main(argv=None): # process arguments for arg in args: - tpl = TemplateFile(arg) - if doHeader: - if headerFilename: - curFilename = headerFilename - else: - curFilename = re.sub("\.tp$",".h",arg) - doth = HeaderFile(curFilename, tpl) - doth.write() - if doCFile: - if cFilename: - curFilename = cFilename - else: - curFilename = re.sub("\.tp$",".c",arg) - dotc = CFile(curFilename, tpl) - dotc.write() - if doObj: - if objFilename: - curFilename = objFilename - else: - curFilename = re.sub("\.tp$",".o",arg) - dotobj = ObjFile(curFilename, tpl) - dotobj.write() - + tpl = None + try: + tpl = TemplateFile(arg) + except IOError as args: + print "Cannot read input file " + args.filename + " " + args.strerror + return -1 + try: + if doHeader: + if headerFilename: + curFilename = headerFilename + else: + curFilename = re.sub("\.tp$",".h",arg) + doth = HeaderFile(curFilename, tpl) + doth.write() + if doCFile: + if cFilename: + curFilename = cFilename + else: + curFilename = re.sub("\.tp$",".c",arg) + dotc = CFile(curFilename, tpl) + dotc.write() + if doObj: + if objFilename: + curFilename = objFilename + else: + curFilename = re.sub("\.tp$",".o",arg) + dotobj = ObjFile(curFilename, tpl) + dotobj.write() + except IOError as args: + print "Cannot write output file " + args.filename + " " + args.strerror + return -1 + if __name__ == "__main__": sys.exit(main())