int ret;
size_t strf_ret;
struct tm *timeinfo;
- char datetime[16];
+ char datetime[21];
time_t now;
bool ust_active = false;
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");
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 datetime[21], start_datetime[21];
int ret;
size_t strf_ret;
ret = -1;
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 == 0) {
ERR("Failed to format timestamp while renaming completed session chunk");
}
if (session->rotate_count == 1) {
- char start_time[16];
+ char start_time[21];
timeinfo = localtime(&session->last_chunk_start_ts);
if (!timeinfo) {
}
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;
ret = -1;
goto end;
}
- 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;
{
# 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 ()