Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] Unable to include files in tracepoint provider header	files
Date: Tue, 28 Apr 2015 18:27:08 +0000 (UTC)	[thread overview]
Message-ID: <904034208.39627.1430245628187.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <CAL1ZhONvUcjoSky5+2nGbfzKoKNhNo6++zZfz_OmRAy++mC3vQ@mail.gmail.com>

----- Original Message -----

> Hello,

> In the example (hello) provided, I tried to print complex data types instead
> of usual ints or floats. My header file looks like this.

> #undef TRACEPOINT_PROVIDER
> #define TRACEPOINT_PROVIDER hello_world

> #undef TRACEPOINT_INCLUDE
> #define TRACEPOINT_INCLUDE "./hello-tp.h"

> #if !defined(HELLO_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
> #define HELLO_TP_H

> #include <lttng/tracepoint.h>

> #include "myinc.h"

> TRACEPOINT_EVENT(
> hello_world,
> my_first_tracepoint,
> TP_ARGS(
> const char*, my_string_arg
> ),
> TP_FIELDS(
> ctf_integer(int, my_string_field, atoi(my_string_arg))
> )
> )

> My include file looks like this (myinc.h)
> typedef unsigned char uuid_t;

> However, when I try to compile it using, lttng-gen-tp, I am getting the
> following error.

> root at mvm236:~/heelo_prog# lttng-gen-tp hello-tp.tp
> In file included from ././hello-tp.h:13:0,
> from /usr/include/lttng/ust-tracepoint-event.h:740,
> from /usr/include/lttng/tracepoint-event.h:58,
> from hello-tp.h:56,
> from hello-tp.c:7:
> ././myinc.h:1:1: error: expected expression before ?typedef?

> Whatever I try to include, I am getting this error.

> Can you please help.

Try adding include guards around your header myinc.h, e.g.: 

#ifndef _MYINC_H 
#define _MYINC_H 
typedef unsigned char uuid_t; 
#endif 

It will ensure the header content does not get included multiple 
times by ust-tracepoint-event.h. 

Thanks, 

Mathieu 

> -- Chid

> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers 
EfficiOS Inc. 
http://www.efficios.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150428/4efcb353/attachment.html>


  reply	other threads:[~2015-04-28 18:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 18:13 Chidhu R
2015-04-28 18:27 ` Mathieu Desnoyers [this message]
2015-04-28 18:33   ` Chidhu R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=904034208.39627.1430245628187.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox