Complete change of the source directory tree For the sake of clearness and awesomeness :P, this change was needed for better semantic across the code and better organization of source files. src/ --> Contains source files of the project bin/ --> Contains every binaries this git tree builds (lttng, lttng-sessiond and lttng-consumerd). lib/ --> Contains exported libraries (lttng-ctl). common/ --> Contains shared code for the entire project. (internal libraries mostly) Every internal headers are moved from include/ to src/common. The include directory only contains exported public headers now (lttng/lttng.h). The -I$(top_srcdir)/src is also added for all Makefiles. The consumerd APIs are not exported anymore. The reason is that the consumer will get completely re-engineered in the next months. It's our safety net for the APIs breakage of the coming year concerning the consumerd library. Renaming is done also on some internal libraries to follow the naming convention. The public library liblttngctl is renamed to liblttng-ctl making it linkable now with "-llttng-ctl" deprecating the old "-llttngctl". No code is changed with this commit except #include statements added/removed/renamed. This is why there is yet files and internal API calls that does not follow the naming convention (Ex: lttngerr.h, lttng-share.h in src/common). Signed-off-by: David Goulet <dgoulet@efficios.com>
Move runas.h to common/ directory Simply put to improve semantic over the code includes and knowing that runas.h comes from the common library. It's arguable to do this across the code base for all internal libraries. This should be discuss at least for the code tree consistency. Signed-off-by: David Goulet <dgoulet@efficios.com>
Create all trace directories and files with client user credentials Keep the client user credentials that created a session along with the session. Use exactly those credentials to chown the created directories and files. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix multi-session UST handling combined with shm fd teardown shm fd is used as unique identifier for the channel when passing the stream fds to the consumer. However, closing the fd reuses the same identifier for the next round, thus getting the same consumer channel/streams as the previous one. This causes multi-session tracing to only work for the first session, not the following ones. So instead of doing a channel lookup on add channel and a stream lookup upon add stream, we "steal" the identifier. We still lookup the channel identifier upon stream add though: this means the sessiond needs to keep the channel shm fd open until it has finished sending all stream fds to the consumer. For kernel consumer, the update operation still does a stream id lookup. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix ust consumer channel memory non-zeroed allocation The cpu count was expecting memory to be zeroed on allocation. Caused stream open errors and zero-sized metadata files (and unability to open channel files). Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
UST consumer: implement missing ust-specific callbacks + fixes. Also fix consumer handling of poll fd: a mask should be used. Also fix UST stream output passed to the consumer (the fix is a hack currently, left a FIXME). Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
UST 2.0 support Refactoring of the consumer/sessiond interaction so the consumer supports applications instrumented with libust (UST 2.0). At this point, more testing of interaction between libust and sessiond is required. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>