<div dir="ltr"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I am not sure whether this is a bug or the wrong I am using it. When I use extern declaration as follows, I always have compilation error. I used the easy-ust to demonstrate: </div><div dir="ltr"><br></div><div dir="ltr">
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><b>diff --git a/doc/examples/easy-ust/sample_component_provider.h b/doc/examples/easy-ust/sample_component_provider.h</b></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><b>index dd3c5f0..e70d650 100644</b></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><b>--- a/doc/examples/easy-ust/sample_component_provider.h</b></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><b>+++ b/doc/examples/easy-ust/sample_component_provider.h</b></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">@@ -61,6 +61,8 @@</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>*/<span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>#include <lttng/tracepoint.h><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:20px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p4" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">+extern int testint(int i);</span></p>
<p class="gmail-p4" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(47,180,29)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">+</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>/*</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>* The following tracepoint event writes a message (c string) into the</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>* field message of the trace event message in the provider</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font:17px Menlo;color:rgb(64,11,217)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures;color:rgb(47,180,29)"><b>yanyh@vm</b></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">:</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b>~/tools/lttng/lttng-ust/doc/examples/easy-ust</b></span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">$ make</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">cc<span class="gmail-Apple-converted-space"> </span>-I. <span class="gmail-Apple-converted-space"> </span>\</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>-save-temps -c -o sample.o sample.c</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">cc<span class="gmail-Apple-converted-space"> </span>-I. <span class="gmail-Apple-converted-space"> </span>\</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>-save-temps -c -o tp.o tp.c</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">In file included from <b>/usr/include/lttng/ust-tracepoint-event.h:974:0</b>,</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from <b>/usr/include/lttng/tracepoint-event.h:58</b>,</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from <b>sample_component_provider.h:137</b>,</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from <b>tp.c:33</b>:</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b>././sample_component_provider.h:64:1:</b> </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)"><b>error: </b></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">expected expression before ‘<b>extern</b>’</span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>extern int testint(int i);</span></p><p class="gmail-p3" style="margin:0px;font:17px Menlo;color:rgb(47,180,29)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><b><span class="gmail-Apple-converted-space"> </span>^</b></span></p><p class="gmail-p2" style="margin:0px;font:17px Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">Makefile:34: recipe for target 'tp.o' failed</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">
</span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">make: *** [tp.o] Error 1</span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">Thank you</span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:17px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">Yonghong</span></p></div></div></div></div></div></div></div></div></div></div></div>