summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-09-05 15:42:39 +0300
committerLennart Poettering <lennart@poettering.net>2008-09-05 15:42:39 +0300
commit33d349dcbbef0952e9e59ca105e08fdff5454803 (patch)
tree87c11e55e719b1bd200fceef068ff4515f813625 /src
parentfb837f0cac00d0207f84c9e68e1f7c2d6cd33a51 (diff)
include build and runtime host information in debug output
Diffstat (limited to 'src')
-rw-r--r--src/daemon/main.c9
-rw-r--r--src/pulsecore/core-util.c8
-rw-r--r--src/pulsecore/core-util.h1
3 files changed, 16 insertions, 2 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c
index c8eda398..bb8af444 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -778,8 +778,15 @@ int main(int argc, char *argv[]) {
pa_set_env("PULSE_SYSTEM", conf->system_instance ? "1" : "0");
pa_log_info(_("This is PulseAudio %s"), PACKAGE_VERSION);
+ pa_log_debug(_("Compilation host: %s"), CANONICAL_HOST);
pa_log_debug(_("Compilation CFLAGS: %s"), PA_CFLAGS);
+ s = pa_uname_string();
+ pa_log_debug(_("Running on host: %s"), s);
+ pa_xfree(s);
+
+ pa_log_info(_("Page size is %lu bytes"), (unsigned long) PA_PAGE_SIZE);
+
#ifdef HAVE_VALGRIND_MEMCHECK_H
pa_log_debug(_("Compiled with Valgrind support: yes"));
#else
@@ -792,8 +799,6 @@ int main(int argc, char *argv[]) {
pa_log_debug(_("Optimized build: no"));
#endif
- pa_log_info(_("Page size is %lu bytes"), (unsigned long) PA_PAGE_SIZE);
-
if (!(s = pa_machine_id())) {
pa_log(_("Failed to get machine ID"));
goto finish;
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index ad00f4f4..3e5ea492 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -42,6 +42,7 @@
#include <dirent.h>
#include <regex.h>
#include <langinfo.h>
+#include <sys/utsname.h>
#ifdef HAVE_STRTOF_L
#include <locale.h>
@@ -2445,5 +2446,12 @@ char *pa_machine_id(void) {
/* If no hostname was set we use the POSIX hostid. It's usually
* the IPv4 address. Mit not be that stable. */
return pa_sprintf_malloc("%08lx", (unsigned long) gethostid);
+}
+
+char *pa_uname_string(void) {
+ struct utsname u;
+
+ pa_assert_se(uname(&u) == 0);
+ return pa_sprintf_malloc("%s %s %s %s", u.sysname, u.machine, u.release, u.version);
}
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index c9e307f5..df8ce3f8 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -191,5 +191,6 @@ pa_bool_t pa_in_system_mode(void);
#define pa_streq(a,b) (!strcmp((a),(b)))
char *pa_machine_id(void);
+char *pa_uname_string(void);
#endif