BlinkenArea - GitList
Repositories
Blog
Wiki
uproctrace
Code
Commits
Branches
Tags
Search
Tree:
fb431ce
Branches
Tags
master
uproctrace
liblwpttr
src
proc_end.c
implement proc_end event
Stefan Schuermans
commited
fb431ce
at 2020-05-17 17:11:52
proc_end.c
Blame
History
Raw
#include <liblwpttr/proc_end.h> #include "cleaner.h" #include "event.h" #include "timestamp.h" #include <lwproctrace.pb-c.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> int lwpttr_proc_end(void **data, size_t *size) { *data = NULL; *size = 0; lwpttr_cleaner_t *cleaner = lwpttr_cleaner_new(); if (! cleaner) { return -1; } struct _Lwproctrace__Timespec timestamp = LWPROCTRACE__TIMESPEC__INIT; lwpttr_event_get_timestamp(×tamp); struct _Lwproctrace__ProcEnd proc_end = LWPROCTRACE__PROC_END__INIT; proc_end.pid = getpid(); struct _Lwproctrace__Event event = LWPROCTRACE__EVENT__INIT; event.timestamp = ×tamp; event.proc_end = &proc_end; return lwpttr_event_pack(&event, data, size, cleaner); }