]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli/threads: make "show fd" report thread_sync_io_handler instead of "unknown"
authorWilly Tarreau <w@1wt.eu>
Wed, 28 Mar 2018 16:06:47 +0000 (18:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 28 Mar 2018 16:06:47 +0000 (18:06 +0200)
The output was confusing when the sync point's dummy handler was shown.

This patch should be backported to 1.8 to help with troubleshooting.

include/common/hathreads.h
src/cli.c
src/hathreads.c

index 2620b7791f281d6f34eadc322ef2e3e1e4f47ae2..15b8ce2c18988ec9bfda18d78a511b5d6aff3f07 100644 (file)
@@ -866,4 +866,7 @@ static inline void __ha_compiler_barrier(void)
        __asm __volatile("" ::: "memory");
 }
 
+/* Dummy I/O handler used by the sync pipe.*/
+void thread_sync_io_handler(int fd);
+
 #endif /* _COMMON_HATHREADS_H */
index ada45a865645a784f107e177152d637f0fb49cf3..f19b5f18bf0cf0adf05d5b38b1ddacfcf22b4302 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -817,6 +817,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
                             (fdt.iocb == conn_fd_handler)  ? "conn_fd_handler" :
                             (fdt.iocb == dgram_fd_handler) ? "dgram_fd_handler" :
                             (fdt.iocb == listener_accept)  ? "listener_accept" :
+                            (fdt.iocb == thread_sync_io_handler) ? "thread_sync_io_handler" :
                             "unknown",
                             fdt.thread_mask, fdt.update_mask);
 
index fd0eb68464721f2997170502112345b9bb5fbb7c..0d0b3761a035439a37ad1d80c38071fb010dd37d 100644 (file)
@@ -33,7 +33,9 @@ struct lock_stat lock_stats[LOCK_LABELS];
 #endif
 
 /* Dummy I/O handler used by the sync pipe.*/
-static void thread_sync_io_handler(int fd) { }
+void thread_sync_io_handler(int fd)
+{
+}
 
 /* Initializes the sync point. It creates a pipe used by threads to wakup all
  * others when a sync is requested. It also initialize the mask of all create