projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Snapshot: record: use same datetime for snapshot folder output
[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 b25fda3e8f3f264229c1164b5a01b0a29f558535..24e6d0c003c2194b6ab657e58651267ae6f44ad1 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-2959,13
+2959,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
@@
-3013,14
+3006,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.
@@
-3162,12
+3147,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.
@@
-3198,6
+3192,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;
}
@@
-3265,6
+3262,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.026172 seconds
and
4
git commands to generate.