<font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I'm working on Latest LTTng with below
commit IDs for Ericsson Trace Project </font>
<br>
<br><font size=2 face="sans-serif">LTTng-UST:
2ef5e79d1f40ce7110d9ad581bb467a9109afeb5</font>
<br><font size=2 face="sans-serif">LTTng-Tools:
b6ba0c85112e48eb1557a2b53542dbd3008e0ca0</font>
<br>
<br><font size=2 face="sans-serif">We are facing an issue in identifying
the way to use $app in LTTng filter. The issue is like follows-</font>
<br>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng create</font>
<br><font size=2 face="sans-serif">Session auto-20160315-164851 created.</font>
<br><font size=2 face="sans-serif">Traces will be written in /root/lttng-traces/auto-20160315-164851</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng enable-event a -j -a --filter '$ctx.vpid >= 0 && $ctx.vpid
< 40000'</font>
<br><font size=2 face="sans-serif">Filter '$ctx.vpid >= 0 &&
$ctx.vpid < 40000' successfully set</font>
<br>
<br><font size=2 face="sans-serif">Then start the java test application-</font>
<br>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng start</font>
<br><font size=2 face="sans-serif">Tracing started for session auto-20160315-164851</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng stop</font>
<br><font size=2 face="sans-serif">Waiting for data availability.</font>
<br><font size=2 face="sans-serif">Tracing stopped for session auto-20160315-164851</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1::/home/test-apps
# lttng view</font>
<br><font size=2 color=#0000a1 face="sans-serif">[16:49:20.291293478] (+0.000087520)
SC-2-1 lttng_jul:event: { cpu_id = 0 }, { msg = "KiloPerSec : my_time
= 16:49:19, OnePs = 1, TenPs = 9, HundredPs = 4, KiloPs = 2", logger_name
= "com.ericsson.common.trace.testapp_thread.testthread", class_name
= "CBF_testapp.TestThread", method_name = "run", long_millis
= 1458060560291, int_loglevel = 300, int_threadid = 15 }</font>
<br>
<br><font size=2 face="sans-serif">We are able to see logs using<b> $ctx</b>
as a filter parameter. </font>
<br>
<br><font size=2 face="sans-serif">The question is how do we use <b>$app</b>
in place of<b> $ctx</b> to get the logs. We checked for LTTng documentation,
but were unable to find something useful in this context. </font>
<br>
<br><font size=2 face="sans-serif">We used the example java file in lttng-ust
location-</font>
<br>
<br><font size=2 color=#0000e0 face="sans-serif">lttng-ust/doc/examples/java-jul/ApplicationContextExample.java</font>
<br>
<br><font size=2 face="sans-serif">and used it in our test-app with the
following variable values-</font>
<br>
<br><font size=2 face="sans-serif"> </font><font size=2 color=#0000e0 face="sans-serif">
private static final String RETRIEVER_NAME = "com_ericsson";</font>
<br><font size=2 color=#0000e0 face="sans-serif"> private
static final String CONTEXT_NAME_STRING = "pid";</font>
<br><font size=2 color=#0000e0 face="sans-serif"> private
static final String CONTEXT_NAME_SHORT = "ppid";</font>
<br>
<br><font size=2 face="sans-serif">We have been able to see the logs (with
lttng add-context)-</font>
<br>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng create</font>
<br><font size=2 face="sans-serif">Session auto-20160315-165635 created.</font>
<br><font size=2 face="sans-serif">Traces will be written in /root/lttng-traces/auto-20160315-165635</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng enable-event -j -a</font>
<br><font size=2 face="sans-serif">All JUL events are enabled in channel
channel0</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng add-context -u -t '$app.com_ericsson:pid'</font>
<br><font size=2 face="sans-serif">UST context $app.com_ericsson:pid added
to all channels</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng start</font>
<br><font size=2 face="sans-serif">Tracing started for session auto-20160315-165635</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng stop</font>
<br><font size=2 face="sans-serif">Waiting for data availability.</font>
<br><font size=2 face="sans-serif">Tracing stopped for session auto-20160315-165635</font>
<br><font size=2 color=#0000e0 face="sans-serif">SC-2-1:/home/test-apps
# lttng view</font>
<br><font size=2 color=#0000a1 face="sans-serif">[16:57:18.251115165] (+0.000046477)
SC-2-1 lttng_jul:event: { cpu_id = 0 }, { _app_com_ericsson_pid_tag = (
"_none" : container = 0 ), _app_com_ericsson_pid = { none = {
} } }, { msg = "KiloPerSec : my_time = 16:57:18, OnePs = 2, TenPs
= 2, HundredPs = 3, KiloPs = 4", logger_name = "com.ericsson.common.trace.testapp_thread.testthread",
class_name = "CBF_testapp.TestThread", method_name = "run",
long_millis = 1458061038251, int_loglevel = 300, int_threadid = 15 }</font>
<br>
<br><font size=2 face="sans-serif">We are also able to notice loggers if
we <b>enable a session with filters without prefixes</b>.</font>
<br>
<br><font size=2 face="sans-serif">Could you please help us find out the
way of making proper usage of $app as the prefix in lttng enable-event
command with filter. </font>
<br>
<br><font size=2 face="sans-serif">It would be good if you could share
us a Java sample test application with Context stuff , list of proper LTTng
CLI commands and exact LTTng CTL call to be used for activation.</font>
<br>
<br><font size=2 face="sans-serif">Thanks a lot. </font>
<br>
<br><font size=2 face="sans-serif">Best Regards,</font>
<br><font size=2 face="sans-serif">Varsha</font>
<br>
<br><p>=====-----=====-----=====<br>
Notice: The information contained in this e-mail<br>
message and/or attachments to it may contain <br>
confidential or privileged information. If you are <br>
not the intended recipient, any dissemination, use, <br>
review, distribution, printing or copying of the <br>
information contained in this e-mail message <br>
and/or attachments to it are strictly prohibited. If <br>
you have received this communication in error, <br>
please notify us by reply e-mail or telephone and <br>
immediately and permanently delete the message <br>
and any attachments. Thank you</p>
<p></p>