projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: lttng UI failed to report error 19
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
list.c
diff --git
a/src/bin/lttng/commands/list.c
b/src/bin/lttng/commands/list.c
index 28e18644403142592ad2547476d8c41384d2163c..6677e4c4e1401767821cf62942b1ce146f3683c4 100644
(file)
--- a/
src/bin/lttng/commands/list.c
+++ b/
src/bin/lttng/commands/list.c
@@
-294,6
+294,7
@@
static int list_ust_events(void)
struct lttng_handle *handle;
struct lttng_event *event_list;
pid_t cur_pid = 0;
struct lttng_handle *handle;
struct lttng_event *event_list;
pid_t cur_pid = 0;
+ char *cmdline = NULL;
memset(&domain, 0, sizeof(domain));
memset(&domain, 0, sizeof(domain));
@@
-322,7
+323,9
@@
static int list_ust_events(void)
for (i = 0; i < size; i++) {
if (cur_pid != event_list[i].pid) {
cur_pid = event_list[i].pid;
for (i = 0; i < size; i++) {
if (cur_pid != event_list[i].pid) {
cur_pid = event_list[i].pid;
- MSG("\nPID: %d - Name: %s", cur_pid, get_cmdline_by_pid(cur_pid));
+ cmdline = get_cmdline_by_pid(cur_pid);
+ MSG("\nPID: %d - Name: %s", cur_pid, cmdline);
+ free(cmdline);
}
print_events(&event_list[i]);
}
}
print_events(&event_list[i]);
}
@@
-349,6
+352,8
@@
static int list_ust_event_fields(void)
struct lttng_handle *handle;
struct lttng_event_field *event_field_list;
pid_t cur_pid = 0;
struct lttng_handle *handle;
struct lttng_event_field *event_field_list;
pid_t cur_pid = 0;
+ char *cmdline = NULL;
+
struct lttng_event cur_event;
memset(&domain, 0, sizeof(domain));
struct lttng_event cur_event;
memset(&domain, 0, sizeof(domain));
@@
-379,7
+384,9
@@
static int list_ust_event_fields(void)
for (i = 0; i < size; i++) {
if (cur_pid != event_field_list[i].event.pid) {
cur_pid = event_field_list[i].event.pid;
for (i = 0; i < size; i++) {
if (cur_pid != event_field_list[i].event.pid) {
cur_pid = event_field_list[i].event.pid;
- MSG("\nPID: %d - Name: %s", cur_pid, get_cmdline_by_pid(cur_pid));
+ cmdline = get_cmdline_by_pid(cur_pid);
+ MSG("\nPID: %d - Name: %s", cur_pid, cmdline);
+ free(cmdline);
}
if (strcmp(cur_event.name, event_field_list[i].event.name) != 0) {
print_events(&event_field_list[i].event);
}
if (strcmp(cur_event.name, event_field_list[i].event.name) != 0) {
print_events(&event_field_list[i].event);
@@
-474,9
+481,7
@@
static int list_events(const char *channel_name)
MSG("");
end:
MSG("");
end:
- if (events) {
- free(events);
- }
+ free(events);
ret = CMD_SUCCESS;
error:
ret = CMD_SUCCESS;
error:
@@
-588,6
+593,7
@@
static int list_sessions(const char *session_name)
DBG("Session count %d", count);
if (count < 0) {
ret = count;
DBG("Session count %d", count);
if (count < 0) {
ret = count;
+ ERR("%s", lttng_strerror(ret));
goto error;
} else if (count == 0) {
MSG("Currently no available tracing session");
goto error;
} else if (count == 0) {
MSG("Currently no available tracing session");
@@
-680,8
+686,7
@@
error:
*/
int cmd_list(int argc, const char **argv)
{
*/
int cmd_list(int argc, const char **argv)
{
- int opt, i, ret = CMD_SUCCESS;
- int nb_domain;
+ int opt, ret = CMD_SUCCESS;
const char *session_name;
static poptContext pc;
struct lttng_domain domain;
const char *session_name;
static poptContext pc;
struct lttng_domain domain;
@@
-745,6
+750,7
@@
int cmd_list(int argc, const char **argv)
if (opt_kernel) {
ret = list_kernel_events();
if (ret < 0) {
if (opt_kernel) {
ret = list_kernel_events();
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
}
goto end;
}
}
@@
-755,6
+761,7
@@
int cmd_list(int argc, const char **argv)
ret = list_ust_events();
}
if (ret < 0) {
ret = list_ust_events();
}
if (ret < 0) {
+ ret = CMD_ERROR;
goto end;
}
}
goto end;
}
}
@@
-778,6
+785,8
@@
int cmd_list(int argc, const char **argv)
goto end;
}
} else {
goto end;
}
} else {
+ int i, nb_domain;
+
/* We want all domain(s) */
nb_domain = lttng_list_domains(session_name, &domains);
if (nb_domain < 0) {
/* We want all domain(s) */
nb_domain = lttng_list_domains(session_name, &domains);
if (nb_domain < 0) {
@@
-818,9
+827,7
@@
int cmd_list(int argc, const char **argv)
}
end:
}
end:
- if (domains) {
- free(domains);
- }
+ free(domains);
if (handle) {
lttng_destroy_handle(handle);
}
if (handle) {
lttng_destroy_handle(handle);
}
This page took
0.039765 seconds
and
4
git commands to generate.