All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Unable to include files in tracepoint provider header files
       [not found] <CAL1ZhONvUcjoSky5+2nGbfzKoKNhNo6++zZfz_OmRAy++mC3vQ@mail.gmail.com>
@ 2015-04-28 18:27 ` Mathieu Desnoyers
       [not found] ` <904034208.39627.1430245628187.JavaMail.zimbra@efficios.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2015-04-28 18:27 UTC (permalink / raw)
  To: Chidhu R; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 1784 bytes --]

----- 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@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@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers 
EfficiOS Inc. 
http://www.efficios.com 

[-- Attachment #1.2: Type: text/html, Size: 3533 bytes --]

[-- Attachment #2: Type: text/plain, Size: 155 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to include files in tracepoint provider header files
       [not found] ` <904034208.39627.1430245628187.JavaMail.zimbra@efficios.com>
@ 2015-04-28 18:33   ` Chidhu R
  0 siblings, 0 replies; 3+ messages in thread
From: Chidhu R @ 2015-04-28 18:33 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 2076 bytes --]

Great. Thank you. That worked.

On Tue, Apr 28, 2015 at 11:27 AM, Mathieu Desnoyers <
mathieu.desnoyers@efficios.com> wrote:

> ------------------------------
>
> 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@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@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
>
>
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com
>

[-- Attachment #1.2: Type: text/html, Size: 4056 bytes --]

[-- Attachment #2: Type: text/plain, Size: 155 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Unable to include files in tracepoint provider header files
@ 2015-04-28 18:13 Chidhu R
  0 siblings, 0 replies; 3+ messages in thread
From: Chidhu R @ 2015-04-28 18:13 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 1279 bytes --]

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@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.

-- Chid

[-- Attachment #1.2: Type: text/html, Size: 1896 bytes --]

[-- Attachment #2: Type: text/plain, Size: 155 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-28 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAL1ZhONvUcjoSky5+2nGbfzKoKNhNo6++zZfz_OmRAy++mC3vQ@mail.gmail.com>
2015-04-28 18:27 ` Unable to include files in tracepoint provider header files Mathieu Desnoyers
     [not found] ` <904034208.39627.1430245628187.JavaMail.zimbra@efficios.com>
2015-04-28 18:33   ` Chidhu R
2015-04-28 18:13 Chidhu R

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.