[lttng-dev] Fast way to clear trace logs and continue tracing?

Douglas Graham douglas.graham at ericsson.com
Wed Dec 14 02:41:38 UTC 2016


Hi,

I just started working with lttng recently, so apologies if this is a dumb question.

Suppose I have configured and started a session and have collected a bunch of traces in a trace file.  Now I want to clear those traces but then continue saving new traces using the same session.  Is there a reasonably fast way to do that?

What we currently do is "lttng save --output-path=x.cfg; lttng stop; lttng destroy; rm -rf <tracedir>; lttng load --input-path=x.cfg

But this is very slow in some cases.  The lttng load in particular is extremely slow when Linux is running inside a virtual machine.  I was hoping that lttng might support a "lttng clear" that could be used to remove all traces from the trace file, but I can't find any such command.

I note that lttng does support the rotating of trace files when they reach a size limit.  I think that's fairly close to what I want.  If I could force a trace file rotation at an arbitrary time and then simple remove the old rotated log, leaving the new one, that seems like it should do the job.  Except I don't see any way to force a rotation.

Any ideas?

Thanks,
Doug


More information about the lttng-dev mailing list