how to generate CTF metadata
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Dominik Taborsky
Hello,
I am working on a project that involves generating CTF metadata, but I am unsure about how to proceed. I am not sure about how to get information about types,
What "types" are you talking about exactly? What are you intending to write to binary streams?
Phil
Quoted 13 lines
i.e. their size, signedness, alignment and possibly other. I know this information can be gathered from DWARF. Is that the primary way to do this? Is there any other, reasonable way? Can you point me at some code that does this? How does the LTTng linux kernel module work?
Thanks.
Dominik
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): CAB4xu_3e6C-1ELJH-M-otbpqXzh9QeN_=8-t0guzLSiA9F8DNw@mail.gmail.com
Quoted 9 lines · Philippe Proulx
Quoted 5 lines · Dominik Taborsky
Hello,
I am working on a project that involves generating CTF metadata, but I am unsure about how to proceed. I am not sure about how to get information about types,
What "types" are you talking about exactly? What are you intending to write to binary streams?
Oh, sorry for not specifying exactly: I mean any defined, non-standard types. For example, when you do:
typedef uint32_t key_t;
typedef struct {
size_t len;
char *data;
} wire_data_t;You use these types by their typedef'd name. Suppose then, you want to trace a function like:
int do_work(key_t k, wire_data_t data);
Then how do you know what those types are without looking at the typedefs? The runtime tracer does not have access to those header files. And even if it did, there may be tons of layers of typedefs. You've got to do this at runtime, which obviously leaves me with DWARF. Otherwise I'd have to specify the type info myself before or after the trace.
So my main question is: how does the LTTng linux kernel module understand all the types so it may describe them in the CTF metadata?
Dominik
Quoted 16 lines
Phil
Quoted 13 lines
i.e. their size, signedness, alignment and possibly other. I know this information can be gathered from DWARF. Is that the primary way to do this? Is there any other, reasonable way? Can you point me at some code that does this? How does the LTTng linux kernel module work?
Thanks.
Dominik
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 32 lines · Dominik Taborsky
Quoted 6 lines · Philippe Proulx
Quoted 3 lines · Dominik Taborsky
Hello,
Quoted 7 lines
Quoted 3 lines
I am working on a project that involves generating CTF metadata, but I am unsure about how to proceed. I am not sure about how to get information about types,
What "types" are you talking about exactly? What are you intending to write to binary streams?
Oh, sorry for not specifying exactly: I mean any defined, non-standard types. For example, when you do:
typedef
uint32_tkey_t;typedef struct { size_t len; char *data; } wire_data_t;You use these types by their typedef'd name. Suppose then, you want to trace a function like:
int
do_work(key_t k, wire_data_t data);
Quoted 8 lines
Then how do you know what those types are without looking at the typedefs? The runtime tracer does not have access to those header files. And even if it did, there may be tons of layers of typedefs. You've got to do this at runtime, which obviously leaves me with DWARF. Otherwise I'd have to specify the type info myself before or after the trace.
So my main question is: how does the LTTng linux kernel module understand all the types so it may describe them in the CTF metadata?
LTTng-modules knows each field of event payload structures. They are described, with a name and a basic C type, in instrumentation headers (see [1]). So LTTng-modules does not have this unknown typedef constraint. The actual TSDL metadata is produced in lttng-events.c; see [2] for an example of how a basic C type is "converted" to a TSDL integer: __alignof__(x) is used for alignment, (sizeof(x) * CHAR_BIT) for the size in bits, and this clever macro:
#define lttng_is_signed_type(type) (((type)(-1)) < 0)
to know if the type is signed or not.
[1] http://git.lttng.org/?p=lttng-modules.git;a=blob;f=instrumentation/events/lttng-module/sched.h;h=1bea326135a428e0db10c42388a9683d58edd745;hb=HEAD#l231
[2] http://git.lttng.org/?p=lttng-modules.git;a=blob;f=lttng-events.h;h=118ea3b0db52d82e6072e17aa901c1850e22e43c;hb=HEAD#l74
Phil
Quoted 23 lines
Dominik
Quoted 18 lines
Phil
Quoted 15 lines
i.e. their size, signedness, alignment and possibly other. I know this information can be gathered from DWARF. Is that the primary way to
do this? Is there any other, reasonable way? Can you point me at some code
that does this? How does the LTTng linux kernel module work?Thanks.
Dominik
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev