/*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
* Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* SPDX-License-Identifier: GPL-2.0-only
#include <stdlib.h>
#include <string.h>
-#include <common/mi-lttng.h>
-#include <common/time.h>
-#include <common/tracker.h>
-#include <lttng/domain-internal.h>
+#include <common/mi-lttng.hpp>
+#include <common/time.hpp>
+#include <common/tracker.hpp>
+#include <lttng/domain-internal.hpp>
#include <lttng/lttng.h>
-#include "../command.h"
+#include "../command.hpp"
static int opt_userspace;
static int opt_kernel;
}
/* Caller must free() *cmdline */
- cmdline = (char *) zmalloc(PATH_MAX);
+ cmdline = zmalloc<char>(PATH_MAX);
if (!cmdline) {
PERROR("malloc cmdline");
goto end;
}
+
ret = fread(cmdline, 1, PATH_MAX, fp);
if (ret < 0) {
PERROR("fread proc list");
int cmd_list(int argc, const char **argv)
{
int opt, ret = CMD_SUCCESS;
- const char *session_name, *leftover = NULL;
+ const char *arg_session_name, *leftover = NULL;
static poptContext pc;
struct lttng_domain domain;
struct lttng_domain *domains = NULL;
}
/* Get session name (trailing argument) */
- session_name = poptGetArg(pc);
- DBG2("Session name: %s", session_name);
+ arg_session_name = poptGetArg(pc);
+ DBG2("Session name: %s", arg_session_name);
leftover = poptGetArg(pc);
if (leftover) {
}
if (opt_kernel || opt_userspace || opt_jul || opt_log4j || opt_python) {
- the_handle = lttng_create_handle(session_name, &domain);
+ the_handle = lttng_create_handle(arg_session_name, &domain);
if (the_handle == NULL) {
ret = CMD_FATAL;
goto end;
}
}
- if (session_name == NULL) {
+ if (arg_session_name == NULL) {
if (!opt_kernel && !opt_userspace && !opt_jul && !opt_log4j
&& !opt_python) {
ret = list_sessions(NULL);
}
}
/* MI: the ouptut of list_sessions is an unclosed session element */
- ret = list_sessions(session_name);
+ ret = list_sessions(arg_session_name);
if (ret) {
goto end;
}
- ret = list_rotate_settings(session_name);
+ ret = list_rotate_settings(arg_session_name);
if (ret) {
goto end;
}
/* Domain listing */
if (opt_domain) {
- ret = list_domains(session_name);
+ ret = list_domains(arg_session_name);
goto end;
}
int i, nb_domain;
/* We want all domain(s) */
- nb_domain = lttng_list_domains(session_name, &domains);
+ nb_domain = lttng_list_domains(arg_session_name, &domains);
if (nb_domain < 0) {
ret = CMD_ERROR;
ERR("%s", lttng_strerror(nb_domain));
}
the_handle = lttng_create_handle(
- session_name, &domains[i]);
+ arg_session_name, &domains[i]);
if (the_handle == NULL) {
ret = CMD_FATAL;
goto end;