diff options
author | Dave Barach <dave@barachs.net> | 2020-08-19 06:59:53 -0400 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2020-08-19 07:04:36 -0400 |
commit | e09ae01f6777434f41ba8a5a564c8078565ecfea (patch) | |
tree | 5cdea178576d79d1a8803401fb1e42cf1270a6f4 /src/tools/perftool | |
parent | 5c1cba5401b499b80bd46e783b5a444f18991922 (diff) |
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 <dave@barachs.net>
Change-Id: I9a80a6afa635f5cdedee554ee9abe400fafc1cb6
Diffstat (limited to 'src/tools/perftool')
-rw-r--r-- | src/tools/perftool/c2cpel.c | 20 |
1 files changed, 10 insertions, 10 deletions
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] <filename> --output-file <filename>\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); |