projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add ust start trace feature
[lttng-tools.git]
/
lttng
/
lttng.c
diff --git
a/lttng/lttng.c
b/lttng/lttng.c
index 9751621ff84f2c4fceb2267c5dd1b1ec6f83e1ae..e538df2fd403f0eefaf2be2c58b3c8a04973067d 100644
(file)
--- a/
lttng/lttng.c
+++ b/
lttng/lttng.c
@@
-96,6
+96,7
@@
static int process_client_opt(void)
}
if (opt_session_uuid != NULL) {
}
if (opt_session_uuid != NULL) {
+ DBG("Set session uuid to %s", opt_session_uuid);
lttng_set_current_session_uuid(opt_session_uuid);
}
lttng_set_current_session_uuid(opt_session_uuid);
}
@@
-108,6
+109,15
@@
static int process_client_opt(void)
MSG("Trace created successfully!\nUse --start PID to start tracing.");
}
MSG("Trace created successfully!\nUse --start PID to start tracing.");
}
+ if (opt_start_trace) {
+ DBG("Start trace for pid %d", opt_start_trace);
+ ret = lttng_ust_start_trace(opt_start_trace);
+ if (ret < 0) {
+ goto end;
+ }
+ MSG("Trace started successfully!");
+ }
+
return 0;
end:
return 0;
end:
@@
-255,8
+265,8
@@
not_running:
static int validate_options(void)
{
if ((opt_session_uuid == NULL) &&
static int validate_options(void)
{
if ((opt_session_uuid == NULL) &&
- (opt_create_trace)) {
- ERR("Can't
create
trace without a session ID.\nPlease specify using --session UUID");
+ (opt_create_trace
|| opt_start_trace
)) {
+ ERR("Can't
act on
trace without a session ID.\nPlease specify using --session UUID");
goto error;
}
goto error;
}
@@
-400,15
+410,17
@@
end:
*/
static void sighandler(int sig)
{
*/
static void sighandler(int sig)
{
- DBG("%d received", sig);
switch (sig) {
case SIGTERM:
switch (sig) {
case SIGTERM:
+ DBG("SIGTERM catched");
clean_exit(EXIT_FAILURE);
break;
case SIGCHLD:
/* Notify is done */
clean_exit(EXIT_FAILURE);
break;
case SIGCHLD:
/* Notify is done */
+ DBG("SIGCHLD catched");
break;
default:
break;
default:
+ DBG("Unknown signal %d catched", sig);
break;
}
break;
}
This page took
0.026697 seconds
and
5
git commands to generate.