[lttng-dev] [PATCH] lttng-gen-tp: remove support for # comments
Yannick Brosseau
yannick.brosseau at gmail.com
Tue Jun 18 15:38:23 EDT 2013
On 2013-06-18 13:49, Romain Lenglet wrote:
> Support #define, #include, etc. in tracepoint files.
Do you have a specific use case that demonstrate the need for that?
The design goal of lttng-gen-tp included generating tracepoints for
other language than C, so we wanted a format more agnostics hence the
support for # comments
> Signed-off-by: Romain Lenglet <romain.lenglet at berabera.info>
> ---
> doc/man/lttng-gen-tp.1 | 2 +-
> tools/lttng-gen-tp | 3 ---
> 2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/doc/man/lttng-gen-tp.1 b/doc/man/lttng-gen-tp.1
> index 84c05c9..96f02c4 100644
> --- a/doc/man/lttng-gen-tp.1
> +++ b/doc/man/lttng-gen-tp.1
> @@ -64,7 +64,7 @@ TRACEPOINT_LOGLEVEL.
> (See lttng-ust(3) for the complete list of available definition.)
>
> You write them as you would write them in a C header file. You can add
> -comments with \fB/* */\fP, \fB//\fP and \fB#\fP.
> +comments with \fB/* */\fP and \fB//\fP.
>
> The provider name (the first field of TRACEPOINT_EVENT) must be
> the same for the whole file.
> diff --git a/tools/lttng-gen-tp b/tools/lttng-gen-tp
> index 5937dfd..5ea221b 100755
> --- a/tools/lttng-gen-tp
> +++ b/tools/lttng-gen-tp
> @@ -159,9 +159,6 @@ class TemplateFile:
>
> self.text = f.read()
>
> - #Remove # comments (from input and output file
> - removeComments = re.compile("#.*$",flags=re.MULTILINE)
> - self.text = removeComments.sub("",self.text)
> #Remove // comments
> removeLineComment = re.compile("\/\/.*$",flags=re.MULTILINE)
> nolinecomment = removeLineComment.sub("",self.text)
More information about the lttng-dev
mailing list