[lttng-dev] Printing to stdout and stderr from the userspace library.
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Wed Feb 4 12:11:39 EST 2015
----- Original Message -----
> From: "Glen Keane" <glenkeane.94 at gmail.com>
> To: lttng-dev at lists.lttng.org
> Sent: Wednesday, February 4, 2015 10:13:06 AM
> Subject: [lttng-dev] Printing to stdout and stderr from the userspace
> library.
> Hey Everybody,
> I'm currently working on getting Lttng tracepoints into node.js/iojs. iojs is
> a downstream fork of node.js, which I personally hope will be merged back
> into node.js, which will then include all my tracing work from iojs. I'm
> currently having some trouble with lttng userspace library printing to
> stdout/stderr from iojs however.
> I currently have a pull request issued on the iojs core (
> https://github.com/iojs/io.js/pull/702 ) and this could hopefully mean we
> will get lttng tracepoints into the project! :)
> I have hit an issue with my pull request, however. If you follow the link
> above you can see @bnoordhuis asked me about a test which I had to modify
> for this pull request. This particular test passes some variables to a child
> process, the child prints the variables to stdout/stderr, and the parent
> takes a pipe of the childs stdout/stderr and compares it to an expected
> stdout/stderr, and asserts they match. If they don't match, its a
> catastrophic failure and that single test fails.
> The issue here is that when you spawn a child process in node.js and pass it
> a custom ENV variable, the ENV variables available to the child process will
> not have access to any of the ENV variables of the parent process. This
> means there is no LTTNG_HOME or HOME env variables available to the child
> process. This then in turn means that when lttng's userspace library is
> instantiated it doesn't have access to either of those variables and spits
> out this warning to stderr:
> Warning: HOME environment variable not set. Disabling LTTng-UST per-user
> tracing.
> I accept this warning is warranted, as there is no tracing location available
> to the child process so therefore it cannot be traced, but it means that the
> test fails, as it does not expect this error to printed to stderr. I am
> looking for a way to silence the output of the library so this test doesn't
> need to be modified, and so I don't have to implicitly pass a child process
> the ENV HOME variable or LTTNG-HOME variable. The ability to clear all env
> variables being passed to a child is a design choice which is acceptable
> behaviour of io.js.
> I did not expect a library to print to stderr/stdout however, and I feel that
> this is something that may need to approached and rectified.
It makes sense to move the output of this library somewhere else than the console, but where,
and how could we override the behavior without adding an environment variable, which seems
to be impossible to use in your use-case ?
Thoughts ?
Thanks,
Mathieu
> Thanks for reading,
> Glen Keane.
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150204/6167d31d/attachment.html>
More information about the lttng-dev
mailing list