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

gh-107954, PEP 741: Add PyConfig_Get() function #123472

Merged
merged 18 commits into from
Sep 2, 2024
Merged

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 29, 2024

Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and PyConfig_Names() functions to get and set the current runtime Python configuration.

_PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary.


📚 Documentation preview 📚: https://cpython-previews--123472.org.readthedocs.build/

Add PyConfig_Get(), PyConfig_GetInt(), PyConfig_Set() and
PyConfig_Names() functions to get and set the current runtime Python
configuration.

_PyConfig_AsDict() now converts PyConfig.xoptions as a dictionary.
@vstinner
Copy link
Member Author

(Previous version of the PR, before PEP 741 was accepted: #112609.)

@vstinner
Copy link
Member Author

cc @zooba

Copy link
Contributor

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much to say except my usual style nitpicks.

Doc/c-api/init_config.rst Outdated Show resolved Hide resolved
Doc/c-api/init_config.rst Show resolved Hide resolved
Doc/c-api/init_config.rst Show resolved Hide resolved
Doc/c-api/init_config.rst Show resolved Hide resolved
Doc/c-api/init_config.rst Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Outdated Show resolved Hide resolved
Python/initconfig.c Show resolved Hide resolved
vstinner and others added 6 commits August 30, 2024 18:37
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
@vstinner
Copy link
Member Author

@picnixz: About your suggested changes to replace type* with type *: I prefer type* for the return type, and type *var for declaration. It's just a personal preference, and I don't think that PEP 7 enforces a specific formatting. It should also be consistent with existing code in initconfig.c (I wrote most of its code).

@vstinner
Copy link
Member Author

@picnixz: I addressed most of your reviews.

@picnixz
Copy link
Contributor

picnixz commented Aug 31, 2024

About your suggested changes to replace type* with type : I prefer type for the return type, and type *var for declaration. It's just a personal preference, and I don't think that PEP 7 enforces a specific formatting. It should also be consistent with existing code in initconfig.c (I wrote most of its code).

Sound good to me. Consistency in this case is better so I'm fine. And PEP 7 indeed doesn't say anything on this matter (it just says that the function name must be on its own line I think).

I addressed most of your reviews.

Thank you!

@vstinner vstinner merged commit 33b7909 into python:main Sep 2, 2024
37 checks passed
@vstinner vstinner deleted the config_get branch September 2, 2024 21:25
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Arch Linux Perf 3.x has failed when building commit 33b7909.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1078/builds/3574) and take a look at the build logs.
  4. Check if the failure is related to this commit (33b7909) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1078/builds/3574

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py' not found in 'perf-exec 1679626 3573275.289032:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1679626 3573275.289039:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1679626 3573275.289042:        180 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 
rfbuild/build/python)\n\t    7f263ac630bf [unknown] (//anon)\n\npython 1679626 3573275.417040:   61490717 cycles:P: \n\t    557dffe59297 _PyLong_FromMedium+0x127 (inlined)\n\t    557dffe59297 PyLong_FromLong+0x127 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb36b3 _PyEval_EvalFrameDefault+0xb7b3 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.431311:   55605021 cycles:P: \n\t    557dffda9a41 _PyEval_EvalFrameDefault+0x1b41 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.444329:   50474003 cycles:P: \n\t    557dffe4fc8d long_normalize+0x12d (inlined)\n\t    557dffe4fc8d x_add+0x12d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.455972:   48925544 cycles:P: \n\t    557dffea4e09 pymalloc_alloc+0x39 (inlined)\n\t    557dffea4e09 _PyObject_Malloc+0x39 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffe4fbc5 _PyLong_New+0x65 (inlined)\n\t    557dffe4fbc5 x_add+0x65 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.467281:   47144381 cycles:P: \n\t    557dffdb36a8 _PyEval_EvalFrameDefault+0xb7a8 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.478197:   46067344 cycles:P: \n\t    557dffdabd64 _PyEval_EvalFrameDefault+0x3e64 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.488837:   45298900 cycles:P: \n\t    557dffe4fbcd _PyLong_New+0x6d (inlined)\n\t    557dffe4fbcd x_add+0x6d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.499289:   44938714 cycles:P: \n\t    557dffdabd42 _Py_atomic_load_uintptr_relaxed+0x3e42 (inlined)\n\t    557dffdabd42 _PyEval_EvalFrameDefault+0x3e42 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.509596:   44608188 cycles:P: \n\t    557dffe5ea24 _PyLong_Add+0x44 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffdb0904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.519834:   44461292 cycles:P: \n\t    557dffe4ee4d _PyLong_CompactValue+0x1d (inlined)\n\t    557dffe4ee4d long_dealloc+0x1d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    557dffda9a43 _PyEval_EvalFrameDefault+0x1b43 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f263ac24ae5 py::foo:/tmp/test_python_kny9768u/tmphjpqq00r/perftest.py+0x5 (/tmp/perf-1679626.map)\n\npython 1679626 3573275.530104:   44244567 cycles:P: \n\t


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py' not found in 'perf-exec 1688463 3573495.449281:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1688463 3573495.449288:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1688463 3573495.449291:        184 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1688463 3573495.449294:      66558 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unkn
up+0x693 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a49baaa3 _PyDict_GetItemRef_KnownHash+0x23 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a08eb5 find_name_in_mro+0xa5 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a1277b update_one_slot+0xfb (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a1b2bf fixup_slot_dispatchers+0xcbf (inlined)\n\t    5580a4a1b2bf type_new_impl+0xcbf (inlined)\n\t    5580a4a1b2bf type_new+0xcbf (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a4a0550c tp_new_wrapper+0xfc (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a49ca6ea cfunction_call+0x5a (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a496409a _PyObject_Call+0x7a (inlined)\n\t    5580a496409a PyObject_Call+0x7a (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48f37fd _PyEval_EvalFrameDefault+0x8fd (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c72e5 py::ABCMeta.__new__:<frozen abc>+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.568523:   76108142 cycles:P: \n\t    5580a49efdd0 _PyObject_Malloc+0x0 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7ffe86f589bf [unknown] ([stack])\n\npython 1688463 3573495.585826:   62998085 cycles:P: \n\t    5580a49a419b PyLong_FromLong+0x2b (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48fe6b3 _PyEval_EvalFrameDefault+0xb7b3 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.600167:   55298926 cycles:P: \n\t    5580a499acc4 _PyLong_SetDigitCount+0x164 (inlined)\n\t    5580a499acc4 long_normalize+0x164 (inlined)\n\t    5580a499acc4 x_add+0x164 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48fb904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.612740:   51712861 cycles:P: \n\t    5580a48f626c _PyEval_EvalFrameDefault+0x336c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.624533:   49256868 cycles:P: \n\t    5580a4999e39 long_dealloc+0x9 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48f4a43 _PyEval_EvalFrameDefault+0x1b43 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.635732:   48123553 cycles:P: \n\t    5580a48f4a41 _PyEval_EvalFrameDefault+0x1b41 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.646675:   46903439 cycles:P: \n\t    5580a48f6d6e _PyEval_EvalFrameDefault+0x3e6e (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::foo:/tmp/test_python_g743bzl5/tmpl1emz2od/perftest.py+0x5 (/tmp/perf-1688463.map)\n\npython 1688463 3573495.657413:   46067424 cycles:P: \n\t    5580a49efe16 pymalloc_alloc+0x46 (inlined)\n\t    5580a49efe16 _PyObject_Malloc+0x46 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a499abc5 _PyLong_New+0x65 (inlined)\n\t    5580a499abc5 x_add+0x65 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    5580a48fb904 _PyEval_EvalFrameDefault+0x8a04 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64.perfbuild/build/python)\n\t    7f6d5b8c7ae5 py::

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Arch Linux TraceRefs 3.x has failed when building commit 33b7909.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/484/builds/5851) and take a look at the build logs.
  4. Check if the failure is related to this commit (33b7909) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/484/builds/5851

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_a63br8fn/tmph7x9rrja/perftest.py' not found in 'perf-exec 1713407 3574522.920521:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1713407 3574522.920529:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1713407 3574522.920533:        146 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/test/test_perf_profiler.py", line 356, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertIn(f"py::bar:{script}", stdout)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'py::bar:/tmp/test_python_0fcql3_d/tmptgchnrw3/perftest.py' not found in 'perf-exec 1724972 3574960.855300:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1724972 3574960.855307:          1 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1724972 3574960.855310:        189 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tffffffff98000124 [unknown] ([unknown])\n\nperf-exec 1724972 3574960.855313:      73570 cycles:P: \n\tffffffff9729cea6 [unknown] ([unknown])\n\tffffffff97215c15 [unknown] ([unknown])\n\tffffffff9720f95b [unknown] ([unknown])\n\tffffffff974a9ff8 [unknown] ([unknown])\n\tffffffff974afe11 [unknown] ([unknown])\n\tffffffff975a945a [unknown] ([unknown])\n\tffffffff97622c80 [unknown] ([unknown])\n\tffffffff975a73e1 [unknown] ([unknown])\n\tffffffff975a75c1 [unknown] ([unknown])\n\tffffffff975a8101 [unknown] ([unknown])\n\tffffffff975a81fe [unknown] ([unknown])\n\tffffffff975a8548 [unknown] ([unknown])\n\tffffffff975a8867 [unknown] ([unknown])\n\tffffffff972054f0 [unknown] ([unknown])\n\tffffffff97fc63e6 [unknown] ([unknown])\n\tf
thon)\n\t    56217dfdd4b4 _Py_Dealloc+0x6c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e024bf0 Py_DECREF+0x3c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e030c8f intern_common+0x17d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e06174e _PyUnicode_InternMortal+0x18 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e061800 PyUnicode_InternFromString+0x35 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df950db descr_new+0x40 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df961f5 PyDescr_NewMethod+0x91 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e00c9f2 type_add_method+0x120 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e00caab type_add_methods+0x26 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e00cd14 type_ready_fill_dict+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e01ab0c type_ready+0xb7 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0131fc PyType_Ready+0x3b (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e013f36 _PyType_FromMetaclass_impl+0x906 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0142c0 PyType_FromModuleAndSpec+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e188d43 iomodule_exec+0x11e (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217dfdadc3 PyModule_ExecDef+0x82 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e108dca exec_builtin_or_dynamic+0x4d (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e108ddf _imp_exec_builtin_impl+0xb (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e109211 _imp_exec_builtin+0xd (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217dfd8457 cfunction_vectorcall_O+0x66 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df8994d _PyVectorcall_Call+0x74 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df89c65 _PyObject_Call+0x145 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df89c9d PyObject_Call+0x1f (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0b814a _PyEval_EvalFrameDefault+0x53a4 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc218 _PyEval_EvalFrame+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc335 _PyEval_Vector+0xd9 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df87d60 _PyFunction_Vectorcall+0x53 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df880c1 _PyObject_VectorcallTstate+0x51 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df88edb object_vacall+0x112 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217df89014 PyObject_CallMethodObjArgs+0xfe (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e108c33 import_find_and_load+0x124 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e10c7d8 PyImport_ImportModuleLevelObject+0x1b4 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0b2192 _PyEval_ImportName+0xbc (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0bfa07 _PyEval_EvalFrameDefault+0xcc61 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc218 _PyEval_EvalFrame+0x1c (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc335 _PyEval_Vector+0xd9 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0cc3f4 PyEval_EvalCode+0xaf (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0aade7 builtin_exec_impl+0x409 (/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/python)\n\t    56217e0aaef4 builtin_exec+0xde (/buildbot/buildarea/3.x.pablogsal-arch-x86_64

@pablogsal
Copy link
Member

@vstinner Seems this PR broke the Linux perf profiler buildbots (and have been broken since)

@vstinner
Copy link
Member Author

@pablogsal do you have some details?

@pablogsal
Copy link
Member

No other than the buildbot logs

@pablogsal
Copy link
Member

I can try to look into this once I am back from the core dev sprint since here I don't have a laptop with new enough perf

@pablogsal
Copy link
Member

I can confirm that the previous commit builds correctly

@pablogsal
Copy link
Member

Found the problem: #124636

@diegorusso
Copy link
Contributor

Yes, it fixes the issue I raised

Thanks!

@diegorusso
Copy link
Contributor

But also the real question is: why wasn't this picked up by the GH runners and rely on buildbot builds?

@pablogsal
Copy link
Member

But also the real question is: why wasn't this picked up by the GH runners and rely on buildbot builds?

Because running the minimum Perf in GH runners is close to impossible

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

Successfully merging this pull request may close these issues.

5 participants