projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Snapshot warning if there are no events in one of the domains
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index 9362833c931fcb9fdcd5f9a82660e7260c24370c..16d8ba25d135c0fe47d51cc8f7fb57299a30d18e 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-3593,13
+3593,6
@@
static int record_kernel_snapshot(struct ltt_kernel_session *ksess,
assert(output);
assert(session);
assert(output);
assert(session);
- /* Get the datetime for the snapshot output directory. */
- ret = utils_get_current_time_str("%Y%m%d-%H%M%S", output->datetime,
- sizeof(output->datetime));
- if (!ret) {
- ret = LTTNG_ERR_INVALID;
- goto error;
- }
/*
* Copy kernel session sockets so we can communicate with the right
/*
* Copy kernel session sockets so we can communicate with the right
@@
-3647,14
+3640,6
@@
static int record_ust_snapshot(struct ltt_ust_session *usess,
assert(output);
assert(session);
assert(output);
assert(session);
- /* Get the datetime for the snapshot output directory. */
- ret = utils_get_current_time_str("%Y%m%d-%H%M%S", output->datetime,
- sizeof(output->datetime));
- if (!ret) {
- ret = LTTNG_ERR_INVALID;
- goto error;
- }
-
/*
* Copy UST session sockets so we can communicate with the right
* consumer for the snapshot record command.
/*
* Copy UST session sockets so we can communicate with the right
* consumer for the snapshot record command.
@@
-3676,9
+3661,6
@@
static int record_ust_snapshot(struct ltt_ust_session *usess,
case EINVAL:
ret = LTTNG_ERR_INVALID;
break;
case EINVAL:
ret = LTTNG_ERR_INVALID;
break;
- case ENODATA:
- ret = LTTNG_ERR_SNAPSHOT_NODATA;
- break;
default:
ret = LTTNG_ERR_SNAPSHOT_FAIL;
break;
default:
ret = LTTNG_ERR_SNAPSHOT_FAIL;
break;
@@
-3796,12
+3778,21
@@
int cmd_snapshot_record(struct ltt_session *session,
unsigned int use_tmp_output = 0;
struct snapshot_output tmp_output;
unsigned int snapshot_success = 0;
unsigned int use_tmp_output = 0;
struct snapshot_output tmp_output;
unsigned int snapshot_success = 0;
+ char datetime[16];
assert(session);
assert(output);
DBG("Cmd snapshot record for session %s", session->name);
assert(session);
assert(output);
DBG("Cmd snapshot record for session %s", session->name);
+ /* Get the datetime for the snapshot output directory. */
+ ret = utils_get_current_time_str("%Y%m%d-%H%M%S", datetime,
+ sizeof(datetime));
+ if (!ret) {
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
+
/*
* Permission denied to create an output if the session is not
* set in no output mode.
/*
* Permission denied to create an output if the session is not
* set in no output mode.
@@
-3832,6
+3823,9
@@
int cmd_snapshot_record(struct ltt_session *session,
}
/* Use the global session count for the temporary snapshot. */
tmp_output.nb_snapshot = session->snapshot.nb_snapshot;
}
/* Use the global session count for the temporary snapshot. */
tmp_output.nb_snapshot = session->snapshot.nb_snapshot;
+
+ /* Use the global datetime */
+ memcpy(tmp_output.datetime, datetime, sizeof(datetime));
use_tmp_output = 1;
}
use_tmp_output = 1;
}
@@
-3899,6
+3893,7
@@
int cmd_snapshot_record(struct ltt_session *session,
}
tmp_output.nb_snapshot = session->snapshot.nb_snapshot;
}
tmp_output.nb_snapshot = session->snapshot.nb_snapshot;
+ memcpy(tmp_output.datetime, datetime, sizeof(datetime));
if (session->kernel_session) {
ret = record_kernel_snapshot(session->kernel_session,
if (session->kernel_session) {
ret = record_kernel_snapshot(session->kernel_session,
This page took
0.025156 seconds
and
4
git commands to generate.