From 903fd513e32a37e55aec0cfb4cf30e000680e0c3 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Sat, 1 Apr 2017 11:07:40 -0400 Subject: Clean up event log merge code Fix a decade-old ridiculous qsort function bug. Managed to subtract floating-point numbers as if they were integers, leading to manufactured time-paradoxes. That completely confuses g2, leading to the summary disappearance of entire tracks' worth of data at high zoom levels. Add a manual alignment tweak parameter to elog_merge, users can dial-out time paradoxes caused by NTP-grade clock synchronization. The event-logger has a precision of O(100ns), whereas NTP synchronization is O(1ms). Change-Id: I69dedabaa314f69f9df74ec9ee66e21e6c87f703 Signed-off-by: Dave Barach --- src/tools/g2/clib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/tools/g2') diff --git a/src/tools/g2/clib.c b/src/tools/g2/clib.c index 6454c84d42d..845026b6b93 100644 --- a/src/tools/g2/clib.c +++ b/src/tools/g2/clib.c @@ -130,8 +130,6 @@ int read_clib_file(char *clib_file) finalize_events(); - em->events = elog_get_events (em); - cpel_event_init(vec_len(em->events)); starttime = em->events[0].time; @@ -152,3 +150,8 @@ int read_clib_file(char *clib_file) return(0); } + +unsigned int vl(void *a) +{ + return vec_len (a); +} -- cgit 1.2.3-korg