Project

General

Profile

Actions

Bug #554

closed

Adding context to an empty session creates default channel

Added by Daniel U. Thibault almost 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
Start date:
05/31/2013
Due date:
% Done:

100%

Estimated time:

Description

Adding context to an empty session has the nasty side-effect of creating the default channel, whether the command succeeded or not:

$ sudo -H lttng create somesession
Session somesession created.
Traces will be written in /root/lttng-traces/somesession-20130531-134523
$ sudo -H lttng list somesession
Tracing session somesession: [inactive]
    Trace path: /root/lttng-traces/somesession-20130531-134523

$ sudo -H lttng add-context -k -t perf:cache-misses
Error: perf:cache-misses: Add kernel context failed
Warning: Some command(s) went wrong
$ sudo -H lttng list somesession
Tracing session somesession: [inactive]
    Trace path: /root/lttng-traces/somesession-20130531-134523

=== Domain: Kernel ===

Channels:
-------------
- channel0: [enabled]

    Attributes:
      write mode: discard
      subbufers size: 262144 bytes
      number of subbufers: 4
      switch timer interval: 0 usec
      read timer interval: 200000 usec
      output: splice()

    Events:
      None

or

$ sudo -H lttng create somesession
Session somesession created.
Traces will be written in /root/lttng-traces/somesession-20130531-144523
$ sudo -H lttng list somesession
Tracing session somesession: [inactive]
    Trace path: /root/lttng-traces/somesession-20130531-144523

$ sudo -H lttng add-context -k -t procname
kernel context procname added to all channels
$ sudo -H lttng list somesession
Tracing session somesession: [inactive]
    Trace path: /root/lttng-traces/somesession-20130531-144523

=== Domain: Kernel ===

Channels:
-------------
- channel0: [enabled]

    Attributes:
      write mode: discard
      subbufers size: 262144 bytes
      number of subbufers: 4
      switch timer interval: 0 usec
      read timer interval: 200000 usec
      output: splice()

    Events:
      None
Actions #1

Updated by David Goulet almost 11 years ago

  • Status changed from New to Confirmed
  • Target version set to 2.2

Yes that is normal, like enable-event, if no channel is found, a default one is created.

However, there is two issues here where first it's not documented in the man page that "add-context" creates a channel if none found and none is given with -c. Second, if the add-context fails, the default channel should be destroyed.

Actions #2

Updated by David Goulet almost 11 years ago

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

Also available in: Atom PDF