<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><hr id="zwchr"><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">Hello,<div><br></div><div>In the example (hello) provided, I tried to print complex data types instead of usual ints or floats. My header file looks like this.</div><div><br></div><div><div>#undef TRACEPOINT_PROVIDER</div><div>#define TRACEPOINT_PROVIDER hello_world</div><div><br></div><div>#undef TRACEPOINT_INCLUDE</div><div>#define TRACEPOINT_INCLUDE "./hello-tp.h"</div><div><br></div><div>#if !defined(HELLO_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)</div><div>#define HELLO_TP_H</div><div><br></div><div>#include <lttng/tracepoint.h></div><div><br></div><div>#include "myinc.h"</div><div><br></div><div>TRACEPOINT_EVENT(</div><div> hello_world,</div><div> my_first_tracepoint,</div><div> TP_ARGS(</div><div> const char*, my_string_arg</div><div> ),</div><div> TP_FIELDS(</div><div> ctf_integer(int, my_string_field, atoi(my_string_arg))</div><div> )</div><div>)</div></div><div><br></div><div>My include file looks like this (myinc.h)</div><div>typedef unsigned char uuid_t;<br></div><div><br></div><div>However, when I try to compile it using, lttng-gen-tp, I am getting the following error.</div><div><br></div><div><div>root@mvm236:~/heelo_prog# lttng-gen-tp <a href="http://hello-tp.tp" target="_blank">hello-tp.tp</a><br data-mce-bogus="1"></div><div>In file included from ././hello-tp.h:13:0,</div><div> from /usr/include/lttng/ust-tracepoint-event.h:740,</div><div> from /usr/include/lttng/tracepoint-event.h:58,</div><div> from hello-tp.h:56,</div><div> from hello-tp.c:7:</div><div>././myinc.h:1:1: error: expected expression before ‘typedef’</div></div><div><br></div><div>Whatever I try to include, I am getting this error.</div><div><br></div><div>Can you please help.</div></div></blockquote><div>Try adding include guards around your header myinc.h, e.g.:<br></div><div><br></div><div>#ifndef _MYINC_H<br></div><div>#define _MYINC_H<br></div><div>typedef unsigned char uuid_t;<br></div><div>#endif<br></div><div><br></div><div>It will ensure the header content does not get included multiple<br></div><div>times by ust-tracepoint-event.h.<br></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Mathieu<br></div><div><br></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><br></div><div>-- Chid</div></div><br>_______________________________________________<br>lttng-dev mailing list<br>lttng-dev@lists.lttng.org<br>http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev<br></blockquote><div><br><br></div><div><br></div><div>-- <br></div><div><span name="x"></span>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com<span name="x"></span><br></div></div></body></html>