Project

General

Profile

Actions

Bug #878

closed

lttng-sessiond cannot unload lttng-modules when live session exists

Added by Mathieu Desnoyers almost 10 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Jonathan Rajotte Julien
Target version:
Start date:
02/02/2015
Due date:
% Done:

100%

Estimated time:

Description

After the following set of commands:

lttng-sessiond (as root)

lttng create --live; lttng enable-channel -k test; lttng start

If we CTRL-C lttng-sessiond, this appears:

^CError: Unable to remove module lttng-ring-buffer-client-discard
Error: Unable to remove module lttng-lib-ring-buffer
Error: Unable to remove module lttng-tracer

It appears there is still a refcount held by sessiond when we try to remove the modules in this scenario. It could be a file that should have been closed but has not.

Actions #1

Updated by Jérémie Galarneau over 9 years ago

  • Assignee set to Jonathan Rajotte Julien
Actions #2

Updated by Jonathan Rajotte Julien over 9 years ago

  • Status changed from New to Confirmed
Actions #3

Updated by Jonathan Rajotte Julien over 9 years ago

Look like a race between the consumerd cleanup and the cleanup from sessiond.

Using lsmod we can see that there is no more refs on lttng_ring_buffer_metadata_client and it's easily removed with modprob by hand.

/sys/kernel/debug/tracing/modules give a way to track who is triggering modules_get and modules_put for lttng_ring_buffer_metadata_client (via filter).

        modprobe-13671 [002] .... 93370.022587: module_load: lttng_ring_buffer_client_discard OX
        modprobe-13671 [002] .... 93370.023329: module_put: lttng_ring_buffer_client_discard call_site=SyS_finit_module refcnt=2
  lttng-sessiond-13767 [002] .... 93377.718143: module_get: lttng_ring_buffer_client_discard call_site=lttng_channel_create [lttng_tracer] refcnt=3
  lttng-sessiond-13767 [002] .... 93377.722421: module_get: lttng_ring_buffer_client_discard call_site=_channel_create [lttng_ring_buffer_client_discard] refcnt=4
  lttng-sessiond-13661 [000] .... 93384.156345: module_put: lttng_ring_buffer_client_discard call_site=_lttng_channel_destroy [lttng_tracer] refcnt=1
 lttng-consumerd-13785 [002] .... 93384.394481: module_put: lttng_ring_buffer_client_discard call_site=release_priv_ops [lttng_ring_buffer_client_discard] refcnt=5

Looks like consumerd and sessiond release lttng_ring_buffer_client_discard on cleanup. If we break while removing the modules and assuring that consumerd release before the modules removal everything works fine.

Let's see where we can go from there. Any thought?

Actions #4

Updated by Jonathan Rajotte Julien about 9 years ago

  • Status changed from Confirmed to In Progress
Actions #5

Updated by Jonathan Rajotte Julien about 9 years ago

  • Status changed from In Progress to Feedback
Actions #6

Updated by Jérémie Galarneau about 9 years ago

  • Target version set to 2.7
Actions #7

Updated by Jonathan Rajotte Julien about 9 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100

Applied in changeset tools|commit:4e4714cb244d7ace4f4a462a3923066fd4760669.

Actions

Also available in: Atom PDF