summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8bf4946)
Use the `babeltrace2` binary to view traces by default rather than
the legacy `babeltrace`. As the install base of Babeltrace 2.x is
rather small at this point, silently fallback to Babeltrace 1.x
when it is not found on the system.
The man page is updated to reflect this change in behaviour.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie7cd7424f8af1e25238fcc4bb1aa3ee8226da023
[BABELTRACE_BIN=''])
AC_SUBST([BABELTRACE_BIN])
[BABELTRACE_BIN=''])
AC_SUBST([BABELTRACE_BIN])
-# lttv-gui
-AC_ARG_WITH([lttv-gui-bin],
- AS_HELP_STRING([--with-lttv-gui-bin],
- [Location of the lttv GUI viewer executable (including the filename)]),
- [LTTV_GUI_BIN="$withval"],
- [LTTV_GUI_BIN=''])
-AC_SUBST([LTTV_GUI_BIN])
+AC_ARG_WITH([babeltrace2-bin],
+ AS_HELP_STRING([--with-babeltrace2-bin],
+ [Location of the babeltrace2 viewer executable (including the filename)]),
+ [BABELTRACE2_BIN="$withval"],
+ [BABELTRACE2_BIN=''])
+AC_SUBST([BABELTRACE2_BIN])
AC_ARG_WITH([consumerd32-bin],
AS_HELP_STRING([--with-consumerd32-bin],
AC_ARG_WITH([consumerd32-bin],
AS_HELP_STRING([--with-consumerd32-bin],
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
+AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE2_BIN], "$BABELTRACE2_BIN", [Location of the babeltrace2 viewer executable.])
AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
AC_DEFINE_UNQUOTED([CONFIG_LTTNG_SYSTEM_RUNDIR], ["$LTTNG_SYSTEM_RUNDIR"], [LTTng system runtime directory])
AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
AC_DEFINE_UNQUOTED([CONFIG_LTTNG_SYSTEM_RUNDIR], ["$LTTNG_SYSTEM_RUNDIR"], [LTTng system runtime directory])
existing tracing session named 'SESSION'. `lttng list`
outputs all the existing tracing sessions (see man:lttng-list(1)).
existing tracing session named 'SESSION'. `lttng list`
outputs all the existing tracing sessions (see man:lttng-list(1)).
-By default, the man:babeltrace(1) trace viewer is launched.
+By default, the man:babeltrace2(1) trace viewer is launched. If it is
+not found on the system, the man:babeltrace(1) trace viewer is
+used.
Another trace viewer command can be specified using the
option:--viewer option.
Another trace viewer command can be specified using the
option:--viewer option.
static char *opt_viewer;
static char *opt_trace_path;
static const char *babeltrace_bin = CONFIG_BABELTRACE_BIN;
static char *opt_viewer;
static char *opt_trace_path;
static const char *babeltrace_bin = CONFIG_BABELTRACE_BIN;
+static const char *babeltrace2_bin = CONFIG_BABELTRACE2_BIN;
#ifdef LTTNG_EMBED_HELP
static const char help_msg[] =
#ifdef LTTNG_EMBED_HELP
static const char help_msg[] =
* This is needed for each viewer since we are using execvp().
*/
static const char *babeltrace_opts[] = { "babeltrace" };
* This is needed for each viewer since we are using execvp().
*/
static const char *babeltrace_opts[] = { "babeltrace" };
+static const char *babeltrace2_opts[] = { "babeltrace2" };
/*
* Type is also use as the index in the viewers array. So please, make sure
/*
* Type is also use as the index in the viewers array. So please, make sure
*/
enum viewer_type {
VIEWER_BABELTRACE = 0,
*/
enum viewer_type {
VIEWER_BABELTRACE = 0,
- VIEWER_USER_DEFINED = 1,
+ VIEWER_BABELTRACE2 = 1,
+ VIEWER_USER_DEFINED = 2,
enum viewer_type type;
} viewers[] = {
{ "babeltrace", VIEWER_BABELTRACE },
enum viewer_type type;
} viewers[] = {
{ "babeltrace", VIEWER_BABELTRACE },
+ { "babeltrace2", VIEWER_BABELTRACE2 },
{ NULL, VIEWER_USER_DEFINED },
};
{ NULL, VIEWER_USER_DEFINED },
};
{
if (opt_viewer == NULL) {
/* Default is babeltrace */
{
if (opt_viewer == NULL) {
/* Default is babeltrace */
- return &(viewers[VIEWER_BABELTRACE]);
+ return &(viewers[VIEWER_BABELTRACE2]);
+ case VIEWER_BABELTRACE2:
+ if (stat(babeltrace2_bin, &status) == 0) {
+ viewer_bin = babeltrace2_bin;
+ } else {
+ viewer_bin = viewer->exec_name;
+ }
+ argv = alloc_argv_from_local_opts(babeltrace2_opts,
+ ARRAY_SIZE(babeltrace2_opts), trace_path);
+ break;
case VIEWER_BABELTRACE:
if (stat(babeltrace_bin, &status) == 0) {
viewer_bin = babeltrace_bin;
case VIEWER_BABELTRACE:
if (stat(babeltrace_bin, &status) == 0) {
viewer_bin = babeltrace_bin;
ret = execvp(viewer_bin, argv);
if (ret) {
ret = execvp(viewer_bin, argv);
if (ret) {
- if (errno == ENOENT) {
- ERR("%s not found on the system", viewer_bin);
+ if (errno == ENOENT && viewer->exec_name) {
+ if (viewer->type == VIEWER_BABELTRACE2) {
+ /* Fallback to legacy babeltrace. */
+ DBG("babeltrace2 not installed on the system, falling back to babeltrace 1.x");
+ viewer = &viewers[VIEWER_BABELTRACE];
+ free(argv);
+ argv = NULL;
+ goto retry_viewer;
+ } else {
+ ERR("Viewer \"%s\" not found on the system",
+ viewer_bin);
+ }
- PERROR("exec: %s", viewer_bin);
+ PERROR("Failed to launch \"%s\" viewer", viewer_bin);
}
ret = CMD_FATAL;
goto error;
}
ret = CMD_FATAL;
goto error;