Project

General

Profile

Actions

Bug #1190

closed

lttng ust statedump unreliable when used with taskset

Added by Francis Deslauriers almost 5 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/15/2019
Due date:
% Done:

100%

Estimated time:

Description

While trying to create a trace with events only a single cpu I tried to used taskset and witnessed that lttng_ust_statedump events are sometimes missing.

I was able to reproduce this issue with the follow commands:

lttng create
lttng enable-event -a -u
lttng start
taskset -c 0 ~/lttng-tools/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents 2
lttng stop
lttng view

When running those commands multiple times in loop I see lttng_ust_statedump events only 1 in 20 runs. All other runs only contain the event directly produced by the app. The lttng_ust_statedump should be emitted every time a UST app is launched.

Actions #1

Updated by Francis Deslauriers almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by Francis Deslauriers almost 5 years ago

  • Description updated (diff)
Actions #3

Updated by Francis Deslauriers almost 5 years ago

  • Description updated (diff)
Actions #4

Updated by Francis Deslauriers almost 5 years ago

This problem doesn't occur when the app in running with strace such as:

strace taskset -c 0 ~/lttng-tools/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents 2

Actions #5

Updated by Mathieu Desnoyers almost 5 years ago

I think we need to tweak lttng-ust's constructor_wait semaphore. e.g.:

initialize it to 4,
handle_pending_statedump now depends on ctor_passed <= 2 to execute,
handle_pending_statedump now also posts the semaphore.

This should ensure we postpone main's execution until the statedump is done. Important for short-lived apps, and could explain the issue here.

Actions #6

Updated by Mathieu Desnoyers almost 5 years ago

  • Project changed from LTTng-tools to LTTng-UST
Actions #7

Updated by Gabriel Guilbert over 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF