lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* [lttng-dev] Running trace-rotate and session-rotate together
@ 2021-12-21  6:47 Subrata Paul via lttng-dev
  2022-01-05 17:05 ` Jérémie Galarneau via lttng-dev
  0 siblings, 1 reply; 2+ messages in thread
From: Subrata Paul via lttng-dev @ 2021-12-21  6:47 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 822 bytes --]

Hi,

1. In the lttng-enable-rotation manpage it is mentioned that we should not
use trace rotate when automatic session rotate is enabled. Can you please
tell me why?
```
Important
           You may only use the enable-rotation command when:
           *   The selected recording session was created in normal mode or
in network streaming mode
               (see lttng-create(1)).
           *   No channel was created with a configured trace file count or
size limit (see the
               --tracefile-size and --tracefile-count options of the
lttng-enable-channel(1) command).
```

2. When automatic session rotate is running, is there any race condition in
writing the current ring buffers and archiving the current trace chunk?


--------------------------------------------------------------
Regards,
Subrata Paul

[-- Attachment #1.2: Type: text/html, Size: 1720 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [lttng-dev] Running trace-rotate and session-rotate together
  2021-12-21  6:47 [lttng-dev] Running trace-rotate and session-rotate together Subrata Paul via lttng-dev
@ 2022-01-05 17:05 ` Jérémie Galarneau via lttng-dev
  0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau via lttng-dev @ 2022-01-05 17:05 UTC (permalink / raw)
  To: Subrata Paul; +Cc: lttng-dev



----- Message original -----
> De: "lttng-dev" <lttng-dev@lists.lttng.org>
> À: "lttng-dev" <lttng-dev@lists.lttng.org>
> Envoyé: Mardi 21 Décembre 2021 01:47:12
> Objet: [lttng-dev] Running trace-rotate and session-rotate together

> Hi,
> 1. In the lttng-enable-rotation manpage it is mentioned that we should not use
> trace rotate when automatic session rotate is enabled. Can you please tell me
> why?
> ```
> Important
> You may only use the enable-rotation command when:
> * The selected recording session was created in normal mode or in network
> streaming mode
> (see lttng-create(1)).
> * No channel was created with a configured trace file count or size limit (see
> the
> --tracefile-size and --tracefile-count options of the lttng-enable-channel(1)
> command).
> ```

Hi, 

The reason mostly boils down to the fact that we didn't see a use case for this. Hence, it's not implemented nor tested. 

Let me know if you have a use case for combining both features, though.

> 2. When automatic session rotate is running, is there any race condition in
> writing the current ring buffers and archiving the current trace chunk?

I am not sure I understand your question, but I think you're asking if session rotations are "atomic" with respect to the switchover of all per-CPU streams from one trace archive to the next?

The switchover is not instantaneous. The file output of each per-CPU stream is switched to the new trace archive sequentially. That leaves you with a window of time during which information, for a given stream, may be found in either the old trace archive or the new one. To be clear, no information is ever duplicated or lost during this operation. 

I briefly touched on this topic in a presentation at the Open Source Summit 2018, see slide 32+[1]

The various colours represent successive trace archives produced by session rotations.

This transition window makes writing analyses a bit harder since the beginning and end of trace archives may not have all of the information for all per-CPU streams during a short window of time. That window is contained between issuing the rotation and receiving a confirmation that it has been completed (using the CLI or the liblttng-ctl API). 

You can see that in that context, I chose to process trace archives in pairs to constitute an "effective trace archive" (slide 34) during which I can be sure I always have access to all events from all per-CPU streams.

Thanks,
Jérémie

[1] https://events19.linuxfoundation.org/wp-content/uploads/2017/12/Fine-grained-Distributed-Application-Monitoring-Using-LTTng-J%C3%A9r%C3%A9mie-Galarneau-EfficiOS.pdf

> --------------------------------------------------------------
> Regards,
> Subrata Paul

> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-05 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-21  6:47 [lttng-dev] Running trace-rotate and session-rotate together Subrata Paul via lttng-dev
2022-01-05 17:05 ` Jérémie Galarneau via lttng-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).