Skip to contentSkip to conversation

lttng command line user-friendliness

DISCUSSION Francis Giraldeau 4 participants 5 messages Sep 10, 2012 – Sep 11, 2012 3 messages not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 6 lines · Paul

What about adding something similar to "perf record" to lower the barrier for such users. For example:

lttng record [--session-name <name>] [--session-template <session_template_file>] -- <command> [<options>]

Quoted 8 lines

Where the optional session_template_file may only contain "enable-channel, enable-event and add-context" commands. If omitted the following could be the (trivial) default session template:

enable-event -u -a

Would this make sense for others as well ? Any alternative suggestions ?

I totally agree with you. For that purpose, I did a small python script lttng-simple that wraps commands and create a trace in the current directory, like perf does. While it does what I need, a more generic solution should be provided using the API instead of the ugly command line subprocess ;)

https://github.com/giraldeau/workload-kit/tree/master/utils

Cheers,

Francis

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

#2 lore raw
In reply to a message not in the archive

+1, Like, etc.

The following bug was opened some time ago: http://bugs.lttng.org/issues/15

From what is said in the bug, it will require both the flight-recorder mode in the tracer, and the live-trace-reading feature in Babeltrace. Those are not implemented yet, but they shouldn't be too far around from what I can tell (2.2 maybe?).

Cheers,
Alexandre

Quoted 44 lines · Paul

As much as I like the lttng command line tool (that we have since LTTng2) I still see people (who are not yet familiar with lttng) struggle with the simple fact that it takes more than one command to actually get something traced.

Issuing a sequence of commands like:

lttng create
lttng enable-event -u -a
lttng start
my_foobar_traced_application 1 2 3
lttng stop
lttng destroy

seems to be perceived as complicated compared to:

perf record -- my_foobar_traced_application 1 2 3

My argument usually is that providing detailed settings as options (like perf) does not scale as well as the lttng approach (if you have more things to configure). On the other hand most users just want something like the above. Also arguing that they should write a shell-script that encodes their use case generally causes irritation ("... please understand, I do not want to write a shell-script I just want to do simple tracing of my executable ...").

What about adding something similar to "perf record" to lower the barrier for such users. For example:

lttng record [--session-name <name>] [--session-template <session_template_file>] -- <command> [<options>]

Where the optional session_template_file may only contain "enable-channel, enable-event and add-context" commands. If omitted the following could be the (trivial) default session template:

enable-event -u -a

Would this make sense for others as well ? Any alternative suggestions ?

Thanks,
Paul

#3 lore raw
In reply to a message not in the archive

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi Paul,

Woegerer, Paul:

Quoted 10 lines

As much as I like the lttng command line tool (that we have since LTTng2) I still see people (who are not yet familiar with lttng) struggle with the simple fact that it takes more than one command to actually get something traced.

Issuing a sequence of commands like:

lttng create lttng enable-event -u -a lttng start my_foobar_traced_application 1 2 3 lttng stop lttng destroy

Small note here that the "destroy" is not needed. The stop forces a subbuffer switch meaning that the current data collected is written to the trace files.

Quoted 23 lines

seems to be perceived as complicated compared to:

perf record -- my_foobar_traced_application 1 2 3

My argument usually is that providing detailed settings as options (like perf) does not scale as well as the lttng approach (if you have more things to configure). On the other hand most users just want something like the above. Also arguing that they should write a shell-script that encodes their use case generally causes irritation ("... please understand, I do not want to write a shell-script I just want to do simple tracing of my executable ...").

What about adding something similar to "perf record" to lower the barrier for such users. For example:

lttng record [--session-name <name>] [--session-template <session_template_file>] -- <command> [<options>]

Where the optional session_template_file may only contain "enable-channel, enable-event and add-context" commands. If omitted the following could be the (trivial) default session template:

Quoted 5 lines

enable-event -u -a

Would this make sense for others as well ? Any alternative suggestions ?

This totally makes sense and is also something we are looking to do for a long time.

We were thinking of a "lttng trace [...]" command that would wrap the session creation, enabling all events for a domain (kernel or/and user space) and start the trace by outputting either the trace live like strace or at an output destination. For the live tracing, it's our next step right NOW so the next 2.2 version *should* have this and would make total sense also to have this command!

To be honest, we have almost everything (on the technical side) to create this command (except the live tracing), we just don't have it now because of a priority/time issue :).

I would however encourage everyone on this list who is willing to continue this thread in order to come up with a small RFC for the command.

RFC/Discussion:

lttng record [--session-name <name>] [--session-template <session_template_file>] -- <command> [<options>]

Either "trace" or "record", I guess it's a simple aesthetic choice here :).

With more options here to set either a custom destination or live trace. What's the default? (no opts given). I would personally go for a default one being to record in the session default trace files and add a "-l" for the live.

	-o, --output=DST
	-l, --live

Add a domain option where nothing enables kernel AND ust or else the command can take either -u or -k.

Please, contribute to this, no bad ideas, only bad answers! :)

Cheers and thanks Paul for comment!
David

Quoted 3 lines

Thanks, Paul

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCgAGBQJQTgB+AAoJEELoaioR9I02zzoIAMd+nG8KLZnmHiFQU9Tcqq9Q N+jLVU/JjMuzjpQluD+1Xe3O9yLDu/mEqGAddYBQ5RnkHS7DveFwfY697nESqJPR qV0Y3ajbIC30WMrnweZSypsj9xAv33ZzFn4C/DuYIylicqpcX8mxcMgLzI9duoRQ /kxOqIeBLvl5C/pFSR55vki3fxhHPg67f2S9TgFDiBEPmaL0UkxpfOaB3G86Bj8z Kp7oKCCbQzv0R3J4BlcNRNUXKTClo3Qjb/ZyWGgFwwErZJoADcd+osvIU9raA7MY yEEExx5t4OMjEyrb3eqJgihH+xMx6eW1275vz2TV4ayBIg1YuJrIzUY/zgVkYn0= =f6QB
-----END PGP SIGNATURE-----

#5 lore raw
In reply to a message not in the archive
Quoted 8 lines · David Goulet

Issuing a sequence of commands like:

lttng create lttng enable-event -u -a lttng start my_foobar_traced_application 1 2 3 lttng stop lttng destroy

Small note here that the "destroy" is not needed. The stop forces a subbuffer switch meaning that the current data collected is written to the trace files.

Agreed, "destroy" is pointless. Also the user would want to have the result of "lttng record" visible when it runs "lttng list" afterwards.

Quoted 10 lines

I would however encourage everyone on this list who is willing to continue this thread in order to come up with a small RFC for the command.

RFC/Discussion:

lttng record [--session-name <name>] [--session-template <session_template_file>] -- <command> [<options>]

Either "trace" or "record", I guess it's a simple aesthetic choice here :).

Using command name "trace" makes more sense. "record" does not go so well with "--live" (where nothing gets actually recorded).

So far [--session-template <session_template_file>] leaves open where to look for session_template_files if no absolute path is given. It might be good to also have a user specific directory (e.g. .lttng/session-templates) in addition to a system wide directory (e.g. /etc/lttng/session-templates).

--
Paul

Quoted 28 lines

With more options here to set either a custom destination or live trace. What's the default? (no opts given). I would personally go for a default one being to record in the session default trace files and add a "-l" for the live.

	-o, --output=DST
	-l, --live

Add a domain option where nothing enables kernel AND ust or else the command can take either -u or -k.

Please, contribute to this, no bad ideas, only bad answers! :)

Cheers and thanks Paul for comment!
David

Quoted 2 lines

Thanks, Paul

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCgAGBQJQTgB+AAoJEELoaioR9I02zzoIAMd+nG8KLZnmHiFQU9Tcqq9Q N+jLVU/JjMuzjpQluD+1Xe3O9yLDu/mEqGAddYBQ5RnkHS7DveFwfY697nESqJPR qV0Y3ajbIC30WMrnweZSypsj9xAv33ZzFn4C/DuYIylicqpcX8mxcMgLzI9duoRQ /kxOqIeBLvl5C/pFSR55vki3fxhHPg67f2S9TgFDiBEPmaL0UkxpfOaB3G86Bj8z Kp7oKCCbQzv0R3J4BlcNRNUXKTClo3Qjb/ZyWGgFwwErZJoADcd+osvIU9raA7MY yEEExx5t4OMjEyrb3eqJgihH+xMx6eW1275vz2TV4ayBIg1YuJrIzUY/zgVkYn0= =f6QB
-----END PGP SIGNATURE-----

Signature · 8 lines
Paul Woegerer | SW Development Engineer
http://go.mentor.com/sourceryanalyzer

Mentor Embedded(tm) | Prinz Eugen Straße 72/2/4, Vienna, 1040 Austria
Nucleus® | Linux® | Android(tm) | Services | UI | Multi-OS

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
#7 lore raw
In reply to a message not in the archive
Quoted 6 lines · Paul
Quoted 5 lines · David Goulet

With more options here to set either a custom destination or live trace. What's the default? (no opts given). I would personally go for a default one being to record in the session default trace files and add a "-l" for the live.

Quoted 7 lines
Quoted 7 lines
    -o, --output=DST
    -l, --live

Add a domain option where nothing enables kernel AND ust or else the command can take either -u or -k.

Please, contribute to this, no bad ideas, only bad answers! :)

While sleeping over it two more things came to my mind:

*) The exit status of the <command> that gets trace-executed with "lttng trace <command> [<options>]" would need to be forwarded to the exit status of the wrapping lttng. This would allow users to use "lttng trace" as a drop-in replacement in contexts where the return value of the invoked <command> cannot be ignored.

*) There should be something like "-q [<logfile>], --quiet [<logfile>]" where the output of the traced <command> does not get mixed with lttng info/debug/error output. If the optional <logfile> is given all lttng relevant communication should go into the <logfile>.

Example without --quiet:

Session met-2012-09-11_09-08-30 created.
Traces will be written in
/home/pwoegere/lttng-traces/met-2012-09-11_09-08-30-20120911-090830
UST channel met_tools enabled for session met-2012-09-11_09-08-30
UST event met_func:* created in channel met_tools
UST event met_call:* created in channel met_tools
Error: Events: Tracing the kernel requires a root lttng-sessiond
daemon and "tracing" group user membership (channel channel0, session met-2012-09-11_09-08-30)
Tracing started for session met-2012-09-11_09-08-30
Solved
MultiThread done...
delta 131673329
Tracing stopped for session met-2012-09-11_09-08-30
Session met-2012-09-11_09-08-30 destroyed

Example with --quiet

Solved
MultiThread done...
delta 131673329

--
PaulW

Signature · 8 lines
Paul Woegerer | SW Development Engineer
http://go.mentor.com/sourceryanalyzer

Mentor Embedded(tm) | Prinz Eugen Straße 72/2/4, Vienna, 1040 Austria
Nucleus® | Linux® | Android(tm) | Services | UI | Multi-OS

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.