[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] util/async: add a human-readable name to BHs for debuggi
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 1/2] util/async: add a human-readable name to BHs for debugging |
Date: |
Thu, 15 Apr 2021 11:08:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
On 4/14/21 10:02 PM, Stefan Hajnoczi wrote:
> 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>
> ---
> include/block/aio.h | 31 ++++++++++++++++++++++++++++---
> include/qemu/main-loop.h | 4 +++-
> tests/unit/ptimer-test-stubs.c | 2 +-
> util/async.c | 9 +++++++--
> util/main-loop.c | 4 ++--
> 5 files changed, 41 insertions(+), 9 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>