Project

General

Profile

Actions

Bug #1209

open

Tracking a PID after start of session result in error on lttng-sessiond

Added by Jonathan Rajotte Julien over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
11/17/2019
Due date:
% Done:

0%

Estimated time:

Description

Against lttng-tools/lttng-ust master:

lttng-sessiond
lttng create
lttng enable-event -u -a
lttng start
start app (get PID of said app)
lttng track -u --pid $PID

Yield on the sessiond error stdout:

Error: Error starting tracing for app pid: 2574 (ret: -1024)

When digging a bit moire it seems that the app is told to enable tracing even if it is already started.

This seems to be a side effect of calling ust_app_global_update from ust_global_update_all from trace_ust_track_pid and taking the true path for the following path:

void ust_app_global_update(struct ltt_ust_session *usess, struct ust_app *app)
{
    assert(usess);
    assert(usess->active);

    DBG2("UST app global update for app sock %d for session id %" PRIu64,
            app->sock, usess->id);

    if (!app->compatible) {
        return;
    }
    if (trace_ust_pid_tracker_lookup(usess, app->pid)) {
        /*
         * Synchronize the application's internal tracing configuration
         * and start tracing.
         */
        ust_app_synchronize(usess, app);
        ust_app_start_trace(usess, app);
    } else {
        ust_app_global_destroy(usess, app);
    }
}

We end up "starting" tracing even when it is already the case, the app return -16 on the enable session call.

libust[14705/14707]: Message Received "Enable" (128), Handle "session" (1) (in print_cmd() at lttng-ust-comm.c:463)
libust[14705/14706]: Info: sessiond not accepting connections to global apps socket (in ust_listener_thread() at lttng-ust-comm.c:1546)
libust[14705/14706]: Waiting for global apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:1427)
libust[14705/14706]: Info: sessiond not accepting connections to global apps socket (in ust_listener_thread() at lttng-ust-comm.c:1546)
libust[14705/14706]: Waiting for global apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:1427)
libust[14705/14707]: Return value: -16 (in handle_message() at lttng-ust-comm.c:1083)
libust[14705/14706]: Info: sessiond not accepting connections to global apps socket (in ust_listener_thread() at lttng-ust-comm.c:1546)
libust[14705/14706]: Waiting for global apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:1427)
libust[14705/14706]: Info: sessiond not accepting connections to global apps socket (in ust_listener_thread() at lttng-ust-comm.c:1546)
libust[14705/14706]: Waiting for global apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:1427)
libust[14705/14707]: message successfully sent (in send_reply() at lttng-ust-comm.c:641)
Error: Error starting tracing for app pid: 14705 (ret: -1024)
ok 5 - Track command with opts: 0 -u --vpid 14705

I did not validate but this might have been introduced by 88e3c2f5610b9ac89b0923d448fee34140fc46fb if not already present in the past.

No data to display

Actions

Also available in: Atom PDF