vppinfra: minor tweaks for cgo interoperation
[vpp.git] / src / tools / g2 / clib.c
index 6454c84..3cfc263 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  *------------------------------------------------------------------
  * Copyright (c) 2009-2016 Cisco and/or its affiliates.
  * Licensed under the Apache License, Version 2.0 (the "License");
 #include "cpel.h"
 #include "g2.h"
 
-int widest_track_format;
+extern int widest_track_format;
 
 typedef struct bound_track_ {
     u32 track;
     u8  *track_str;
 } bound_track_t;
 
-bound_track_t *bound_tracks;
+extern bound_track_t *bound_tracks;
 
-uword *the_evtdef_hash; /* (event-id, event-definition) hash */
-uword *the_trackdef_hash; /* (track-id, track-definition) hash */
+extern uword *the_evtdef_hash; /* (event-id, event-definition) hash */
+extern uword *the_trackdef_hash; /* (track-id, track-definition) hash */
 
-elog_main_t elog_main;
+extern elog_main_t elog_main;
 
 void *get_clib_event (unsigned int datum)
 {
@@ -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;
@@ -143,7 +141,7 @@ int read_clib_file(char *clib_file)
 
         delta = ep->time - starttime;
 
-        add_clib_event (delta, ep->track, ep->type + 1, i);
+        add_clib_event (delta, ep->track, ep->event_type + 1, i);
     }
 
     cpel_event_finalize();
@@ -152,3 +150,8 @@ int read_clib_file(char *clib_file)
 
     return(0);
 }
+
+unsigned int vl(void *a)
+{
+    return vec_len (a);
+}