> For VPP 20.05 the following works to extract /sys/vector_rate > statistics: > > #!/usr/bin/python3 > from vpp_papi.vpp_stats import VPPStats > stat = VPPStats("/run/vpp/stats.sock") > dir = stat.ls(['^/sys/vector_rate']) > counters = stat.dump(dir) > vector_rate=counters.get('/sys/vector_rate') > print("vector_rate = ", vector_rate) > > Unfortunately, with VPP 20.09 the stat client crashes when doing that. > Seems like a problem introduced by https://gerrit.fd.io/r/c/vpp/+/28017 > (stats: remove offsets on vpp side) and fixed in master by > https://gerrit.fd.io/r/c/vpp/+/29569 (stats: missing dimension in > stat_set_simple_counter). > > I was hoping this could be fixed by cherry-picking the fix into the > stable/2009 branch which I tried here: > https://gerrit.fd.io/r/c/vpp/+/30161 > However that does not pass the jenkins tests due to some problem > related to "vom" which was recently deprecated in the master branch, > that might explain why the fix works in master but not in stable/2009. > Still, the fix does work for me in stable/2009, maybe different > compiler version or other details matter and cause some of the jenkins > builds to fail. > > How to get around this, to make the stat client work for stable/2009 > also?
/w/workspace/vpp-verify-2009-ubuntu1804-x86_64/build-root/install-vpp-native/vpp/include/vpp-api/client/stat_client.h:107:11: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith] ((p + sizeof (p)) < ((void *) sm->shared_header + sm->memory_size))) ~~^~~~~~~~~~ Doing pointer arithmetic on an incomplete type (void) isn't entirely kosher. GCC supports it, and you could disable the warning. But the correct-est approach would be to cast it to a type with size 1. (and fix that in master too). Cheers, Ole
signature.asc
Description: Message signed with OpenPGP
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#18198): https://lists.fd.io/g/vpp-dev/message/18198 Mute This Topic: https://lists.fd.io/mt/78601259/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-