Skip to content

Commit

Permalink
Merge pull request iovisor#1687 from iovisor/yhs_dev2
Browse files Browse the repository at this point in the history
fix test_libbcc failure with 4.15.
  • Loading branch information
4ast committed Apr 16, 2018
2 parents 22166d0 + c40b5fd commit 6f53be3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/cc/test_perf_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f53be3

Please sign in to comment.