Add a git version information in LTTng versions compiled from git sources
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 Add a git version information in LTTng versions compiled from git sources
--- include/Makefile.am | 20 +++++++++++++++++++- include/lttng/version.h | 25 +++++++++++++++++++++++++ src/bin/lttng-sessiond/main.c | 5 +++++ src/bin/lttng/commands/version.c | 4 ++++ src/bin/lttng/lttng.c | 7 ++++++- 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 include/lttng/version.h
include/Makefile.am +19 -1
@@ -1 +1,19 @@ -lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h +all-local: + (git_version=$$(git describe --long --all 2>/dev/null); \ + version_h=$(top_builddir)/include/lttng/version.h; \ + if [ -z "$${git_version}" ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "/^#define GIT_VERSION/d" "$${version_h}"; \ + fi; \ + else \ + if [ $$(grep -cE "^#define GIT_VERSION \"?$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + else \ + sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + fi; \ + fi; \ + fi) + + +lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h lttng/version.h
include/lttng/version.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* version.h +* +* Linux Trace Toolkit version header file +* +* Copyright (C) 2013 - Raphaël Beamonte <[email protected]> +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License, version 2.1 only, +* as published by the Free Software Foundation. +* +* 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 +*/ + +#ifndef VERSION_H +#define VERSION_H + +#endif /* VERSION_H */
src/bin/lttng-sessiond/main.c +5 -0
@@ -35,6 +35,7 @@#include <urcu/uatomic.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <common/common.h> #include <common/compat/socket.h>
@@ -3547,7 +3548,11 @@ static int parse_args(int argc, char **argv)usage ();exit (EXIT_FAILURE );case 'V' : +#ifdef GIT_VERSION +fprintf (stdout,"%s (Git: %s)\n" ,VERSION ,GIT_VERSION ); +#else /* GIT_VERSION */ fprintf (stdout,"%s\n" ,VERSION ); +#endif /* GIT_VERSION */ exit (EXIT_SUCCESS );case 'S' : opt_sig_parent =1 ;
src/bin/lttng/commands/version.c +4 -0
@@ -24,6 +24,7 @@#include <sys/types.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include "../command.h"
@@ -79,6 +80,9 @@ int cmd_version(int argc, const char **argv) }MSG ("lttng version " VERSION " - " VERSION_NAME ); +#ifdef GIT_VERSION +MSG ("Git version: " GIT_VERSION ); +#endif MSG ("\n" VERSION_DESCRIPTION "\n" );MSG ("Web site: http://lttng.org" );MSG ("\nlttng is free software and under the GPL license and part LGPL" );
src/bin/lttng/lttng.c +6 -1
@@ -25,6 +25,7 @@#include <sys/wait.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <ctype.h> #include <lttng/lttng.h>
@@ -81,7 +82,11 @@ static struct cmd_struct commands[] = {static void usage (FILE *ofp) { -fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n\n" ); +fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n" ); +#ifdef GIT_VERSION +fprintf (ofp,"Git version: " GIT_VERSION "\n" ); +#endif +fprintf (ofp,"\n" );fprintf (ofp,"usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n" );fprintf (ofp,"\n" );fprintf (ofp,"Options:\n" );
Signature · 7 lines
1.7.10.4 _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Raphaël Beamonte
Signed-off-by Raphaël Beamonte <[email protected]>--- include/Makefile.am | 20 +++++++++++++++++++- include/lttng/version.h | 25 +++++++++++++++++++++++++ src/bin/lttng-sessiond/main.c | 5 +++++ src/bin/lttng/commands/version.c | 4 ++++ src/bin/lttng/lttng.c | 7 ++++++- 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 include/lttng/version.h
Ok, this is a new try. This one uses shell script in the Makefile of the include directory to verify and change (only if necessary) the value of the GIT_VERSION define. It allows the sessiond/main.c, commands/version.c and lttng.c files to be the only one to need re-compilation for versioning when the git version changes.
I thought at first to put the content of the shell script in a version.sh file that would be called, but I wasn't sure the idea of calling an external shell script at make would be better that directly put the operations in the makefile.
One thing I'm not sure about is that currently, the version.h needs to be versioned but perhaps should be in the .gitignore file to only save the "original" version file in the repository. There could be another solution if you think it's better : generating the version.h file with the bash script at first run. In this case, I think the version.sh shell script should perhaps be a better solution.
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines
One thing I'm not sure about is that currently, the
version.hneeds to be versioned but perhaps should be in the .gitignore file to only save the "original" version file in the repository. There could be another solution if you think it's better : generating theversion.hfile with the bash script at first run. In this case, I think theversion.shshell script should perhaps be a better solution.
For that part, you should probably have a version.h.in or something similar that is the template and the version.h that is generated.
A make dist should probably generate a version.h without the git version information.
A message that is not in the archive (sent off-list or not yet received): CAEzWAe+Q41BjiSf+6FQ00jg3qrC71ZbdanDpunqFdYFeWBeGxg@mail.gmail.com
Quoted 2 lines · Yannick
For that part, you should probably have a version.h.in or something similar that is the template and the
version.hthat is generated.
Yes, that's an interesting idea. I'll look into that.
Quoted 2 lines
A make dist should probably generate a
version.hwithout the git version information.
Right. I'll find a way to do that.
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Hey Raphaël,
This does not seems to work... I've applied your patch and recompile my git tree but version are still showing "2.1.0" ... ?
Another thing, we really do prefer having #ifdef statement in one call site per binaries this means that you might want to use like "lttng-sessiond.h", put the ifdef there and do an inline function to print the correct version.
Last thing, don't use spaces please! You can use extras/checkpatch.pl to make sure you are ok with the std we have.
Thanks!
David
Raphaël Beamonte:
Quoted 127 lines
Signed-off-by Raphaël Beamonte <[email protected]>--- include/Makefile.am | 20 +++++++++++++++++++- include/lttng/version.h | 25 +++++++++++++++++++++++++ src/bin/lttng-sessiond/main.c | 5 +++++ src/bin/lttng/commands/version.c | 4 ++++ src/bin/lttng/lttng.c | 7 ++++++- 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 include/lttng/version.hinclude/Makefile.am +19
-1@@ -1 +1,19 @@ -lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h +all-local: + (git_version=$$(git describe --long --all 2>/dev/null); \ + version_h=$(top_builddir)/include/lttng/version.h; \ + if [ -z "$${git_version}" ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "/^#define GIT_VERSION/d" "$${version_h}"; \ + fi; \ + else \ + if [ $$(grep -cE "^#define GIT_VERSION \"?$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + else \ + sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + fi; \ + fi; \ + fi) + + +lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h lttng/version.hinclude/lttng/version.h new file +25
-0@@ -0,0 +1,25 @@ +/* +* version.h +* +* Linux Trace Toolkit version header file +* +* Copyright (C) 2013 - Raphaël Beamonte <[email protected]> +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License, version 2.1 only, +* as published by the Free Software Foundation. +* +* 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 +*/ + +#ifndef VERSION_H +#define VERSION_H + +#endif /* VERSION_H */ src/bin/lttng-sessiond/main.c +5
-0@@ -35,6 +35,7 @@#include <urcu/uatomic.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <common/common.h> #include <common/compat/socket.h> @@ -3547,7 +3548,11 @@ static int parse_args(int argc, char **argv)usage ();exit (EXIT_FAILURE );case 'V' : +#ifdef GIT_VERSION +fprintf (stdout,"%s (Git: %s)\n" ,VERSION ,GIT_VERSION ); +#else /* GIT_VERSION */ fprintf (stdout,"%s\n" ,VERSION ); +#endif /* GIT_VERSION */ exit (EXIT_SUCCESS );case 'S' : opt_sig_parent =1 ;src/bin/lttng/commands/version.c +4
-0@@ -24,6 +24,7 @@#include <sys/types.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include "../command.h" @@ -79,6 +80,9 @@ int cmd_version(int argc, const char **argv) }MSG ("lttng version " VERSION " - " VERSION_NAME ); +#ifdef GIT_VERSION +MSG ("Git version: " GIT_VERSION ); +#endif MSG ("\n" VERSION_DESCRIPTION "\n" );MSG ("Web site: http://lttng.org" );MSG ("\nlttng is free software and under the GPL license and part LGPL" );src/bin/lttng/lttng.c +1
-0@@ -25,6 +25,7 @@#include <sys/wait.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <ctype.h> #include <lttng/lttng.h> @@ -81,7 +82,11 @@ static struct cmd_struct commands[] = {static void usage (FILE *ofp)
src/bin/lttng/lttng.c static struct cmd_struct commands[] = { · line 92
Quoted 10 lines
src/bin/lttng/lttng.c +5
-1{ -fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n\n" ); +fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n" ); +#ifdef GIT_VERSION +fprintf (ofp,"Git version: " GIT_VERSION "\n" ); +#endif +fprintf (ofp,"\n" );fprintf (ofp,"usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n" );fprintf (ofp,"\n" );fprintf (ofp,"Options:\n" );
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
Oh wait it did create the version.h with the GIT_VERSION but I had to compile again so this header file could be used in the code.
David
David Goulet:
Quoted 143 lines
Hey Raphaël,
This does not seems to work... I've applied your patch and recompile my git tree but version are still showing "2.1.0" ... ?
Another thing, we really do prefer having #ifdef statement in one call site per binaries this means that you might want to use like "
lttng-sessiond.h", put the ifdef there and do an inline function to print the correct version.Last thing, don't use spaces please! You can use
extras/checkpatch.plto make sure you are ok with the std we have.Thanks!
DavidRaphaël Beamonte:
Quoted 126 lines
Signed-off-by Raphaël Beamonte <[email protected]>--- include/Makefile.am | 20 +++++++++++++++++++- include/lttng/version.h | 25 +++++++++++++++++++++++++ src/bin/lttng-sessiond/main.c | 5 +++++ src/bin/lttng/commands/version.c | 4 ++++ src/bin/lttng/lttng.c | 7 ++++++- 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 include/lttng/version.hinclude/Makefile.am +19
-1@@ -1 +1,19 @@ -lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h +all-local: + (git_version=$$(git describe --long --all 2>/dev/null); \ + version_h=$(top_builddir)/include/lttng/version.h; \ + if [ -z "$${git_version}" ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "/^#define GIT_VERSION/d" "$${version_h}"; \ + fi; \ + else \ + if [ $$(grep -cE "^#define GIT_VERSION \"?$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + else \ + sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + fi; \ + fi; \ + fi) + + +lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h lttng/version.hinclude/lttng/version.h new file +25
-0@@ -0,0 +1,25 @@ +/* +* version.h +* +* Linux Trace Toolkit version header file +* +* Copyright (C) 2013 - Raphaël Beamonte <[email protected]> +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License, version 2.1 only, +* as published by the Free Software Foundation. +* +* 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 +*/ + +#ifndef VERSION_H +#define VERSION_H + +#endif /* VERSION_H */ src/bin/lttng-sessiond/main.c +5
-0@@ -35,6 +35,7 @@#include <urcu/uatomic.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <common/common.h> #include <common/compat/socket.h> @@ -3547,7 +3548,11 @@ static int parse_args(int argc, char **argv)usage ();exit (EXIT_FAILURE );case 'V' : +#ifdef GIT_VERSION +fprintf (stdout,"%s (Git: %s)\n" ,VERSION ,GIT_VERSION ); +#else /* GIT_VERSION */ fprintf (stdout,"%s\n" ,VERSION ); +#endif /* GIT_VERSION */ exit (EXIT_SUCCESS );case 'S' : opt_sig_parent =1 ;src/bin/lttng/commands/version.c +4
-0@@ -24,6 +24,7 @@#include <sys/types.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include "../command.h" @@ -79,6 +80,9 @@ int cmd_version(int argc, const char **argv) }MSG ("lttng version " VERSION " - " VERSION_NAME ); +#ifdef GIT_VERSION +MSG ("Git version: " GIT_VERSION ); +#endif MSG ("\n" VERSION_DESCRIPTION "\n" );MSG ("Web site: http://lttng.org" );MSG ("\nlttng is free software and under the GPL license and part LGPL" );src/bin/lttng/lttng.c +1
-0@@ -25,6 +25,7 @@#include <sys/wait.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <ctype.h> #include <lttng/lttng.h> @@ -81,7 +82,11 @@ static struct cmd_struct commands[] = {
Quoted 16 lines
src/bin/lttng/lttng.c static struct cmd_struct commands[] = { · line 92
Quoted 11 lines
src/bin/lttng/lttng.c +5
-1static void usage (FILE *ofp) { -fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n\n" ); +fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n" ); +#ifdef GIT_VERSION +fprintf (ofp,"Git version: " GIT_VERSION "\n" ); +#endif +fprintf (ofp,"\n" );fprintf (ofp,"usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n" );fprintf (ofp,"\n" );fprintf (ofp,"Options:\n" );_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
I think this method is really sensible on the execution order of the makefile. Maybe it should be put at the top level.
Quoted 164 lines · David Goulet
Oh wait it did create the
version.hwith theGIT_VERSIONbut I had to compile again so this header file could be used in the code.David
David Goulet:
Quoted 143 lines
Hey Raphaël,
This does not seems to work... I've applied your patch and recompile my git tree but version are still showing "2.1.0" ... ?
Another thing, we really do prefer having #ifdef statement in one call site per binaries this means that you might want to use like "
lttng-sessiond.h", put the ifdef there and do an inline function to print the correct version.Last thing, don't use spaces please! You can use
extras/checkpatch.plto make sure you are ok with the std we have.Thanks!
DavidRaphaël Beamonte:
Quoted 126 lines
Signed-off-by Raphaël Beamonte <[email protected]>--- include/Makefile.am | 20 +++++++++++++++++++- include/lttng/version.h | 25 +++++++++++++++++++++++++ src/bin/lttng-sessiond/main.c | 5 +++++ src/bin/lttng/commands/version.c | 4 ++++ src/bin/lttng/lttng.c | 7 ++++++- 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 include/lttng/version.hinclude/Makefile.am +19
-1@@ -1 +1,19 @@ -lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h +all-local: + (git_version=$$(git describe --long --all 2>/dev/null); \ + version_h=$(top_builddir)/include/lttng/version.h; \ + if [ -z "$${git_version}" ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "/^#define GIT_VERSION/d" "$${version_h}"; \ + fi; \ + else \ + if [ $$(grep -cE "^#define GIT_VERSION \"?$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \ + if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \ + sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + else \ + sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \ + fi; \ + fi; \ + fi) + + +lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-error.h lttng/version.hinclude/lttng/version.h new file +25
-0@@ -0,0 +1,25 @@ +/* +* version.h +* +* Linux Trace Toolkit version header file +* +* Copyright (C) 2013 - Raphaël Beamonte <[email protected]> +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License, version 2.1 only, +* as published by the Free Software Foundation. +* +* 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 +*/ + +#ifndef VERSION_H +#define VERSION_H + +#endif /* VERSION_H */ src/bin/lttng-sessiond/main.c +5
-0@@ -35,6 +35,7 @@#include <urcu/uatomic.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <common/common.h> #include <common/compat/socket.h> @@ -3547,7 +3548,11 @@ static int parse_args(int argc, char **argv)usage ();exit (EXIT_FAILURE );case 'V' : +#ifdef GIT_VERSION +fprintf (stdout,"%s (Git: %s)\n" ,VERSION ,GIT_VERSION ); +#else /* GIT_VERSION */ fprintf (stdout,"%s\n" ,VERSION ); +#endif /* GIT_VERSION */ exit (EXIT_SUCCESS );case 'S' : opt_sig_parent =1 ;src/bin/lttng/commands/version.c +4
-0@@ -24,6 +24,7 @@#include <sys/types.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include "../command.h" @@ -79,6 +80,9 @@ int cmd_version(int argc, const char **argv) }MSG ("lttng version " VERSION " - " VERSION_NAME ); +#ifdef GIT_VERSION +MSG ("Git version: " GIT_VERSION ); +#endif MSG ("\n" VERSION_DESCRIPTION "\n" );MSG ("Web site: http://lttng.org" );MSG ("\nlttng is free software and under the GPL license and part LGPL" );src/bin/lttng/lttng.c +1
-0@@ -25,6 +25,7 @@#include <sys/wait.h> #include <unistd.h> #include <config.h> +#include <lttng/version.h> #include <ctype.h> #include <lttng/lttng.h> @@ -81,7 +82,11 @@ static struct cmd_struct commands[] = {Quoted 15 lines
src/bin/lttng/lttng.c static struct cmd_struct commands[] = { · line 92
Quoted 11 lines
src/bin/lttng/lttng.c +5
-1static void usage (FILE *ofp) { -fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n\n" ); +fprintf (ofp,"LTTng Trace Control " VERSION " - " VERSION_NAME "\n" ); +#ifdef GIT_VERSION +fprintf (ofp,"Git version: " GIT_VERSION "\n" ); +#endif +fprintf (ofp,"\n" );fprintf (ofp,"usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n" );fprintf (ofp,"\n" );fprintf (ofp,"Options:\n" );_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Quoted 4 lines
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · David Goulet
Another thing, we really do prefer having #ifdef statement in one call site per binaries this means that you might want to use like "
lttng-sessiond.h", put the ifdef there and do an inline function to print the correct version.
Ok, no problem ! Will be like that in the next try of the patch.
Quoted 2 lines
Last thing, don't use spaces please! You can use
extras/checkpatch.plto make sure you are ok with the std we have.
Sorry, copy/paste mistake. I'll correct that.
Quoted 2 lines · David Goulet
Oh wait it did create the
version.hwith theGIT_VERSIONbut I had to compile again so this header file could be used in the code.
Thanks for reporting that. Didn't see it at first !
Quoted 2 lines · Yannick Brosseau
I think this method is really sensible on the execution order of the makefile. Maybe it should be put at the top level.
Right, I'll do that.
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev