<div dir="ltr">Sorry, I’m answering my own question:<br><br>When I built a new kernel with “CONFIG_MODULE_SIG” disabled, the probes in my loadable driver started working.<br><div><br></div><div>It would be helpful to have this documented in the tutorial on kernel tracing.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 3:46 PM, Joe VanAndel <span dir="ltr"><<a href="mailto:vanandel@ucar.edu" target="_blank">vanandel@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin:0px;font-size:12px;font-family:Helvetica">I’m trying to add LTTng probes to a driver module, but I don’t get any output from my probe in the LTTng session.</p><p style="margin:0px;font-size:12px;font-family:Helvetica"><br></p><p style="margin:0px;font-size:12px;font-family:Helvetica">Any idea what else I need to configure to get the output from my probe?</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Kernel: 3.10.0</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">OS:  Centos 7.1.1503</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">LTTng tools : from EfficiOS-RHEL7-x86-64 repository</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">lttng-modules:  2.6.2</p><p style="margin:0px;font-size:12px;font-family:Helvetica"><br></p><p style="margin:0px;font-size:12px;font-family:Helvetica">The running kernel has the following enabled:</p><p style="margin:0px;font-size:12px;font-family:Helvetica">CONFIG_MODULES</p><p style="margin:0px;font-size:12px;font-family:Helvetica">CONFIG_KALLSYMS</p><p style="margin:0px;font-size:12px;font-family:Helvetica">CONFIG_HIGH_RES_TIMERS</p><p style="margin:0px;font-size:12px;font-family:Helvetica">CONFIG_TRACEPOINTS</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">I’ve defined/used tracepoints in my driver with the mainline TRACE_EVENT() macros.  My tracepoints are on the open/close entry points of the device.</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">I’ve added the LTTng adaptation layer for my probe in LTTng-modules. </p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">I’ve started the daemon to load my custom probe</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica"> lttng-sessiond -d --extra-kmod-probes=db2k</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">I’ve verified that my event is available, by running</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">lttng list --kernel | grep db2k</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">      db2k_hello (loglevel: TRACE_EMERG (0)) (type: tracepoint)</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">There’s an entry for my probe in </p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">/sys/kernel/debug/tracing/events/db2k/db2k_hello</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">When I run the following as root:</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">lttng create trace_db2k</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">lttng enable-event --kernel --tracepoint db2k_hello --tracepoint kmem_kmalloc --tracepoint kmem_kfree \</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">     --tracepoint timer_start --tracepoint timer_cancel</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">lttng start</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">———————</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">the output is:</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Session trace_db2k created.</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Traces will be written in /root/lttng-traces/trace_db2k-20150804-193318</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Kernel event db2k_hello created in channel channel0</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Tracing started for session trace_db2k</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">===========</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica"> I run a test program that uses the driver, and then stop the session.</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica"># lttng stop</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Waiting for data availability.</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Tracing stopped for session trace_db2k</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica"># lttng view</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica">Trace directory: /root/lttng-traces/trace_db2k-20150804-193318</p>
<p style="margin:0px;font-size:12px;font-family:Helvetica"><No output></p><p style="margin:0px;font-size:12px;font-family:Helvetica"><br></p><p style="margin:0px;font-size:12px;font-family:Helvetica">Here is the “mainline” db2k.h</p><p style="margin:0px;font-size:12px;font-family:Helvetica"><a href="http://pastebin.com/0i8eWF1a" target="_blank">http://pastebin.com/0i8eWF1a</a><br></p><p style="margin:0px;font-size:12px;font-family:Helvetica"><br></p><p style="margin:0px;font-size:12px;font-family:Helvetica">Here is the </p><p style="margin:0px;font-family:Helvetica"><span style="color:rgb(51,51,51);font-family:'segoe ui','trebuchet MS','Lucida Sans Unicode','Lucida Sans',sans-serif;line-height:18px">LTTng adaptation db2k.h</span><br></p><p style="margin:0px;font-size:12px;font-family:Helvetica"><a href="http://pastebin.com/fXW9ppqM" target="_blank">http://pastebin.com/fXW9ppqM</a><span style="color:rgb(51,51,51);font-family:'segoe ui','trebuchet MS','Lucida Sans Unicode','Lucida Sans',sans-serif;font-size:15.3600006103516px;font-weight:bold;line-height:18px"><br></span></p><p style="margin:0px;font-size:12px;font-family:Helvetica"><br></p><p style="margin:0px;font-size:12px;font-family:Helvetica">Here is the </p><p style="margin:0px;font-size:12px;font-family:Helvetica">lttng-probe-db2k.c</p><p style="margin:0px;font-size:12px;font-family:Helvetica"><a href="http://pastebin.com/WHuWKpPZ" target="_blank">http://pastebin.com/WHuWKpPZ</a><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br></p>
<p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px">The drive contains the lines:</p><p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px">#define CREATE_TRACE_POINTS</p><p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px">#include "trace/events/db2k.h"</p><div><br></div><div><div>static int</div><div>db2k_open(struct inode *inode, struct file *file)</div><div>{</div><div>    int minor = MINOR(inode->i_rdev);</div><div>    int stat = 0;</div><div>    DEVICE_EXTENSION *pde = NULL;</div><div>    dbg("db2k_open called");</div><div>    trace_db2k_hello(minor, "open");</div></div><div>.</div><div>.</div><div>}</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr">Joe VanAndel<div>NCAR/EOL</div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Joe VanAndel<div>NCAR/EOL</div></div></div>
</div>