From e09ae01f6777434f41ba8a5a564c8078565ecfea Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 19 Aug 2020 06:59:53 -0400 Subject: vppinfra: minor tweaks for cgo interoperation 'type' is a keyword in golang, so s/type/event_type/ in elog.h and elsewhere. Add vec_len_not_inline(...), elog_write_file_not_inline(...) and elog_read_file_not_inline(...) since the inline forms aren't usable. More such tweaks may follow. Type: improvement Signed-off-by: Dave Barach Change-Id: I9a80a6afa635f5cdedee554ee9abe400fafc1cb6 --- src/tools/perftool/c2cpel.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/tools/perftool') diff --git a/src/tools/perftool/c2cpel.c b/src/tools/perftool/c2cpel.c index 35885debef8..72049054ae1 100644 --- a/src/tools/perftool/c2cpel.c +++ b/src/tools/perftool/c2cpel.c @@ -1,4 +1,4 @@ -/* +/* *------------------------------------------------------------------ * Copyright (c) 2006-2016 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -72,7 +72,7 @@ void convert_clib_file(char *clib_file) /* Seconds since start of log */ delta = e->time - starttime; - + /* u64 nanoseconds since start of log */ timestamp = delta * 1e9; @@ -81,11 +81,11 @@ void convert_clib_file(char *clib_file) /* 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. @@ -189,14 +189,14 @@ int main (int argc, char **argv) continue; usage: - fformat(stderr, + fformat(stderr, "c2cpel [--input-file] --output-file \n"); exit(1); } if (vec_len(inputfiles) == 0 || outputfile == 0) goto usage; - + if (vec_len(inputfiles) > 1) goto usage; @@ -211,12 +211,12 @@ int main (int argc, char **argv) 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); @@ -246,7 +246,7 @@ int main (int argc, char **argv) clib_warning ("Error writing events to %s...\n", outputfile); unlink(outputfile); exit(1); - + } fclose(ofp); exit (0); -- cgit 1.2.3-korg