ust-fd: Add close_range declaration
[lttng-ust.git] / tools / lttng-gen-tp
index 4ab91f367057ebf89290bb101e22039c650fd009..e49083ba4dae4b8f2a82455cd5f6df9b6f4776f0 100755 (executable)
@@ -1,20 +1,8 @@
 #!/usr/bin/env python
 #
-# Copyright (c)  2012 Yannick Brosseau <yannick.brosseau@gmail.com>
+# SPDX-License-Identifier: GPL-2.0-only
 #
-# 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 distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# Copyright (C) 2012 Yannick Brosseau <yannick.brosseau@gmail.com>
 
 from __future__ import print_function
 import sys
@@ -31,13 +19,13 @@ class Usage(Exception):
 
 class HeaderFile:
     HEADER_TPL = """
-#undef TRACEPOINT_PROVIDER
-#define TRACEPOINT_PROVIDER {providerName}
+#undef LTTNG_UST_TRACEPOINT_PROVIDER
+#define LTTNG_UST_TRACEPOINT_PROVIDER {providerName}
 
-#undef TRACEPOINT_INCLUDE
-#define TRACEPOINT_INCLUDE "./{headerFilename}"
+#undef LTTNG_UST_TRACEPOINT_INCLUDE
+#define LTTNG_UST_TRACEPOINT_INCLUDE "./{headerFilename}"
 
-#if !defined({includeGuard}) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#if !defined({includeGuard}) || defined(LTTNG_UST_TRACEPOINT_HEADER_MULTI_READ)
 #define {includeGuard}
 
 #include <lttng/tracepoint.h>
@@ -69,11 +57,11 @@ class HeaderFile:
 
 class CFile:
     FILE_TPL = """
-#define TRACEPOINT_CREATE_PROBES
+#define LTTNG_UST_TRACEPOINT_CREATE_PROBES
 /*
- * The header containing our TRACEPOINT_EVENTs.
+ * The header containing our LTTNG_UST_TRACEPOINT_EVENTs.
  */
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
 #include "{headerFilename}"
 """
 
@@ -150,12 +138,8 @@ class ObjFile:
             cflags = " " + os.environ['CFLAGS']
         else:
             cflags = ""
-        if 'LDFLAGS' in os.environ:
-            ldflags = " " + os.environ['LDFLAGS']
-        else:
-            ldflags = ""
 
-        command = cc + " -c" + cppflags + cflags + ldflags + " -I. -llttng-ust" + " -o " + self.outputFilename + " " + cFilename
+        command = cc + " -c" + cppflags + cflags + " -I. -o " + self.outputFilename + " " + cFilename
         if verbose:
             print("Compile command: " + command)
         subprocess.call(command.split())
@@ -186,7 +170,7 @@ class TemplateFile:
         cleantext = re.sub("\s*", "", nolinecomment)
         # Remove multine C style comments
         nocomment = re.sub("/\*.*?\*/", "", cleantext)
-        entries = re.split("TRACEPOINT_.*?", nocomment)
+        entries = re.split("^LTTNG_UST_TRACEPOINT_.*?", nocomment)
 
         for entry in entries:
             if entry != '':
@@ -216,7 +200,7 @@ usage = """
  When using the -o option, the OUTPUT_FILE must end with either .h, .c or .o
  The -o option can be repeated multiple times.
 
- The template file must contains TRACEPOINT_EVENT and TRACEPOINT_LOGLEVEL
+ The template file must contains LTTNG_UST_TRACEPOINT_EVENT and LTTNG_UST_TRACEPOINT_LOGLEVEL
  as per defined in the lttng/tracepoint.h file.
  See the lttng-ust(3) man page for more details on the format.
 """
This page took 0.023957 seconds and 4 git commands to generate.