aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamd.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-04-07 21:36:45 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-04-07 21:36:45 +0100
commit81c36ce90012a2977e12eba3ad0a51c499d97dfe (patch)
treee04b1c8585242a8e147580659eb509b9dea7b9d6 /src/rspamd.c
parent284b828a145d85efd81e2f7e9a606aa0e7143373 (diff)
downloadrspamd-81c36ce90012a2977e12eba3ad0a51c499d97dfe.tar.gz
rspamd-81c36ce90012a2977e12eba3ad0a51c499d97dfe.zip
[Minor] Print more useful information in the `--version` output
Diffstat (limited to 'src/rspamd.c')
-rw-r--r--src/rspamd.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/rspamd.c b/src/rspamd.c
index bcc4e56dd..4e6336394 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -1267,14 +1267,38 @@ rspamd_spair_close (gpointer p)
g_free (p);
}
+const char*
+get_cpu_architecture(void) {
+#if defined(__x86_64__) || defined(_M_X64)
+ return "x86_64";
+#elif defined(__i386) || defined(_M_IX86)
+ return "x86";
+#elif defined(__aarch64__)
+ return "ARM64";
+#elif defined(__arm__) || defined(_M_ARM)
+ return "ARM";
+#elif defined(__mips__)
+ return "MIPS";
+#elif defined(__powerpc__) || defined(_M_PPC)
+ return "PowerPC";
+#elif defined(__sparc__)
+ return "SPARC";
+#else
+ return "Unknown";
+#endif
+}
+
static void
-version (void)
+version (struct rspamd_main *rspamd_main)
{
#if defined(GIT_VERSION) && GIT_VERSION == 1
rspamd_printf ("Rspamd daemon version " RVERSION "-git." RID "\n\n");
#else
rspamd_printf ("Rspamd daemon version " RVERSION "\n\n");
#endif
+ rspamd_printf("CPU architecture %s; features: %s\n",
+ get_cpu_architecture(),
+ rspamd_main->cfg->libs_ctx->crypto_ctx->cpu_extensions);
#ifdef WITH_HYPERSCAN
rspamd_printf ("Hyperscan enabled: TRUE\n");
#else
@@ -1287,9 +1311,9 @@ version (void)
rspamd_printf ("Jemalloc enabled: FALSE\n");
#endif
#ifdef WITH_LUAJIT
- rspamd_printf ("LuaJIT enabled: TRUE\n");
+ rspamd_printf ("LuaJIT enabled: TRUE (LuaJIT version: %s)\n", LUAJIT_VERSION);
#else
- rspamd_printf ("LuaJIT enabled: FALSE\n");
+ rspamd_printf ("LuaJIT enabled: FALSE (Lua version: %s)\n", LUA_VERSION);
#endif
#ifndef __has_feature
# define __has_feature(x) 0
@@ -1418,7 +1442,7 @@ main (gint argc, gchar **argv, gchar **env)
read_cmd_line (&argc, &argv, rspamd_main->cfg);
if (show_version) {
- version ();
+ version (rspamd_main);
exit (EXIT_SUCCESS);
}