From: Kienan Stewart Date: Thu, 28 Sep 2023 20:54:42 +0000 (-0400) Subject: tests: Replace babelstats.pl with bt2 plugins X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=9f2636716abf0d6cc188fed380ba77a621a370c1;hp=9f2636716abf0d6cc188fed380ba77a621a370c1;p=lttng-tools.git tests: Replace babelstats.pl with bt2 plugins Observed Issue ============== `tests/regression/tools/filtering/test_valid_filters` is a long running test, especially when running as root and exercising the tests across the kernel domain. I observed that a sizable amount of time was being spent in the analysis of the results using `babelstats.pl`. Solution ======== Instead of using a script to parse the pretty output of babeltrace2, I decided to write two C++ plugins to replicate the behaviour of the `babelstats.pl` script. I measured the time using `sudo -E time ./path/to/test` | Test | Time with `babelstats.pl` | Time with bt2 plugins | | test_tracefile_count | 13.04s | 11.73s | | test_exclusion | 22.75s | 22.07s | | test_valid_filter | 301.04s | 144.41s | The switch to using babeltrace2 plugins reduces the runtime of the `test_valid_filter` test (when running with kernel tests) by half. The runtime changes to the other tests that were modified are not significant. Known drawbacks =============== The field_stats plugin behaviour differs from `babelstats.pl` with regards to enumeration fields ("container" in `babelstats.pl`). However, no tests depend on that behaviour to pass. The field_stats sink plugin doesn't perform a lot of run-time error-checking of functions it invokes, and doesn't fully clean up all the references it allocates though the babeltrace2 API. As the intended usage is for short lived invocations with relatively small traces, the principal drawback of this approach is that errors in the plugin may be harder to debug. Building tests of lttng-tools will now depend on having the babeltrace2 development headers and libraries available. Change-Id: Ie8ebdd255b6901a7d0d7c4cd584a02096cccd4fb Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau ---