Introduce a new communication protocol for UST v5
authorNils Carlson <nils.carlson@ericsson.com>
Mon, 11 Oct 2010 14:10:30 +0000 (16:10 +0200)
committerNils Carlson <nils.carlson@ericsson.com>
Tue, 26 Oct 2010 06:51:48 +0000 (08:51 +0200)
commit72098143aa5d995802b411e152b89ad252dd37ca
tree98ac07121739113e5d9b008e1f938ff58b65d051
parent58a0db739ef3fb7dec9d61bb9d47e33f873c97b8
Introduce a new communication protocol for UST v5

Changes since v4:
More scanning fixes in ustctl

Changes since v3:
Fix minor bugs in ustctl

Changes since v2:
Fix packing of the socket path and ustcmd handling
of socket path

Changes since v1:
Update after comments from David Goulet,
fix some style issues, a bug in GET_SOCK_PATH and
add a fixme for posterity.

This is once again a bit of a code-dump. The principal of this
patch is to get rid of most string parsing in UST and most
dynamic heap memory allocation by libust. A secondary goal
has been to introduce a command-response model so all commands
receive responses with a result code. This has been achived
through the following steps.

 1. Create standardised message containers as structs ending in
    a char array. The char array is used to pack strings into
    while pointers in the struct point positions relative the data
    segment in the struct. Unpacking the struct upon reception is
    a simple matter of adding to the pointers the position in memory
    of the char array.

2.  Keeping a char array permanently allocated in libust that is
    used to receive incoming data, avoiding allocation. This array
    is large enough to receive any of the pre-defined message
    structs.

3.  Replacing all string matching for commands with enum based switch
    statements. This will scale better over time.

4.  All commands now receive responses containing a result as a negative
    errno. Libustcmd now returns -1 and sets errno according to these.
    Eventually these will need to be documented in manpages with
    what each errno implies. Ustctl needs to check these in turn and
    give meaningfull feedback.

5.  Cleaning up tracectl.c quite a bit separating out control functions
    and message handling.

6.  Move channel marker scanning from tracectl out to ustctl.

Fifth is a pain

Signed-off-by: Nils Carlson <nils.carlson@ericsson.com>
Acked-by: David Goulet <david.goulet@polymtl.ca>
include/ust/ustcmd.h
include/ust/ustd.h
libust/tracectl.c
libustcmd/ustcmd.c
libustcomm/ustcomm.c
libustcomm/ustcomm.h
libustd/libustd.c
ustctl/ustctl.c
This page took 0.025279 seconds and 4 git commands to generate.