-/*
+/*
*------------------------------------------------------------------
* Copyright (c) 2006-2016 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <sys/fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <ctype.h>
/* Seconds since start of log */
delta = e->time - starttime;
-
+
/* u64 nanoseconds since start of log */
timestamp = delta * 1e9;
/* allocate an event instance */
vec_add2(the_events, ep, 1);
ep->timestamp = timestamp;
-
+
/* convert string event code to a real number */
- t = vec_elt_at_index (em->event_types, e->type);
+ t = vec_elt_at_index (em->event_types, e->event_type);
- /*
+ /*
* Construct a reasonable event name.
* Truncate the format string at the first whitespace break
* or printf format character.
ep->event_id = find_or_add_event(brief_event_name, "%s");
- track_name = format (0, "%U%c", format_elog_track, em, e, 0);
+ track_name = format (0, "%U%c", format_elog_track_name, em, e, 0);
ep->track_id = find_or_add_track (track_name);
continue;
usage:
- fformat(stderr,
+ fformat(stderr,
"c2cpel [--input-file] <filename> --output-file <filename>\n");
exit(1);
}
if (vec_len(inputfiles) == 0 || outputfile == 0)
goto usage;
-
+
if (vec_len(inputfiles) > 1)
goto usage;
clib_unix_warning ("couldn't create %s", outputfile);
exit (1);
}
-
+
alpha_sort_tracks();
fixup_event_tracks();
/*
- * Four sections: string-table, event definitions, track defs, events.
+ * Four sections: string-table, event definitions, track defs, events.
*/
if (!write_cpel_header(ofp, 4)) {
clib_warning ("Error writing cpel header to %s...\n", outputfile);
clib_warning ("Error writing events to %s...\n", outputfile);
unlink(outputfile);
exit(1);
-
+
}
fclose(ofp);
exit (0);