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 create URI parsing and check
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
view.c
diff --git
a/src/bin/lttng/commands/view.c
b/src/bin/lttng/commands/view.c
index dd3c9a3cc225b06d2ff055fdfb7acdfe0bc141ef..e3eff22ca394c6680babf7ef75a064bb7bc53b83 100644
(file)
--- a/
src/bin/lttng/commands/view.c
+++ b/
src/bin/lttng/commands/view.c
@@
-278,7
+278,7
@@
error:
*/
static int view_trace(void)
{
*/
static int view_trace(void)
{
- int ret
, count, i, found = 0
;
+ int ret;
char *session_name, *trace_path;
struct lttng_session *sessions = NULL;
char *session_name, *trace_path;
struct lttng_session *sessions = NULL;
@@
-314,6
+314,8
@@
static int view_trace(void)
DBG("Viewing trace for session %s", session_name);
if (session_name) {
DBG("Viewing trace for session %s", session_name);
if (session_name) {
+ int i, count, found = 0;
+
/* Getting all sessions */
count = lttng_list_sessions(&sessions);
if (count < 0) {
/* Getting all sessions */
count = lttng_list_sessions(&sessions);
if (count < 0) {
@@
-339,17
+341,17
@@
static int view_trace(void)
}
trace_path = sessions[i].path;
}
trace_path = sessions[i].path;
+
+ if (sessions[i].enabled) {
+ WARN("Session %s is running. Please stop it before reading it.",
+ session_name);
+ ret = CMD_ERROR;
+ goto free_sessions;
+ }
} else {
trace_path = opt_trace_path;
}
} else {
trace_path = opt_trace_path;
}
- if (sessions[i].enabled) {
- WARN("Session %s is running. Please stop it before reading it.",
- session_name);
- ret = CMD_ERROR;
- goto free_sessions;
- }
-
MSG("Trace directory: %s\n", trace_path);
ret = spawn_viewer(trace_path);
MSG("Trace directory: %s\n", trace_path);
ret = spawn_viewer(trace_path);
This page took
0.024596 seconds
and
4
git commands to generate.