81bf78b39d3b82f8ffd123f796ae5e6f5228af4c
Stefan Schuermans split event and proc_begin

Stefan Schuermans authored 4 years ago

liblwpttr/src/event.c  1) #include "event.h"
Stefan Schuermans add exe and cwd to proc_begin

Stefan Schuermans authored 4 years ago

liblwpttr/src/event.c  2) #include "cleaner.h"
Stefan Schuermans first incomplete begin_proc...

Stefan Schuermans authored 4 years ago

liblwpttr/src/event.c  3) 
liblwpttr/src/event.c  4) #include <lwproctrace.pb-c.h>
liblwpttr/src/event.c  5) 
liblwpttr/src/event.c  6) #include <stdlib.h>
liblwpttr/src/event.c  7) 
Stefan Schuermans split event and proc_begin

Stefan Schuermans authored 4 years ago

liblwpttr/src/event.c  8) /**
liblwpttr/src/event.c  9)  * @brief pack event to a buffer
liblwpttr/src/event.c 10)  * @param[in] event the event to pack to a buffer
liblwpttr/src/event.c 11)  * @param[out] *data pointer to event data (malloc-ed)
liblwpttr/src/event.c 12)  * @param[out] *size size of data
liblwpttr/src/event.c 13)  * @param[in] cleaner cleaned up after building data buffer (also on error)
liblwpttr/src/event.c 14)  * @return 0 on success (*data, *size set),
liblwpttr/src/event.c 15)  *         -1 on error (*data = NULL, *size = 0)
liblwpttr/src/event.c 16)  */
Stefan Schuermans lwpttr -> lwptev

Stefan Schuermans authored 4 years ago

liblwptev/src/event.c 17) int lwptev_event_pack(struct _Lwproctrace__Event *event,
Stefan Schuermans split event and proc_begin

Stefan Schuermans authored 4 years ago

liblwpttr/src/event.c 18)                       void **data, size_t *size,
Stefan Schuermans lwpttr -> lwptev

Stefan Schuermans authored 4 years ago

liblwptev/src/event.c 19)                       lwptev_cleaner_t *cleaner) {
Stefan Schuermans add exe and cwd to proc_begin

Stefan Schuermans authored 4 years ago

liblwpttr/src/event.c 20)   *size = lwproctrace__event__get_packed_size(event);
liblwpttr/src/event.c 21)   *data = malloc(*size);
liblwpttr/src/event.c 22)   if (! data) {
Stefan Schuermans lwpttr -> lwptev

Stefan Schuermans authored 4 years ago

liblwptev/src/event.c 23)     lwptev_cleaner_cleanup(cleaner);
Stefan Schuermans add exe and cwd to proc_begin

Stefan Schuermans authored 4 years ago

liblwpttr/src/event.c 24)     *size = 0;
liblwpttr/src/event.c 25)     return -1;
liblwpttr/src/event.c 26)   }
liblwpttr/src/event.c 27)   *size = lwproctrace__event__pack(event, *data);
Stefan Schuermans lwpttr -> lwptev

Stefan Schuermans authored 4 years ago

liblwptev/src/event.c 28)   lwptev_cleaner_cleanup(cleaner);