Skip to content
  • Stefan Hajnoczi's avatar
    0f08586c
    util/async: add a human-readable name to BHs for debugging · 0f08586c
    Stefan Hajnoczi authored
    
    
    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: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20210414200247.917496-2-stefanha@redhat.com>
    0f08586c
    util/async: add a human-readable name to BHs for debugging
    Stefan Hajnoczi authored
    
    
    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: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20210414200247.917496-2-stefanha@redhat.com>
Loading