summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a1ae2ea)
When the session starts, we now create the <session-name> folder and the
domain folder(s) regardless of the activity or registered apps.
This will be useful for the session rotation feature to avoid dealing
with empty rotations. Also, it is more consistent for the user to have
an empty trace folder instead of no folder at all if a session is
completely inactive.
This also removes the directory creation made by the session daemon
which did not belong there.
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ if (!session->has_been_started) {
+ if (!session->snapshot_mode && session->output_traces) {
+ ret = session_mkdir(session);
+ if (ret) {
+ ERR("Failed to create the session directories");
+ ret = LTTNG_ERR_CREATE_DIR_FAIL;
+ goto error;
+ }
+ }
+ }
+
/* Kernel tracing */
if (ksession != NULL) {
/* Kernel tracing */
if (ksession != NULL) {
+ DBG("Start kernel tracing session %s", session->name);
ret = start_kernel_session(ksession, kernel_tracer_fd);
if (ret != LTTNG_OK) {
goto error;
ret = start_kernel_session(ksession, kernel_tracer_fd);
if (ret != LTTNG_OK) {
goto error;
- /* Create directory(ies) on local filesystem. */
- if (session->kernel_session->consumer->type == CONSUMER_DST_LOCAL &&
- strlen(session->kernel_session->consumer->dst.session_root_path) > 0) {
- ret = run_as_mkdir_recursive(
- session->kernel_session->consumer->dst.session_root_path,
- S_IRWXU | S_IRWXG, session->uid, session->gid);
- if (ret < 0) {
- if (errno != EEXIST) {
- ERR("Trace directory creation error");
- goto error;
- }
- }
- }
-
session->kernel_session->uid = session->uid;
session->kernel_session->gid = session->gid;
session->kernel_session->output_traces = session->output_traces;
session->kernel_session->uid = session->uid;
session->kernel_session->gid = session->gid;
session->kernel_session->output_traces = session->output_traces;
print_test_result(demo_process.returncode == 0, current_test,\
"Running application dynamically linked to providers, no preload")
current_test += 1
print_test_result(demo_process.returncode == 0, current_test,\
"Running application dynamically linked to providers, no preload")
current_test += 1
- print_test_result(not os.path.exists(session_info.trace_path), current_test,\
+ trace_path = os.path.join(session_info.trace_path, "ust", "uid")
+ print_test_result(not os.path.exists(trace_path), current_test,\
"No events logged when running demo application without preloading providers")
current_test += 1
"No events logged when running demo application without preloading providers")
current_test += 1