From 4dddbb63a02798be6d3f1875c341281ede26ef98 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 4 Mar 2024 19:04:09 +0100 Subject: [PATCH] DEV: haring: make haring not depend on the struct ring itself haring needs to be self-sufficient about the ring format so that it continues to build when the ring API changes. Let's import the struct ring definition and call it "ring_v1". --- dev/haring/haring.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dev/haring/haring.c b/dev/haring/haring.c index ee7e1aa4e..fbd386b4c 100644 --- a/dev/haring/haring.c +++ b/dev/haring/haring.c @@ -35,12 +35,19 @@ #include #include -#include +#include +#include int force = 0; // force access to a different layout int lfremap = 0; // remap LF in traces int repair = 0; // repair file +struct ring_v1 { + struct buffer buf; // storage area + struct list waiters; // list of waiters, for now, CLI "show event" + __decl_thread(HA_RWLOCK_T lock); + int readers_count; +}; /* display the message and exit with the code */ __attribute__((noreturn)) void die(int code, const char *format, ...) @@ -78,7 +85,7 @@ __attribute__((noreturn)) void usage(int code, const char *arg0) * called again, otherwise non-zero. It is meant to be used with * cli_release_show_ring() to clean up. */ -int dump_ring(struct ring *ring, size_t ofs, int flags) +int dump_ring(struct ring_v1 *ring, size_t ofs, int flags) { struct buffer buf; uint64_t msg_len = 0; @@ -212,7 +219,7 @@ int dump_ring(struct ring *ring, size_t ofs, int flags) int main(int argc, char **argv) { - struct ring *ring; + void *ring; struct stat statbuf; const char *arg0; int fd;