<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><div><span id="zwchr" data-marker="__DIVIDER__">----- On Oct 7, 2019, at 12:42 PM, Yonghong Yan <yanyh15@gmail.com> wrote:<br></span></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Thank you. </div><br><div>I got most. To confirm, I have two header files, each defines its own tracepoint, they are from the same provider. The source files that use the header files have its own #define TRACEPOINT_CREATE_PROBES and #define TRACEPOINT_DEFINE. This won't work since two files have those defines. But if I remove #define TRACEPOINT_CREATE_PROBES#define TRACEPOINT_DEFINE from one of the two .c file, it should work. </div></div></div></div></div></div></div></div></div></div></blockquote><div>The example below is bogus.<br></div><div><br data-mce-bogus="1"></div><div>Each of your tp_one.h and tp_two.h should have its own provider name, not "hello_world" for both.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>You should _only_ have a single header implementation file per provider name within an application.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>In my previous email, I was only refering to a case where you would want to define+create probes within<br data-mce-bogus="1"></div><div>a compile unit, and use the tracepoints (call them) from various other compile units in the program.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Mathieu<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><div>tp_one.h file:</div><br><div><pre class="gmail-src" style="margin-top:0px;margin-bottom:0px;padding:10px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:rgba( 0 , 0 , 0 , 0.05 );color:rgb( 26 , 26 , 26 )"><span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#undef TRACEPOINT_PROVIDER</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_PROVIDER hello_world</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#undef TRACEPOINT_INCLUDE</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_INCLUDE "./tp_one.h"</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#if !defined(_TP_ONE_H) || defined(TRACEPOINT_HEADER_MULTI_READ)</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define _TP_ONE_H</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#include</span> <span class="gmail-cpf" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline"><lttng/tracepoint.h></span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">TRACEPOINT_EVENT</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">hello_world</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_first_tracepoint</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">TP_ARGS</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span>
<span class="gmail-kt" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 68 , 85 , 136 )">int</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_integer_arg</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span>
<span class="gmail-kt" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 68 , 85 , 136 )">char</span><span class="gmail-o" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 0 , 0 , 0 )">*</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_string_arg</span>
<span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">),</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">TP_FIELDS</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">ctf_string</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span><span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_string_field</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_string_arg</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">ctf_integer</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span><span class="gmail-kt" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 68 , 85 , 136 )">int</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_integer_field</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_integer_arg</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#endif </span><span class="gmail-cm" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 136 )">/* _TP_ONE_H */</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#include</span> <span class="gmail-cpf" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline"><lttng/tracepoint-event.h></span></pre></div><div dir="ltr"><br></div><div dir="ltr"><div style="margin:0px;padding:3px 10px 5px;border:0px;font-size:10.5px;line-height:inherit;font-family:'open sans' , 'frutiger' , 'frutiger linotype' , 'univers' , 'calibri' , 'gill sans' , 'gill sans mt' , 'myriad pro' , 'myriad' , 'dejavu sans condensed' , 'liberation sans' , 'nimbus sans l' , 'tahoma' , 'geneva' , 'helvetica neue' , 'helvetica' , 'arial' , sans-serif;vertical-align:baseline;background-color:rgb( 218 , 224 , 224 );color:rgb( 26 , 26 , 26 )"><p style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:11.2px;line-height:16.8px;font-family:inherit;vertical-align:baseline;color:rgb( 86 , 101 , 102 )"><code class="gmail-file" style="margin:0px 1px;padding:2px 0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:10.08px;line-height:inherit;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:transparent;white-space:nowrap">tp_one.c</code></p></div><pre class="gmail-src" style="margin-top:0px;margin-bottom:0px;padding:10px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:rgba( 0 , 0 , 0 , 0.05 );color:rgb( 26 , 26 , 26 )"><span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_CREATE_PROBES</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_DEFINE</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#include</span> <span class="gmail-cpf" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">"tp_one.h"</span></pre></div><div dir="ltr"><br></div><div dir="ltr"><div>tp_two.h file:</div><br><div><pre class="gmail-src" style="margin-top:0px;margin-bottom:0px;padding:10px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:rgba( 0 , 0 , 0 , 0.05 );color:rgb( 26 , 26 , 26 )"><span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#undef TRACEPOINT_PROVIDER</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_PROVIDER hello_world</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#undef TRACEPOINT_INCLUDE</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_INCLUDE "./tp_two.h"</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#if !defined(_TP_TWO_H) || defined(TRACEPOINT_HEADER_MULTI_READ)</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define _TP_TWO_H</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#include</span> <span class="gmail-cpf" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline"><lttng/tracepoint.h></span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">TRACEPOINT_EVENT</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">hello_world</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_second_tracepoint</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">TP_ARGS</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span>
<span class="gmail-kt" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 68 , 85 , 136 )">int</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_integer_arg</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span>
<span class="gmail-kt" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 68 , 85 , 136 )">char</span><span class="gmail-o" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 0 , 0 , 0 )">*</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_string_arg</span>
<span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">),</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">TP_FIELDS</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">ctf_string</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span><span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_string_field</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_string_arg</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">ctf_integer</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">(</span><span class="gmail-kt" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 68 , 85 , 136 )">int</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_integer_field</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">,</span> <span class="gmail-n" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">my_integer_arg</span><span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-p" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">)</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#endif </span><span class="gmail-cm" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 136 )">/* _TP_TWO_H */</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#include</span> <span class="gmail-cpf" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline"><lttng/tracepoint-event.h></span></pre></div><div dir="ltr"><br></div><div dir="ltr"><div style="margin:0px;padding:3px 10px 5px;border:0px;font-size:10.5px;line-height:inherit;font-family:'open sans' , 'frutiger' , 'frutiger linotype' , 'univers' , 'calibri' , 'gill sans' , 'gill sans mt' , 'myriad pro' , 'myriad' , 'dejavu sans condensed' , 'liberation sans' , 'nimbus sans l' , 'tahoma' , 'geneva' , 'helvetica neue' , 'helvetica' , 'arial' , sans-serif;vertical-align:baseline;background-color:rgb( 218 , 224 , 224 );color:rgb( 26 , 26 , 26 )"><p style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:11.2px;line-height:16.8px;font-family:inherit;vertical-align:baseline;color:rgb( 86 , 101 , 102 )"><code class="gmail-file" style="margin:0px 1px;padding:2px 0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:10.08px;line-height:inherit;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:transparent;white-space:nowrap">tp_two.c</code></p></div><pre class="gmail-src" style="margin-top:0px;margin-bottom:0px;padding:10px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:rgba( 0 , 0 , 0 , 0.05 );color:rgb( 26 , 26 , 26 )"><span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_CREATE_PROBES</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#define TRACEPOINT_DEFINE</span>
<span class="gmail-cp" style="margin:0px;padding:0px;border:0px;font-style:italic;font-variant:inherit;font-weight:700;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;color:rgb( 153 , 153 , 153 )">#include</span> <span class="gmail-cpf" style="margin:0px;padding:0px;border:0px;font:inherit;vertical-align:baseline">"tp_two.h"</span></pre></div></div></div></div></div></div></div></div></div></div><br><div>hello.c</div><div>use the two tracepoints defined in the two files. </div><br><div>To compile (compile file one by one). </div><pre class="gmail-commands" style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:transparent;color:rgba( 0 , 0 , 0 , 0.75 )">gcc -o hello tp-one.c tp-two.c hello.c -llttng-ust -ldl</pre><pre class="gmail-commands" style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:transparent;color:rgba( 0 , 0 , 0 , 0.75 )"><br></pre><pre class="gmail-commands" style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:transparent;color:rgba( 0 , 0 , 0 , 0.75 )"><br></pre><pre class="gmail-commands" style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px;font-size:10.5px;line-height:13.125px;font-family:'andale mono wt' , 'andale mono' , 'bitstream vera sans mono' , 'liberation mono' , 'nimbus mono l' , 'ubuntu mono' , 'monaco' , 'consolas' , 'lucida console' , 'lucida sans typewriter' , 'courier new' , 'courier' , monospace;vertical-align:baseline;background-color:transparent;color:rgba( 0 , 0 , 0 , 0.75 )"><br></pre><div class="elided-text"><div dir="ltr">On Mon, Oct 7, 2019 at 12:22 PM Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank" rel="nofollow noopener noreferrer">mathieu.desnoyers@efficios.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb( 204 , 204 , 204 );padding-left:1ex"><br>
<br>
----- On Oct 7, 2019, at 9:59 AM, Yonghong Yan <a href="mailto:yanyh15@gmail.com" target="_blank" rel="nofollow noopener noreferrer">yanyh15@gmail.com</a> wrote:<br>
<br>
> For lttng-ust, can I put the tracepoint definition in two files, but they use<br>
> the same provider.<br>
<br>
Based on the terminology here: <a href="https://lttng.org/docs/v2.10/#doc-tracing-your-own-user-application" rel="noreferrer nofollow noopener noreferrer" target="_blank">https://lttng.org/docs/v2.10/#doc-tracing-your-own-user-application</a><br>
<br>
You need to have at most one instance of your tracepoint provider where<br>
the header is included with TRACEPOINT_CREATE_PROBES, and exactly one<br>
instance where TRACEPOINT_DEFINE is defined. (both can end up being within<br>
the same object if you wish).<br>
<br>
Then you can include your tracepoint provider header file at will across<br>
other compile units in your program. Just make sure none of <br>
TRACEPOINT_CREATE_PROBES nor TRACEPOINT_DEFINE are defined in those other<br>
compile units. You can therefore call tracepoints from a given probe from<br>
various compile units in your program.<br>
<br>
Hoping this helps clarifying things,<br>
<br>
Mathieu<br>
<br>
> Thank you.<br>
> Yonghong<br>
<br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org" target="_blank" rel="nofollow noopener noreferrer">lttng-dev@lists.lttng.org</a><br>
> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer nofollow noopener noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
-- <br>
Mathieu Desnoyers<br>
EfficiOS Inc.<br>
<a href="http://www.efficios.com" rel="noreferrer nofollow noopener noreferrer" target="_blank">http://www.efficios.com</a><br>
</blockquote></div></div>
<br>_______________________________________________<br>lttng-dev mailing list<br>lttng-dev@lists.lttng.org<br>https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev<br></blockquote></div><div><br></div><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>