aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools
AgeCommit message (Collapse)AuthorFilesLines
2019-03-22vppapigen: allow for enum size other than u32Andrew Yourtchenko1-1/+10
Change-Id: If20d2fbab9b854b7db276c81918fdff6abcb8385 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-02-26vppapigen: Expose "option version" in generated JSON file.Ole Troan1-0/+1
Change-Id: Iaa78ee181589584885b0f377eafb89e603718bd4 Signed-off-by: Ole Troan <ot@cisco.com>
2019-02-18Resolve vppapigen DeprecationWarning.Paul Vinciguerra1-6/+7
/vpp/src/tools/vppapigen/vppapigen:823: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses Change-Id: If7729778374e9193f6381c8bd2ed34c875db3f1e Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-02-04g2-only: add (min,max) stats to the anomaly detectorDave Barach1-5/+25
Shows up on the status line. Change-Id: I14635f7406069a4a868bdb7c8b85da941c49dbba Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-03Automated anomaly detectionDave Barach2-220/+540
Compute per-track mean, variance, and n*stddev stats for the first u32 datum in each instance of the supplied event. Search for the next instance of the indicated event which has a datum larger than mean + n*stddev. This turns out to be a very effective "Nixon Gap" finder when the selected event datum is the instantaneous vector size. Such traces can be easily captured from production vpp images. Change-Id: I876843cb2ece22f902720704ce4568d4e1173e01 Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-02Python3: Move vppapigen to python3.Paul Vinciguerra2-9/+15
Change-Id: I26846d0c12211a29ccfca7c269b9094f6fdbd95c Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-19session: add cli option to dump session elogFlorin Coras2-2/+3
Change-Id: I1f42644f143bb65ee764c0f869b402595126adac Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13API: Use string type instead of u8.Ole Troan2-10/+17
The new string type is modelled after string in proto3. It is always variable length. Change-Id: I64884067e28a80072c8dac31b7c7c82d6e306051 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Michal Cmarada <mcmarada@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-03API: C generator improve symbol protection.Ole Troan1-2/+2
Change-Id: I9ef042c06c12892a2bbc23cc3bac6891c77e3feb Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-29vppapigen: Fix python3 compatibilityOle Troan1-24/+40
Change-Id: I9124fcb755ba43fd8f44712f0940f351c460c5b0 Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-29API: Add support for type aliasesOle Troan3-3/+40
Previously all types are compound. This adds support for aliases, so one can do things like: typedef u32 interface_index; or typedef u8 ip4_address[4]; Change-Id: I0455cad0123fc88acb491d2a3ea2725426bdb246 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-10-23c11 safe string handling supportDave Barach3-6/+6
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-09-26perftool: fix c2cpelFlorin Coras1-0/+2
Change-Id: I0f39477bbf88d490409fdcd5f58df55cfe2ec531 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-13Fix: vppapigen make build fails on fresh installPaul Vinciguerra4-3/+3
Steps to reproduce: vagrant@localhost:/vagrant$ build-root/vagrant/build.sh ... @@@@ Building vpp in /vagrant/build-root/build-vpp-native/vpp @@@@ [51/1169] Generating API header /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json FAILED: cd /vagrant/build-root/build-vpp-native/vpp/vlibmemory && mkdir -p /vagrant/build-root/build-vpp-native/vpp/vlibmemory && /vagrant/src/tools/vppapigen/vppapigen --includedir /vagrant/src --input /vagrant/src/vlibmemory/memclnt.api JSON --output /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json AttributeError: 'module' object has no attribute 'dumps' This seems to be due to JSON.py namespace colliding with the standard lib json.py Change-Id: If389e4e05ef0c166b0c2b3bef7ec0185298679a8 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-09-07cmake: set packaging component for different filesDamjan Marion1-1/+2
Change-Id: I033a1f5cdb24f77462cb5ec90a62226d93f52925 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-30cmake: fix vppapigen install permissonsDamjan Marion1-1/+9
Change-Id: I0f49842d3e6690d0965bd310321495a2dc4c2350 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-28cmake: Add perftool to cmake buildMohsin Kazmi1-0/+35
Change-Id: I921e92473a9dedde5952172d19676d47ffc4b53d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-08-28cmake: add g2 and elftool toolsDamjan Marion2-0/+53
Change-Id: I901c5a2c0ac81421a69b8ade9307c304aa38582b Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-28cmake: install vppapigenDamjan Marion1-0/+15
Change-Id: If5bf1708a07acde73ed34639eeed95babdcf1ccd Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-06-29VPPAPIGEN: use SOURCE_DATE_EPOCH for datestringNirmoy Das1-1/+2
bwiedemann@suse.com pointed me that: For reproducible builds datestring should be generated using SOURCE_DATE_EPOCH which distributions set centrally, and have build tools that consume it to produce reproducible output. https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal#Python Change-Id: Iefa2b93231bbc4c8af49736be4d7a5720c46b28d Signed-off-by: Nirmoy Das <nirmoy.aiemd@gmail.com>
2018-06-29CSIT-1148: VPPAPIGEN 2nd level import of .api ignoredOle Troan1-4/+5
Change-Id: I73dcab0c5ff2405b1fcba25975955e1267a4ac4e Signed-off-by: Ole Troan <ot@cisco.com>
2018-05-23VPPAPIGEN: Add union and enum support and IP4/IP6 address type.Ole Troan3-85/+123
Note: The Python, Java and C/C++ bindings must be updated before ip/ip_types.api can be used. ip_types.api: typedef ip4_address { u8 address[4]; }; typedef ip6_address { u8 address[16]; }; enum address_family { ADDRESS_IP4 = 0, ADDRESS_IP6, }; union address_union { vl_api_ip4_address_t ip4; vl_api_ip6_address_t ip6; }; typedef address { vl_api_address_family_t af; vl_api_address_union_t un; }; Change-Id: I22f67092f24db5bd650a03c6f446a84cd9fd1074 Signed-off-by: Ole Troan <ot@cisco.com>
2018-04-17ACL based forwardingAndrew Yourtchenko1-1/+1
A poor man's flow switching or policy based rounting. An ACL is used to match packets and is associated with a [set of] forwarding paths that determine how to forward matched packets - collectively this association is a 'policy'. Policies are then 'attached', in a priority order, to an interface when thaey are encountered as an input feature. If a packet matches no policies it is forwarded normally in the IP FIB. This commit is used to test the "ACL-as-a-service" functionality, which currently compiles, and the existing traffic ACL tests pass in both hash and linear modes. Change-Id: I0b274ec9f2e645352fa898b43eb54c457e195964 Signed-off-by: Neale Ranns <nranns@cisco.com> Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com> Signed-off-by: Ole Troan <ot@cisco.com>
2018-04-11VPPAPIGEN: Consistent CRC32 on complete file.Ole Troan1-17/+25
Prior to this fix vppapigen would just do a crc32 on the Python representation of the file as a set of dictionaries. That of course was not a good idea. Change-Id: Ie454736ffec02fa4679ab27e684b1d6c6406a0f1 Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-08vppapigen: require reply/details messages for requests/dumpsMarek Gradzki1-6/+6
Throw exception if details/reply is not defined instead of logger warning. Change-Id: I6eb39c51eecca6521e5f563ba09dfd62311b45ec Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-07VPPAPIGEN: Run tool directly from source tree.Ole Troan1-1/+4
This ensures that tool changes do not require re-bootstrap. Disabled generation of temporary files (gentab / .pyc) to avoid polluting the source tree. Change-Id: I4d6bc035fbb46550fa8f4e99f4091eef90e2d86c Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-06vppapigen: require service definition for singleton messagesMarek Gradzki1-7/+2
Change-Id: Ie7b1c5e50588f65657c3c0900e5914ea82ebb50f Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-06vppapigen: do not allow to define message as both request and replyMarek Gradzki1-0/+4
Change-Id: I0738fac32dd0c5d927c52d2eb2c1100d14c147cf Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-06vppapigen: require reply ID different than caller IDMarek Gradzki1-0/+4
Change-Id: I316dc99881bce6a36904863d3c1c049b4f5cf658 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-06API: Add service definitions for events and singleton messages (second attempt)Marek Gradzki1-17/+30
Based on https://gerrit.fd.io/r/#/c/10920/ Updates service definition in stats.api with correct reply message names. Change-Id: I3282bee5304e667e23bc1fab3f43d967a50d880d Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-03-05Revert "API: Add service definitions for events and singleton messages."Ole Trøan1-30/+17
This reverts commit f7b7fa53b7eaec81d8c00c1023fb7d01f1f9761f. Change-Id: I87496342943248e94f01ada31459f387c0a3a610 Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-05API: Add service definitions for events and singleton messages.Ole Troan1-17/+30
Change-Id: I7de987c30b263d43521e6280c5273f30b5f6e11c Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-03VPPAPIGEN: Improve output module finding for out-of-tree builds.Ole Troan1-2/+12
Change-Id: I3b646d84586dd61018f71cbf21c971c97fda75c1 Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-09vppapigen: simplify JSON format for servicesMarek Gradzki1-2/+2
Use "services": { "foo_request": { "reply": "foo_request_reply" }, "foo_dump": { "reply": "foo_details", "stream": true } }, instead of: "services": [ { "foo_request": { "reply": "foo_request_reply" } }, { "foo_dump": { "reply": "foo_details", "stream": true } } ], Change-Id: I1d8e6bb4d41541b7f7f63242935f2ed4467fc52b Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan10-2980/+1171
This is a version of the VPP API generator in Python PLY. It supports the existing language, and has a plugin architecture for generators. Currently C and JSON are supported. Changes: - vl_api_version to option version = "major.minor.patch" - enum support - Added error checking and reporting - import support (removed the C pre-processor) - services (tying request/reply together) Version: option version = "1.0.0"; Enum: enum colours { RED, BLUE = 50, }; define foo { vl_api_colours_t colours; }; Services: service { rpc foo returns foo_reply; rpc foo_dump returns stream foo_details; rpc want_stats returns want_stats_reply events ip4_counters, ip6_counters; }; Future planned features: - unions - bool, text - array support (including length) - proto3 output plugin - Refactor C/C++ generator as a plugin - Refactor Java generator as a plugin Change-Id: Ifa289966c790e1b1a8e2938a91e69331e3a58bdf Signed-off-by: Ole Troan <ot@cisco.com>
2017-12-14Fix display of single-event event-logsDave Barach2-1/+8
Change-Id: Ib3e25916c66fa3e1b082359095652c45d3b27d0f Signed-off-by: Dave Barach <dave@barachs.net>
2017-10-09vppapigen: support per-file (major,minor,patch) version stampsDave Barach4-4/+79
Add one of these statements to foo.api: vl_api_version 1.2.3 to generate a version tuple stanza in foo.api.h: /****** Version tuple *****/ vl_api_version_tuple(foo, 1, 2, 3) Change-Id: Ic514439e4677999daa8463a94f948f76b132ff15 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Ole Troan <ot@cisco.com>
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine1-1/+1
- always use 'va_args' as pointer in all format_* functions - u32 for all 'indent' params as it's declaration was inconsistent Change-Id: Ic5799309a6b104c9b50fec309cba789c8da99e79 Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
2017-05-10Allow to override the build dateBernhard M. Wiedemann1-1/+6
using the SOURCE_DATE_EPOCH env var to make vpp package builds reproducible. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. Change-Id: Iae0935c9bb4ccdfdb65600be543945a88f2e137f Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2017-05-09Fix remaining 32-bit compile issuesDamjan Marion2-5/+5
Change-Id: I9664214652229b663c3e3ba7406b4ede96bfb123 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-04-25"autoreply" flag: autogenerate standard xxx_reply_t messagesDave Barach5-3/+65
Change-Id: I72298aaae7d172082ece3a8edea4217c11b28d79 Signed-off-by: Dave Barach <dave@barachs.net>
2017-04-04Clear pid-vector, to avoid spurious track selectionDave Barach2-4/+4
Change-Id: Ibc293aa1305126920c0b2c44df1f7a7d5ae9ea9d Signed-off-by: Dave Barach <dave@barachs.net>
2017-04-03g2: add multi-track time-slew controlsDave Barach3-15/+357
Create an elog_merge utility, extracted from test_elog. Change-Id: Ide137b4858c88b3a2885583b7fbb15ddc4963af9 Signed-off-by: Dave Barach <dave@barachs.net>
2017-04-01Clean up event log merge codeDave Barach1-2/+5
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 <dave@barachs.net>
2017-03-25g2, c2cpel, and cpeldump: scale to 8M event log filesDave Barach3-0/+9
Change-Id: I7d7748c9c44132d033a9aff1687112ffcb44c460 Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-03-02VPP-608: fix coverity warning in vppapigenDave Barach1-2/+2
Change-Id: Ic26216bb03d941c1625a61c1c3340d2d70d84bd0 Signed-off-by: Dave Barach <dave@barachs.net>
2017-02-28Fix warning in generated codeDave Barach1-4/+14
Change-Id: Ie56fca84a8a0ed77ee480e8078e6e9b3f4cef105 Signed-off-by: Dave Barach <dave@barachs.net>
2017-01-01Move java,lua api and remaining plugins to src/Damjan Marion3-38/+0
Change-Id: I1c3b87e886603678368428ae56a6bd3327cbc90d Signed-off-by: Damjan Marion <damarion@cisco.com>
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion36-0/+14621
Change-Id: I7b51f88292e057c6443b12224486f2d0c9f8ae23 Signed-off-by: Damjan Marion <damarion@cisco.com>