[lttng-dev] Reg. Questions on LTTng Application Specific Context variable filtering for Ericsson TRACE component

Varsha Samal varsha.samal at tcs.com
Tue Mar 15 14:51:39 UTC 2016


Hi,

I'm working on Latest LTTng with below commit IDs for Ericsson Trace 
Project 

LTTng-UST:           2ef5e79d1f40ce7110d9ad581bb467a9109afeb5
LTTng-Tools:         b6ba0c85112e48eb1557a2b53542dbd3008e0ca0

We are facing an issue in identifying the way to use $app in LTTng filter. 
The issue is like follows-

SC-2-1:/home/test-apps # lttng create
Session auto-20160315-164851 created.
Traces will be written in /root/lttng-traces/auto-20160315-164851
SC-2-1:/home/test-apps # lttng enable-event a -j -a --filter '$ctx.vpid >= 
0 && $ctx.vpid < 40000'
Filter '$ctx.vpid >= 0 && $ctx.vpid < 40000' successfully set

Then start the java test application-

SC-2-1:/home/test-apps # lttng start
Tracing started for session auto-20160315-164851
SC-2-1:/home/test-apps # lttng stop
Waiting for data availability.
Tracing stopped for session auto-20160315-164851
SC-2-1::/home/test-apps # lttng view
[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 }

We are able to see logs using $ctx as a filter parameter. 

The question is how do we use $app in place of $ctx to get the logs. We 
checked for LTTng documentation, but were unable to find something useful 
in this context. 

We used the example java file in lttng-ust location-

lttng-ust/doc/examples/java-jul/ApplicationContextExample.java

and used it in our test-app with the following variable values-

    private static final String RETRIEVER_NAME = "com_ericsson";
    private static final String CONTEXT_NAME_STRING = "pid";
    private static final String CONTEXT_NAME_SHORT = "ppid";

We have been able to see the logs (with lttng add-context)-

SC-2-1:/home/test-apps # lttng create
Session auto-20160315-165635 created.
Traces will be written in /root/lttng-traces/auto-20160315-165635
SC-2-1:/home/test-apps # lttng enable-event -j -a
All JUL events are enabled in channel channel0
SC-2-1:/home/test-apps # lttng add-context -u -t '$app.com_ericsson:pid'
UST context $app.com_ericsson:pid added to all channels
SC-2-1:/home/test-apps # lttng start
Tracing started for session auto-20160315-165635
SC-2-1:/home/test-apps # lttng stop
Waiting for data availability.
Tracing stopped for session auto-20160315-165635
SC-2-1:/home/test-apps # lttng view
[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 }

We are also able to notice loggers if we enable a session with filters 
without prefixes.

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. 

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.

Thanks a lot. 

Best Regards,
Varsha

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20160315/aa655c38/attachment.html>


More information about the lttng-dev mailing list