This issue also occurs on ppc64el. I have a proposed fix for the
testcase "follow events clear" mentioned.

I have not been able to test this on ppc64el yet (due to an outage
restricting my lab access today). However, for amd64 this works (on
resolute).

It looks like this issue was introduced by commit 310b796 (libtracefs
utest: Add better logic to cause missed events). I believe the purpose
of the commit was to reduce the size of the buffer in order to trigger
missed events more reliably.

The potential issue with this commit is that getpagesize() returns the
page size in bytes, and tracefs_instance_set_buffer_size() expects the
buffer size to be passed in kilobytes. Therefore, the buffer size is
being set to 1024 times greater than what I think it was originally
intended to be set to.

This may also explain why this testcase passes under the valgrind run,
as that would likely increase the odds of missed events even with that
increased buffer size.

In utest/tracefs-utest.c:

---

        /* Shrink the buffer to make sure we have missed events */ 
        page_size = getpagesize();
        save_size = tracefs_instance_get_buffer_size(instance, 0);
-       ret = tracefs_instance_set_buffer_size(instance, page_size * 4, 0);
+       ret = tracefs_instance_set_buffer_size(instance, (page_size * 4) / 
1024, 0);
        CU_TEST(ret == 0);
 
        tracefs_trace_on(instance);
        call_getppid(100);
        /* Stir the kernel a bit */
        list = tracefs_event_systems(NULL);
        tracefs_list_free(list);
        system("ls -l /usr/bin > /dev/null");
        tracefs_trace_off(instance);

---

Commit that I believe introduced the issue:
https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/commit/?h=libtracefs&id=310b7964c41fe9521ca6c6954d77e0b416c62912

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2172071

Title:
  trace-utest and trace-utest-valgrind autopkgtest fail

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libtracefs/+bug/2172071/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to