summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e7716c6)
The path of a rotated chunk is composed of the start and end timestamp
of the trace inside that chunk. In order to support distributed
environments, we now specify the GMT offset in this path as well. The
date is now formatted in ISO 8601. Here is an example:
~/lttng-traces/<session-name>/20180118T144610-0500-20180118T144611-0500-1
Chunk start: 2018-01-18 14:46:10
Chunk end: 2018-01-18 14:46:11
GMT offset: GMT-5 on both timestamps
Chunk ID: 1 (number of rotations that occured in this session so far)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
int ret;
size_t strf_ret;
struct tm *timeinfo;
int ret;
size_t strf_ret;
struct tm *timeinfo;
time_t now;
bool ust_active = false;
time_t now;
bool ust_active = false;
ret = -LTTNG_ERR_UNK;
goto end;
}
ret = -LTTNG_ERR_UNK;
goto end;
}
- strf_ret = strftime(datetime, sizeof(datetime), "%Y%m%d-%H%M%S",
+ strf_ret = strftime(datetime, sizeof(datetime), "%Y%m%dT%H%M%S%z",
timeinfo);
if (!strf_ret) {
ERR("Failed to format local time timestamp in rotate session command");
timeinfo);
if (!strf_ret) {
ERR("Failed to format local time timestamp in rotate session command");
int rename_complete_chunk(struct ltt_session *session, time_t ts)
{
struct tm *timeinfo;
int rename_complete_chunk(struct ltt_session *session, time_t ts)
{
struct tm *timeinfo;
- char datetime[16], start_datetime[16];
char new_path[LTTNG_PATH_MAX];
char new_path[LTTNG_PATH_MAX];
+ char datetime[21], start_datetime[21];
int ret;
size_t strf_ret;
int ret;
size_t strf_ret;
- strf_ret = strftime(datetime, sizeof(datetime), "%Y%m%d-%H%M%S",
+
+ strf_ret = strftime(datetime, sizeof(datetime), "%Y%m%dT%H%M%S%z",
timeinfo);
if (strf_ret == 0) {
ERR("Failed to format timestamp while renaming completed session chunk");
timeinfo);
if (strf_ret == 0) {
ERR("Failed to format timestamp while renaming completed session chunk");
}
if (session->rotate_count == 1) {
}
if (session->rotate_count == 1) {
timeinfo = localtime(&session->last_chunk_start_ts);
if (!timeinfo) {
timeinfo = localtime(&session->last_chunk_start_ts);
if (!timeinfo) {
}
strf_ret = strftime(start_time, sizeof(start_time),
}
strf_ret = strftime(start_time, sizeof(start_time),
- "%Y%m%d-%H%M%S", timeinfo);
+ "%Y%m%dT%H%M%S%z", timeinfo);
if (strf_ret == 0) {
ERR("Failed to format timestamp while renaming completed session chunk");
ret = -1;
if (strf_ret == 0) {
ERR("Failed to format timestamp while renaming completed session chunk");
ret = -1;
- strf_ret = strftime(start_datetime, sizeof(start_datetime), "%Y%m%d-%H%M%S", timeinfo);
+ strf_ret = strftime(start_datetime, sizeof(start_datetime),
+ "%Y%m%dT%H%M%S%z", timeinfo);
if (!strf_ret) {
ERR("Failed to format timestamp while renaming completed session chunk");
ret = -1;
if (!strf_ret) {
ERR("Failed to format timestamp while renaming completed session chunk");
ret = -1;
{
# Need to call this function after $today has been set.
{
# Need to call this function after $today has been set.
- # YYYYMMDD-HHMMSS-YYYYMMDD-HHMMSS
- export chunk_pattern="${today}-[0-9][0-9][0-9][0-9][0-9][0-9]-${today}-[0-9][0-9][0-9][0-9][0-9][0-9]"
+ # YYYYMMDDTHHMMSS[+-]HHMM-YYYYMMDDTHHMMSS[+-]HHMM
+ export chunk_pattern="${today}T[0-9][0-9][0-9][0-9][0-9][0-9][+-][0-9][0-9][0-9][0-9]-${today}T[0-9][0-9][0-9][0-9][0-9][0-9][+-][0-9][0-9][0-9][0-9]"
}
function validate_test_chunks ()
}
function validate_test_chunks ()