Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: perf various combinations of test_perf_fp_dwarf_smart collapsed differ on aarch64 #746

Open
pfilipko1 opened this issue Mar 27, 2023 · 1 comment

Comments

@pfilipko1
Copy link
Contributor

Failing tests:

FAILED tests/test_perf.py::test_perf_fp_dwarf_smart[True-fp-native_fp] - AssertionError: assert (True ^ True)
FAILED tests/test_perf.py::test_perf_fp_dwarf_smart[True-dwarf-native_fp] - AssertionError: function ';recursive;recursive;recursive;recursive;' missing in collapsed data!
FAILED tests/test_perf.py::test_perf_fp_dwarf_smart[True-dwarf-native_dwarf] - AssertionError: assert (False ^ False)
FAILED tests/test_perf.py::test_perf_fp_dwarf_smart[True-smart-native_dwarf] - AssertionError: assert (False ^ False)

Exemplary output:

system_profiler = <gprofiler.profilers.perf.SystemProfiler object at 0xffffa4cb4ee0>, application_pid = 1478804, runtime = 'native_dwarf', perf_mode = 'smart', application_docker_container = <Container: 51caf27de4>

    @pytest.mark.parametrize("runtime", ["native_fp", "native_dwarf"])
    @pytest.mark.parametrize("perf_mode", ["fp", "dwarf", "smart"])
    @pytest.mark.parametrize("in_container", [True])  # native app is built only for container
    def test_perf_fp_dwarf_smart(
        system_profiler: SystemProfiler,
        application_pid: int,
        runtime: str,
        perf_mode: str,
        application_docker_container: Container,
    ) -> None:
        with system_profiler as profiler:
            process_profile = snapshot_pid_profile(profiler, application_pid)
            process_collapsed = process_profile.stacks
            with open("perf.txt","a") as f:
                f.write(str(process_collapsed))
                f.write("")
            if runtime == "native_dwarf":
                # app is built with DWARF info and without FP, so we expect to see a callstack only in DWARF or smart modes.
>               assert is_function_in_collapsed(";recursive;recursive;recursive;recursive;", process_collapsed) ^ bool(
                    perf_mode not in ("dwarf", "smart")
                )
E               AssertionError: assert (False ^ False)
E                +  where False = is_function_in_collapsed(';recursive;recursive;recursive;recursive;', Counter({'native;_start;recursive': 90}))
E                +  and   False = bool('smart' not in ('dwarf', 'smart'))

tests/test_perf.py:66: AssertionError
@Jongy
Copy link
Contributor

Jongy commented Apr 11, 2023

I think these failures are all due to https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm64/kernel/perf_callchain.c?id=33c222aeda14596ca5b9a1a3002858c6c3565ddd. This causes unwinding to show only one level in certain cases, so this test (which checks for multiple levels recursive;recursive;recursive;... fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants