You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.7 KiB

  1. commit 3a761682a65e7e7f7baf172f58b15e567a685387
  2. Author: Willy Tarreau <w@1wt.eu>
  3. Date: Wed Aug 21 14:12:19 2019 +0200
  4. MINOR: debug: indicate the applet name when the task is task_run_applet()
  5. This allows to figure what applet is currently being executed (and likely
  6. hung).
  7. (cherry picked from commit a512b02f67a30ab5519d04f8c8b1263415321c85)
  8. [wt: backported to improve troubleshooting when the watchdog fires]
  9. Signed-off-by: Willy Tarreau <w@1wt.eu>
  10. diff --git a/src/debug.c b/src/debug.c
  11. index 3077e97c..36cc9e71 100644
  12. --- a/src/debug.c
  13. +++ b/src/debug.c
  14. @@ -90,6 +90,7 @@ void ha_thread_dump(struct buffer *buf, int thr, int calling_tid)
  15. void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
  16. {
  17. const struct stream *s = NULL;
  18. + const struct appctx __maybe_unused *appctx = NULL;
  19. if (!task) {
  20. chunk_appendf(buf, "0\n");
  21. @@ -110,7 +111,7 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
  22. task->call_date ? " ns ago" : "");
  23. chunk_appendf(buf, "%s"
  24. - " fct=%p (%s) ctx=%p\n",
  25. + " fct=%p (%s) ctx=%p",
  26. pfx,
  27. task->process,
  28. task->process == process_stream ? "process_stream" :
  29. @@ -119,6 +120,11 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
  30. "?",
  31. task->context);
  32. + if (task->process == task_run_applet && (appctx = task->context))
  33. + chunk_appendf(buf, "(%s)\n", appctx->applet->name);
  34. + else
  35. + chunk_appendf(buf, "\n");
  36. +
  37. if (task->process == process_stream && task->context)
  38. s = (struct stream *)task->context;
  39. else if (task->process == task_run_applet && task->context)