Julien Desfossez [Tue, 24 May 2011 15:31:14 +0000 (17:31 +0200)]
Fix handling of multiple FDs
This patch fixes the (normal) case where we handle more than one reading
fd. Previous versions were only tested with one FD, as of now we can
consume multiple fd (metadata and data for example).
Julien Desfossez [Wed, 18 May 2011 17:58:11 +0000 (13:58 -0400)]
Fatal error causes kconsumerd to exit
In each thread, if a fatal error occurs, all threads are killed and
kconsumerd exits thus preventing half working daemon. The session daemon
gets notified because kconsumerd disconnects from the error socket.
David Goulet [Wed, 18 May 2011 21:40:33 +0000 (17:40 -0400)]
Major changes on the lttng command line tool
Add create and destroy trace action but NOT implemented on the session
daemon side.
Add kernel create channel option but NOT implemented on the session
daemon side.
Add auto_session and auto_trace support for the lttng tool. This means
that if only --start is specified with a certain pid for instance, a
session is automatically created and a trace.
Fix a bug on the session daemon side where the ret value was changed
when no lttcomm_lttng_msg structure was allocated before replying to the
client.
Add a lot more command line validation for conflicting command.
Remove the use of UUID in the session name and for the create trace of
the liblttngctl API.
Remove the memset(0) applied to the llm structure of liblttngctl thus
resetting every information. This is not wanted for multiple command for
one lttng execution.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Mon, 16 May 2011 21:34:23 +0000 (17:34 -0400)]
Major changes of command processing for sessiond
This follows up a TODO added at commit 5e16da05 by me and Mathieu
Desnoyers about the command processing using a command context.
This patch introduce a command context data structure which contains all
the necessary information to process a command received by the session
daemon from the lttng client.
The entire session daemon is refactored with this addition. All
userspace trace action also. The global current_session pointer is
removed and is now in the command context struct. Some of the functions
for the buffer allocation are removed/changed.
This is the first step of getting the session daemon multi-threaded.
This patch also fix the -h bug of the lttng client introduce in the
commit 5e16da05. Minor variable renaming also occured.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Mon, 16 May 2011 16:43:08 +0000 (12:43 -0400)]
Add lttng-kernel header
This header contains copied structure from the new LTTng kernel tree
use by the tracer and the consumer. We are not exporting them to the
public anymore thus the removal from lttng.h header file.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Fri, 6 May 2011 15:58:31 +0000 (11:58 -0400)]
Move ust trace actions to trace.c
Move from main.c to trace.c all UST specific trace actions. Now, if we
get a pid from the lttng client, we try to connect before dealing with
the commands.
Move current_session to an extern declaration in session.h.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Wed, 4 May 2011 20:37:26 +0000 (16:37 -0400)]
Add support for auto session creation
Support for auto session creation when no session (-s) is specified. The
session is created with the name being the current date and time. For
all commands that do not needs a session, no auto session is created and
for thoses who needs -s also.
Improve shorten uuid management all around the lttng client code.
Fix uuid usage in lttng_session data structure and a small fix in the
liblttngctl for the set_current_uuid fct.
Fix session name regex of the tests.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Wed, 4 May 2011 16:26:03 +0000 (12:26 -0400)]
Add support for shorten session uuid
Session are now identified by name.short_uuid where short_uuid is the
first 8 bytes of the 36 bytes uuid.
Also, fix the bug where you could'nt pass two command to the session
daemon from liblttngctl. The connect and disconnect is added to the
ask_sessiond function. So, on every command, a connect and close is
done.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Mon, 2 May 2011 20:42:35 +0000 (16:42 -0400)]
Add -p, --pid option to lttng command line
This makes create, start and stop trace available for both kernel and
userspace tracing. For userspace tracing, use the -p, --pid option to
enable those action for an application identified by a pid.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Fri, 29 Apr 2011 17:00:39 +0000 (13:00 -0400)]
Move traceable app. data to a seperate C file
All traceable application data structure and functions
are now in traceable-app.c/.h.
To remove traceable app data struct dependency from main.c,
register_traceable_app, unregister_traceable_app and get_app_count
is added. Also, main.c is now using these function.
Also, the find_app_by_pid returns the struct pointer.
Minor spaces fix in the code for session.c/.h and main.c
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Fri, 29 Apr 2011 16:04:02 +0000 (12:04 -0400)]
Move session data and functions to session.c/.h
Moving all session data to a specific C file. Basic changes to the code
was necessary to make functions and variables non-static. Adds a
get_session_count to protect direct changes to the session counter.
Also, rename ltt-sessiond.c to main.c.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Thu, 21 Apr 2011 21:29:32 +0000 (17:29 -0400)]
Major changes for the daemon data transmission
This commit reengineer the data transmission from the session daemon to
the liblttngctl. Instead of sending a packet on a per data structure
basis, this scheme uses lttcomm_lttng_msg structure has a header control
structure adding the payload_size to it. The payload data is then
appended after and only one send() is used.
This will permit AF_INET socket scaling for future development.
List sessions and list apps command has been modified to fit this
change.
In the meantime, some unuse code is removed and minor cleanup.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Thu, 21 Apr 2011 19:02:15 +0000 (15:02 -0400)]
Add lttngerr support to ltt-sessiond
Now using the lttngerr API for message/error printing.
Also add the quiet option to the ltt-sessiond. The lttng auto spawn
session daemon option was also modified to use that quiet option to not
to pollute stdout when that spawned daemon is killed.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
David Goulet [Wed, 20 Apr 2011 19:33:23 +0000 (15:33 -0400)]
Change client message processing
ltt-sessiond can now send multiple response to the client for only one
command.
The list traceable apps command was modified accordingly to that
modification and now send one response per pid.
The liblttnctl was also changed to handle multiple reply and the
recvfrom_sessiond internal function is added removing the recv from the
ask_sessiond() function. Fine grained control helps.
Signed-off-by: David Goulet <david.goulet@polymtl.ca>