]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: applet: instrument appctx_wakeup() to log the caller's location
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Sep 2022 12:45:55 +0000 (14:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Sep 2022 12:30:38 +0000 (14:30 +0200)
commit8d71abf0cd8fa516cc30ba312612e30eb4c09ab4
treebfbf9bec793934e92361453bb479583fccdf35cd
parente08af9a0f4fd2ef5c32f62e649235855d4dc0b41
DEBUG: applet: instrument appctx_wakeup() to log the caller's location

appctx_wakeup() relies on task_wakeup(), but since it calls it from a
function, the calling place is always appctx_wakeup() itself, which is
not very useful.

Let's turn it to a macro so that we can log the location of the caller
instead. As an example, the cli_io_handler() which used to be seen as
this:

  (gdb) p *appctx->t.debug.caller[0]
  $10 = {
    func = 0x9ffb78 <__func__.37996> "appctx_wakeup",
    file = 0x9b336a "include/haproxy/applet.h",
    line = 110,
    what = 1 '\001',
    arg8 = 0 '\000',
    arg32 = 0
  }

Now shows the more useful:

  (gdb) p *appctx->t.debug.caller[0]
  $6 = {
    func = 0x9ffe80 <__func__.38641> "sc_app_chk_snd_applet",
    file = 0xa00320 "src/stconn.c",
    line = 996,
    what = 6 '\006',
    arg8 = 0 '\000',
    arg32 = 0
  }
include/haproxy/applet.h