bcc/python: Add test_attach_perf_event.py to CMake tests
authorDave Marchevsky <davemarchevsky@fb.com>
Sat, 14 Aug 2021 04:02:12 +0000 (21:02 -0700)
committeryonghong-song <ys114321@gmail.com>
Thu, 19 Aug 2021 17:24:22 +0000 (10:24 -0700)
commit9871201443482837bf40474a16bbf9f22cd0b193
tree3d26e1f1ba4b76d0f958826c5d2dce16aa3ee912
parent16b65f0e7a04f5c9438d19c698c035892ebbdcb9
bcc/python: Add test_attach_perf_event.py to CMake tests

Add to CMakeLists.txt of tests so that the test is run as part of github
actions test suite. Shorten the sleep duration so test finishes faster -
since it's just testing attach currently the extra time isn't producing
more signal.

Also add python equivalent of `perf_event_sample_format` enum so
`sample_type` can be more clearly set.

v2: The test doesn't work on ubuntu 16.04 due to old kernel headers. It
doesn't work on the rest of the github actions VMs due to hardware perf
events not being supported, so add necessary check / skip.
src/python/bcc/__init__.py
tests/python/CMakeLists.txt
tests/python/test_attach_perf_event.py