#undef TRACEPOINT_PROVIDER
#define TRACEPOINT_PROVIDER {providerName}
-#undef TRACEPOINT_INCLUDE_FILE
-#define TRACEPOINT_INCLUDE_FILE ./{headerFilename}
-
-#ifdef __cplusplus
-extern "C"{{
-#endif /* __cplusplus */
-
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "./{headerFilename}"
#if !defined({includeGuard}) || defined(TRACEPOINT_HEADER_MULTI_READ)
#define {includeGuard}
#endif /* {includeGuard} */
#include <lttng/tracepoint-event.h>
-
-#ifdef __cplusplus
-}}
-#endif /* __cplusplus */
-
"""
def __init__(self, filename, template):
self.outputFilename = filename
def write(self):
outputFile = open(self.outputFilename,"w")
- includeGuard = self.outputFilename.upper().replace(".","_")
+ # Include guard macro will be created by uppercasing the filename and
+ # replacing all non alphanumeric characters with '_'
+ includeGuard = re.sub('[^0-9a-zA-Z]', '_', self.outputFilename.upper())
outputFile.write(HeaderFile.HEADER_TPL.format(providerName=self.template.domain,
includeGuard = includeGuard,
# process arguments
for arg in args:
+ if arg[-3:] != ".tp":
+ print arg + " does not end in .tp. Skipping."
+ continue
tpl = None
try: