Commit 63640471 authored by Brenden Blanco's avatar Brenden Blanco

The use of schedule+<offset> was unstable, remove it

* After a kernel update, the binary of schedule function changed offset,
  and the attachment point updated. Since this is just a test case, pick
  a different function to test.
Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
parent 3818914b
...@@ -26,13 +26,13 @@ class TestTracingEvent(TestCase): ...@@ -26,13 +26,13 @@ class TestTracingEvent(TestCase):
def setUp(self): def setUp(self):
b = BPF(text=text, debug=0) b = BPF(text=text, debug=0)
self.stats = b.get_table("stats") self.stats = b.get_table("stats")
b.attach_kprobe(event="schedule+50", fn_name="count_sched", pid=0, cpu=-1) b.attach_kprobe(event="finish_task_switch", fn_name="count_sched", pid=0, cpu=-1)
def test_sched1(self): def test_sched1(self):
for i in range(0, 100): for i in range(0, 100):
sleep(0.01) sleep(0.01)
for key, leaf in self.stats.items(): for key, leaf in self.stats.items():
print("ptr %x:" % key.ptr, "stat1 %x" % leaf.stat1) print("ptr %x:" % key.ptr, "stat1 %d" % leaf.stat1)
if __name__ == "__main__": if __name__ == "__main__":
main() main()
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