Commit 6f53be35 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #1687 from iovisor/yhs_dev2

fix test_libbcc failure with 4.15.
parents 22166d00 c40b5fd6
......@@ -131,7 +131,11 @@ TEST_CASE("test attach perf event", "[bpf_perf_event]") {
auto ret = bpf.get_hash_table<int, int>("ret");
REQUIRE(ret[0] == 0);
REQUIRE(counter.counter >= 0);
REQUIRE(counter.enabled >= 1000000000);
// the program slept one second between perf_event attachment and detachment
// in the above, so the enabled counter should be 1000000000ns or
// more. But in reality, most of counters (if not all) are 9xxxxxxxx,
// and I also saw one 8xxxxxxxx. So let us a little bit conservative here.
REQUIRE(counter.enabled >= 800000000);
REQUIRE(counter.running >= 0);
REQUIRE(counter.running <= counter.enabled);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment