MINOR: stats: report tainted on show info

Add a new info field ST_F_TAINTED to dump tainted status at the end of
the 'show info' output.
This commit is contained in:
Amaury Denoyelle 2021-05-05 17:09:12 +02:00
parent f492992065
commit 5dfdf3e5b0
2 changed files with 6 additions and 0 deletions

View 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

View 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;
}