[ltt-dev] [OT][LTTV]

Mathieu Desnoyers compudj at krystal.dyndns.org
Fri Mar 26 09:24:17 EDT 2010


* Nikita Izyumtsev (nikita.izyumtsev at gmail.com) wrote:
> Hi everybody!
> 
> First of all, I'm not sure if I'm posting to right mailing list. My
> question is concerning lttv. If I'm not, please point me at correct
> one. Thank you!
> 

Yep, that's the right place.


> I'm facing some unpleasant issue with latest lttv (both 0.12.30 and
> git snapshot). After lttv packages installation, if I try to compile
> some simple application (just open and then close trace), I see
> following:
> In file included from test.c:2:
> /usr/include/ltt/trace.h:24:29: error: ltt/ltt-private.h: No such file
> or directory
> In file included from test.c:2:
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_name’:
> /usr/include/ltt/trace.h:96: error: dereferencing pointer to incomplete type
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_long_name’:
> /usr/include/ltt/trace.h:101: error: dereferencing pointer to incomplete type
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_cpu’:
> /usr/include/ltt/trace.h:108: error: dereferencing pointer to incomplete type
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_tid’:
> /usr/include/ltt/trace.h:114: error: dereferencing pointer to incomplete type
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_pgid’:
> /usr/include/ltt/trace.h:119: error: dereferencing pointer to incomplete type
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_creation’:
> /usr/include/ltt/trace.h:124: error: dereferencing pointer to incomplete type
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_get_trace’:
> /usr/include/ltt/trace.h:129: error: dereferencing pointer to incomplete type
> /usr/include/ltt/trace.h: In function ‘ltt_tracefile_block_number’:
> /usr/include/ltt/trace.h:136: error: dereferencing pointer to incomplete type
> 
> After short investigation, I have found, that public header file
> trace.h includes private libltt header private-ltt.h. I have that by
> removing private-ltt.h reference and putting all inlined functions
> into library body (and preserving current ABI in that way) --- see
> attached patch, but it resulted in another compilation failure, this
> time in lttv:
> batchtest.c: In function ‘trace_event’:
> batchtest.c:175: error: dereferencing pointer to incomplete type
> batchtest.c: In function ‘save_state_copy_event’:
> batchtest.c:233: error: dereferencing pointer to incomplete type
> batchtest.c: In function ‘compute_tracefile’:
> batchtest.c:332: error: dereferencing pointer to incomplete type
> 
> Reason for this failure is that batchtest.c relies on private
> declaration of LttTracefile :)
> 
> outcome: I'm willing to fix all that stuff, but I'm *very* new to ltt,
> and I would like someone to define libltt API.

OK, I see the issue. ltttraceread is a LGPL library, and it should be
possible to link BSD/proprietary/... applications other than LTTV to
it.

We need to declare the API as symbols for these to be available
externally. We cannot rely on publishing ltt-private.h to these
applications. However, I don't want to penalize GPL and LGPL
applications: they should be able to still access the data without the
extra function call overhead.

So I propose that we do something similar to what I have done in the
Userspace RCU library:

If the application is GPL or LGPL, it can do:

#define _LGPL_SOURCE
#include <urcu.h>

(urcu.h will use static inlines)

or, if _LGPL_source is not defined when including urcu.h, it will emit
declarations. urcu.c will in all cases emit the implementation and
symbols. See http://lttng.org/urcu to get the library if you need
inspiration about how to do that.

For the other internal field accesses from LTTV, it does make sense to
look at them individually and extend the ltttraceread API accordingly.

Thanks !

Mathieu


> 
> Nikita


> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev


-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list