]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: report tainted on show info
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 5 May 2021 15:09:12 +0000 (17:09 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 7 May 2021 12:35:02 +0000 (14:35 +0200)
Add a new info field ST_F_TAINTED to dump tainted status at the end of
the 'show info' output.

include/haproxy/stats-t.h
src/stats.c

index a9bf25e317043b3d263276fb93d9c84e69ad7542..4ab1138eaa1b7121717ce4c7d86d195e9175e2e1 100644 (file)
@@ -329,6 +329,7 @@ enum info_field {
        INF_POOL_ALLOC_BYTES,
        INF_POOL_USED_BYTES,
        INF_START_TIME_SEC,
+       INF_TAINTED,
 
        /* must always be the last one */
        INF_TOTAL_FIELDS
index d6d3129d1eaafe7feba49a2e3f2f000680765e8e..9862fdd35aca83d3e73af3e8116fe1522c6e3607 100644 (file)
@@ -153,6 +153,7 @@ const struct name_desc info_fields[INF_TOTAL_FIELDS] = {
        [INF_DEBUG_COMMANDS_ISSUED]          = { .name = "DebugCommandsIssued",         .desc = "Number of debug commands issued on this process (anything > 0 is unsafe)" },
        [INF_CUM_LOG_MSGS]                   = { .name = "CumRecvLogs",                 .desc = "Total number of log messages received by log-forwarding listeners on this worker process since started" },
        [INF_BUILD_INFO]                     = { .name = "Build info",                  .desc = "Build info" },
+       [INF_TAINTED]                        = { .name = "Tainted",                     .desc = "Experimental features used" },
 };
 
 const struct name_desc stat_fields[ST_F_TOTAL_FIELDS] = {
@@ -4385,6 +4386,10 @@ int stats_fill_info(struct field *info, int len)
        info[INF_BYTES_OUT_RATE]                 = mkf_u64(FN_RATE, (unsigned long long)read_freq_ctr(&global.out_32bps) * 32);
        info[INF_DEBUG_COMMANDS_ISSUED]          = mkf_u32(0, debug_commands_issued);
        info[INF_CUM_LOG_MSGS]                   = mkf_u32(FN_COUNTER, cum_log_messages);
+
+       info[INF_TAINTED]                        = mkf_str(FO_STATUS, chunk_newstr(out));
+       chunk_appendf(out, "%#x", get_tainted());
+
        return 1;
 }