diff options
author | Stefan Hajnoczi | 2021-04-14 22:02:46 +0200 |
---|---|---|
committer | Stefan Hajnoczi | 2021-07-05 12:40:32 +0200 |
commit | 0f08586c7171757d77c27ee6c606e8a1c44ac6e3 (patch) | |
tree | 353c4ebb7279d41714e393efd47fabafe1a0807f /tests/unit | |
parent | Merge remote-tracking branch 'remotes/philmd/tags/mips-20210702' into staging (diff) | |
download | qemu-0f08586c7171757d77c27ee6c606e8a1c44ac6e3.tar.gz qemu-0f08586c7171757d77c27ee6c606e8a1c44ac6e3.tar.xz qemu-0f08586c7171757d77c27ee6c606e8a1c44ac6e3.zip |
util/async: add a human-readable name to BHs for debugging
It can be difficult to debug issues with BHs in production environments.
Although BHs can usually be identified by looking up their ->cb()
function pointer, this requires debug information for the program. It is
also not possible to print human-readable diagnostics about BHs because
they have no identifier.
This patch adds a name to each BH. The name is not unique per instance
but differentiates between cb() functions, which is usually enough. It's
done by changing aio_bh_new() and friends to macros that stringify cb.
The next patch will use the name field when reporting leaked BHs.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210414200247.917496-2-stefanha@redhat.com>
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/ptimer-test-stubs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/ptimer-test-stubs.c b/tests/unit/ptimer-test-stubs.c index 7f801a4d09..2a3ef58799 100644 --- a/tests/unit/ptimer-test-stubs.c +++ b/tests/unit/ptimer-test-stubs.c @@ -108,7 +108,7 @@ int64_t qemu_clock_deadline_ns_all(QEMUClockType type, int attr_mask) return deadline; } -QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque) +QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name) { QEMUBH *bh = g_new(QEMUBH, 1); |