Restore global logging state mutated by the logger tests
## Problem
`test_app_metadata_generate::test_broken_app_is_logged` has failed every incremental build since it was added, while passing when its file is run on its own. `run_unit_tests.py` puts both unit test directories through `pytest.main()` in a single interpreter, and `test__middleware_logger_paths` calls `setup_syslog_handler()` for every entry in `ALL_LOG_FILES` — which attaches a queue handler and sets `propagate = False`, neither of which it can undo. By the time the middleware suite runs, `app_lifecycle` no longer propagates to root, which is the only place `caplog` installs its handler, so `caplog.text` comes back empty. `ALL_LOG_FILES` also carries an unnamed entry, so one of those leaked handlers lands on the root logger and every record from the second run was being shipped off to the real middlewared log.
## Solution
Added an autouse fixture to the logger tests that snapshots propagation up front and, on teardown, restores it and strips any queue handler the suite left behind. Filtering by handler class rather than diffing the handler list matters here: one of these loggers is root, and pytest swaps its own capture handlers there between a test's setup and teardown phases.
Also dropped the comment in `test_broken_app_is_logged` claiming the `logger=` keyword binds the handler — `caplog.at_level` only sets levels, and nothing configures middleware logging in a unit test process, so the comment was wrong on both counts.
[IR][IPO] Don't rewrite the signature of optnone functions (#211804)
Summary:
This PR unifies the behavior of attributes the prevent signature
requires, like `naked`, with `optnone`. Currently, `optnone` functions
are not restricted from taking plcae in IPO passes by design. However,
this means that in places the signature will still be rewritten, which
is likely not what users who make use of `optnone` desire. This PR will
allow `optnone` functions to still take place in IPO optimizations but
will disallow signatures being rewritten. This ensures the funciton
itself does not change beteen `-O0` and `-O2`.
The motivation behind this was GDB users observing debug info changes w/
and w/o LTO. Observed because LTO passes `lto<O2>` by default and
normally relies on `optnone` and `noinline` to preserve semantics.
This is the 'proper' fix to
https://github.com/llvm/llvm-project/pull/211790 which can land if the
pass maintainers believe this is incorrect.
[clang] Fix couroutine error for operator new. (#215619)
Fix error occuring with couroutines:
"error: too many arguments to function call, expected 3, have 4" for
operator new.
Introduced by cd67cfecb1a1.
AI assisted explanation of the issue:
Prior to cd67cfecb1a1, Sema::FindAllocationFunctions took OperatorNew by
reference and would unconditionally reset it to nullptr at the beginning
of its search. The commit changed FindAllocationFunctions to return a
std::optional<ResolvedAllocation>.
In clang/lib/Sema/SemaCoroutine.cpp, the result is handled like this:
1 IAP = ImplicitAllocationParameters(
2 alignedAllocationModeFromBool(ShouldUseAlignedAlloc));
3
[28 lines not shown]
igc: defer sysctl-driven reinit to the admin task
igc_sysctl_eee() and igc_sysctl_dmac() called igc_if_init() directly.
Request the reset through iflib instead, and skipping while the interface
is down; the new value is picked up by the next init.
Unlike e1000, igc has no ASSERT_CTX_LOCK_HELD and no acquire_swflag
path, so the defect is silent here rather than an assertion failure.
While here also remove unnecessary igc_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58629
(cherry picked from commit 30ccf2f48c11e54fc0540510dcec7cd006a2c366)
e1000: defer sysctl-driven reinit to the admin task
Request the reset through iflib and let the admin task perform the
stop/init under the context lock, matching what the VF and SR-IOV paths
already do.
The assertion is compiled out without INVARIANTS, where the same write
instead resets the MAC and takes the ICH software flag while the queues
stay live and an ioctl or the admin task may be running.
While here also remove unnecessary em_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58628
(cherry picked from commit abdde8b602813753e423610b39be6806da5647e2)
igc: defer sysctl-driven reinit to the admin task
igc_sysctl_eee() and igc_sysctl_dmac() called igc_if_init() directly.
Request the reset through iflib instead, and skipping while the interface
is down; the new value is picked up by the next init.
Unlike e1000, igc has no ASSERT_CTX_LOCK_HELD and no acquire_swflag
path, so the defect is silent here rather than an assertion failure.
While here also remove unnecessary igc_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58629
(cherry picked from commit 30ccf2f48c11e54fc0540510dcec7cd006a2c366)
e1000: defer sysctl-driven reinit to the admin task
Request the reset through iflib and let the admin task perform the
stop/init under the context lock, matching what the VF and SR-IOV paths
already do.
The assertion is compiled out without INVARIANTS, where the same write
instead resets the MAC and takes the ICH software flag while the queues
stay live and an ioctl or the admin task may be running.
While here also remove unnecessary em_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58628
(cherry picked from commit abdde8b602813753e423610b39be6806da5647e2)
[RISCV] Diagnose -mtune CPU with a : and no features as requiring -mexperimental-mtune-syntax. (#215855)
Without -mexperimental-mtune-syntax -mtune=sifive-x280: was considering
sifive-x280: as the full CPU name and give an invalid CPU error. With
this
patch we now diagnose any use of the : even if there's nothing after it.
[LLVM][Support] Add options to control DAG graph dumps (#214314)
Currently, using options such as -view-isel-dags or -view-sched-dags
outputs the generated graphs into /tmp and opens a DAG viewer (such as
GraphViz) by default. This poses an issue if your machine doesn't have
an appropriate graph viewer or GUI support, or if you want to simply
output the graphs in a specific folder for viewing later.
This commit adds 2 command line options to specify behavior:
-dag-file-location: Specify the location graph .dot files will be
written
-no-open-dag-viewer: Don't open graph viewing tools