From a14944db4ec3bb3f13fdd2df2a61c07f60a5f352 Mon Sep 17 00:00:00 2001 From: marcin-ol Date: Wed, 21 Sep 2022 11:44:11 +0200 Subject: [PATCH] perf: Update perf to use exec_comm after thread forking (#474) --- scripts/perf_build.sh | 2 +- tests/test_perf.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts/perf_build.sh b/scripts/perf_build.sh index 4409ef0cb..0be131fb2 100755 --- a/scripts/perf_build.sh +++ b/scripts/perf_build.sh @@ -6,7 +6,7 @@ set -euo pipefail # downloading the zip because the git is very large (this is also very large, but still smaller) -curl -SL https://codeload.github.com/Granulate/linux/zip/1ebd66ff4664ad88421e4b1c7294e4f8987b36e1 -o linux.zip +curl -SL https://codeload.github.com/Granulate/linux/zip/37e33e68d0a02f31f46e089d4a33d9877ed79768 -o linux.zip unzip -qq linux.zip rm linux.zip cd linux-*/ diff --git a/tests/test_perf.py b/tests/test_perf.py index ede8df02d..fe13a9dc0 100644 --- a/tests/test_perf.py +++ b/tests/test_perf.py @@ -116,7 +116,6 @@ def test_perf_comm_change( _assert_comm_in_profile(profiler, application_pid, True) -@pytest.mark.xfail(reason="https://github.com/Granulate/gprofiler/issues/431") @pytest.mark.parametrize("runtime", ["native_thread_comm"]) @pytest.mark.parametrize("perf_mode", ["fp"]) # only fp is enough @pytest.mark.parametrize("in_container", [True]) # native app is built only for container @@ -131,8 +130,6 @@ def test_perf_thread_comm_is_process_comm( changes its comm. The stack output by perf should use the comm of the process (i.e the main thread), and when the process starts after perf, the exec comm of the process should be used (see test_perf_comm_change) - - This test currently fails but describes the desired behavior. """ with system_profiler as profiler: # running perf & script now with --show-task-events would show: @@ -153,8 +150,4 @@ def test_perf_thread_comm_is_process_comm( # oative 1925904 [006] 987095.272545: PERF_RECORD_FORK(1925904:1925947):(1925904:1925904) # pative 1925947 [010] 987095.272656: PERF_RECORD_COMM: pative:1925904/1925947 # we take the exec comm for all threads so we remain with the first, "native". - - # this fails - because in thread__fork(), perf takes only the current comm of the forking thread - # and attaches it to the forked one. thus the exec comm (which is not current, but last) is lost. - # the fix can be to copy all comms in thread__fork(). _assert_comm_in_profile(profiler, application_pid, True)