<div dir="ltr"><font face="arial, sans-serif"><span style="font-size:14px">Hi,everyone.At first ,thanks for jeremie's help. I have completed toolchain to gain  an understanding of how the different pieces fit together.Then, I'm going to through the studying the demo(/lttng-ust-2.4.0/doc/examples/demo) of lttng-ust to understand the working principle of lttng.But now,I am in trouble.</span></font><div>
<font face="arial, sans-serif"><span style="font-size:14px">In /lttng-ust-2.4.0/doc/examples/demo/demo.c </span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">##################</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">tracepoint(ust_test_demo2,done,42)</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">###################</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">I found the definition of tracepoint in /lttng-ust-2.4.0/include/lttng/tracepoint.h</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">############################################################</span></font></div>
<div><font face="arial, sans-serif"><div style="font-size:14px">#define tracepoint(provider, name, ...)<span class="" style="white-space:pre">                                  </span>    \</div><div style="font-size:14px"><span class="" style="white-space:pre">   </span>do {<span class="" style="white-space:pre">                                                              </span>    \</div>
<div style="font-size:14px"><span class="" style="white-space:pre">           </span>STAP_PROBEV(provider, name, ## __VA_ARGS__);<span class="" style="white-space:pre">              </span>    \</div><div style="font-size:14px"><span class="" style="white-space:pre">           </span>if (caa_unlikely(__tracepoint_##provider##___##name.state)) \</div>
<div style="font-size:14px"><span class="" style="white-space:pre">                   </span>__tracepoint_cb_##provider##___##name(__VA_ARGS__); \</div><div style="font-size:14px"><span class="" style="white-space:pre">     </span>} while (0)</div>
<div style="font-size:14px">#################################################################</div><div style="font-size:14px"><br></div><div style="font-size:14px">then i found the definition of "__tracepoint_cb_##provider##___##name(__VA_ARGS__)" in /lttng-ust-2.4.0/include/lttng/tracepoint.h line 158</div>
</font><font face="arial, sans-serif"><div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">########################################################################</span></div><div><span style="font-size:14px">void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__))<span class="" style="white-space:pre">           </span>\</span></div>
<div><span style="font-size:14px">{<span class="" style="white-space:pre">                                                                                      </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">        </span>struct tracepoint_probe *__tp_probe;<span class="" style="white-space:pre">                                              </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">                                                                                       </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">        </span>if (caa_unlikely(!TP_RCU_LINK_TEST()))<span class="" style="white-space:pre">                                            </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">               </span>return;<span class="" style="white-space:pre">                                                                   </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">        </span>tp_rcu_read_lock_bp();<span class="" style="white-space:pre">                                                            </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">       </span>__tp_probe = tp_rcu_dereference_bp(__tracepoint_##_provider##___##_name.probes); \</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">       </span>if (caa_unlikely(!__tp_probe))<span class="" style="white-space:pre">                                                    </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">               </span>goto end;<span class="" style="white-space:pre">                                                         </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">        </span>do {<span class="" style="white-space:pre">                                                                              </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">               </span>void (*__tp_cb)(void) = __tp_probe->func;<span class="" style="white-space:pre">                                      </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                </span>void *__tp_data = __tp_probe->data;<span class="" style="white-space:pre">                                    </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">                                                                                       </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                </span>URCU_FORCE_CAST(void (*)(_TP_ARGS_DATA_PROTO(__VA_ARGS__)), __tp_cb)<span class="" style="white-space:pre">      </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">                               </span>(_TP_ARGS_DATA_VAR(__VA_ARGS__));<span class="" style="white-space:pre">                 </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">        </span>} while ((++__tp_probe)->func);<span class="" style="white-space:pre">                                                        </span>\</span></div>
<div><span style="font-size:14px">end:<span class="" style="white-space:pre">                                                                                   </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">        </span>tp_rcu_read_unlock_bp();<span class="" style="white-space:pre">                                                  </span>\</span></div>
<div><span style="font-size:14px">}</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">#################################################################### </span></span></div></div><div>
<span style="font-size:14px"><span class="" style="white-space:pre"><br></span></span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">It seems that "</span></span><span style="font-size:14px">__tracepoint_##_provider##___##_name"  in  "</span><span style="font-size:14px">__tracepoint_##_provider##___##_name.probes" </span><span style="font-size:14px">is a struct of tracepoint.</span></div>
<div><span style="font-size:14px">we can found the macro TRACEPOINT_EVENT was used in "lttng-ust-2.4.0\doc\examples\demo\ust_tests_demo.h".And the struct of tracepoint was defined by the </span><span style="font-size:14px">macro TRACEPOINT_EVENT.But the </span><span style="font-size:14px">__tracepoint_##_provider##___##_name.probes was set to null.</span></div>
<div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">################################################# \lttng-ust-2.4.0\include\lttng\tracepoint.h line 342</span></div><div><div><span style="font-size:14px">#define _DEFINE_TRACEPOINT(_provider, _name, _args)<span class="" style="white-space:pre">                          </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">       </span>extern int __tracepoint_provider_##_provider; <span class="" style="white-space:pre">                            </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">        </span>static const char __tp_strtab_##_provider##___##_name[]<span class="" style="white-space:pre">                   </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">               </span>__attribute__((section("__tracepoints_strings"))) =<span class="" style="white-space:pre">             </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                        </span>#_provider ":" #_name;<span class="" style="white-space:pre">                                  </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">       </span>struct tracepoint __tracepoint_##_provider##___##_name<span class="" style="white-space:pre">                    </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                </span>__attribute__((section("__tracepoints"))) =<span class="" style="white-space:pre">                     </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">               </span>{<span class="" style="white-space:pre">                                                         </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                        </span>__tp_strtab_##_provider##___##_name,<span class="" style="white-space:pre">                      </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">                       </span>0,<span class="" style="white-space:pre">                                                        </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                        </span>NULL,<span class="" style="white-space:pre">                                                     </span>\---------------------------------------------->here is the probes.</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">                       </span>_TRACEPOINT_UNDEFINED_REF(_provider), <span class="" style="white-space:pre">                    </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                        </span>_TP_EXTRACT_STRING(_args),<span class="" style="white-space:pre">                                </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">                       </span>{ },<span class="" style="white-space:pre">                                                      </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                </span>};<span class="" style="white-space:pre">                                                                </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">       </span>static struct tracepoint * __tracepoint_ptr_##_provider##___##_name<span class="" style="white-space:pre">       </span>\</span></div><div><span style="font-size:14px"><span class="" style="white-space:pre">                </span>__attribute__((used, section("__tracepoints_ptrs"))) =<span class="" style="white-space:pre">          </span>\</span></div>
<div><span style="font-size:14px"><span class="" style="white-space:pre">                       </span>&__tracepoint_##_provider##___##_name;</span></div></div><div><span style="font-size:14px">###################################################################</span></div>
<div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">so i want to know that how the probes of the tracepoint struct  should be initialized,I can't find the source code.</span></div><div>
<span style="color:rgb(84,84,84);font-size:14px;line-height:18px">My english is poor,i hope you can understand what i mean. Thank you very much. </span><span style="font-size:14px"><br></span></div><div><span style="font-size:14px"><br>
</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px"><br></span></div></font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-03-15 9:24 GMT+08:00 ÎªÍõ <span dir="ltr"><<a href="mailto:xiaoxiao046@gmail.com" target="_blank">xiaoxiao046@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">thank you very much</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-15 1:35 GMT+08:00 J¨¦r¨¦mie Galarneau <span dir="ltr"><<a href="mailto:jeremie.galarneau@efficios.com" target="_blank">jeremie.galarneau@efficios.com</a>></span>:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Wed, Mar 12, 2014 at 6:05 AM, ÎªÍõ <<a href="mailto:xiaoxiao046@gmail.com" target="_blank">xiaoxiao046@gmail.com</a>> wrote:<br>


> Hi All,I am a graduate student from Beijing University of Posts and<br>
> Telecommunications. Due to my<br>
> experience in windows kernel development and debugging technique,I am very<br>
> interested in the lttng project.I want to make a contribution for the Clang<br>
> plugin providing automatic application instrumentation after reading the<br>
> project ideas for gsoc2014.I am also interested in reverse engineering and<br>
> binary hack.<br>
> The codes of lttng project have been downloaded for reading.Due to its large<br>
> amount,i couldn't figure out a good way to understand it.So,i want to konw<br>
> how should i proceed further.<br>
<br>
</div>You should start by trying the complete toolchain to gain an<br>
understanding of how the different pieces fit together. I wouldn't<br>
suggest simply jumping into the code.<br>
<br>
Have a look at the guidelines posted on our GSoC 2014 wiki for more<br>
information on how to submit a proposal [1].<br>
<br>
Let us know if you have more specific questions.<br>
<br>
J¨¦r¨¦mie<br>
<br>
[1] <a href="https://bugs.lttng.org/projects/lttng/wiki/Google_Summer_of_Code_2014#Guidelines-for-students-applying-to-GSoC" target="_blank">https://bugs.lttng.org/projects/lttng/wiki/Google_Summer_of_Code_2014#Guidelines-for-students-applying-to-GSoC</a><br>


<div><br>
> My english is poor,i hope you can understand what i mean. Thank you very<br>
> much.<br>
><br>
</div>> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br>
> <a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
><br>
<span><font color="#888888"><br>
<br>
<br>
--<br>
J¨¦r¨¦mie Galarneau<br>
EfficiOS Inc.<br>
<a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a><br>
</font></span></blockquote></div></div></div><br></div>
</blockquote></div><br></div>