[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.11-164-gbdcb3a4
Lennart Poettering
gitmailer-noreply at 0pointer.de
Fri Aug 29 10:33:42 PDT 2008
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 450fe170a5d8a38a9e49ddaae02ed7524e78a51f (commit)
- Log -----------------------------------------------------------------
bdcb3a4... optionally add timestampts to every line logged
54da71e... reduce needlessly large gdbm cache a bit
-----------------------------------------------------------------------
Summary of changes:
src/Makefile.am | 12 ++++++----
src/modules/module-device-restore.c | 5 ++++
src/modules/module-stream-restore.c | 5 ++++
src/pulsecore/log.c | 37 +++++++++++++++++++++++++++-------
src/pulsecore/log.h | 4 ++-
5 files changed, 49 insertions(+), 14 deletions(-)
-----------------------------------------------------------------------
commit 54da71ef5de500016c549e20a26131365668b74c
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Aug 29 01:48:31 2008 +0200
reduce needlessly large gdbm cache a bit
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index 920b451..86a7881 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -288,6 +288,7 @@ int pa__init(pa_module*m) {
pa_source *source;
uint32_t idx;
pa_bool_t restore_volume = TRUE, restore_muted = TRUE;
+ int gdbm_cache_size;
pa_assert(m);
@@ -337,6 +338,10 @@ int pa__init(pa_module*m) {
goto fail;
}
+ /* By default the cache of gdbm is rather large, let's reduce it a bit to save memory */
+ gdbm_cache_size = 10;
+ gdbm_setopt(u->gdbm_file, GDBM_CACHESIZE, &gdbm_cache_size, sizeof(gdbm_cache_size));
+
pa_log_info("Sucessfully opened database file '%s'.", fname);
pa_xfree(fname);
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 37e8b06..47f5d83 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -686,6 +686,7 @@ int pa__init(pa_module*m) {
pa_source_output *so;
uint32_t idx;
pa_bool_t restore_device = TRUE, restore_volume = TRUE, restore_muted = TRUE;
+ int gdbm_cache_size;
pa_assert(m);
@@ -746,6 +747,10 @@ int pa__init(pa_module*m) {
goto fail;
}
+ /* By default the cache of gdbm is rather large, let's reduce it a bit to save memory */
+ gdbm_cache_size = 10;
+ gdbm_setopt(u->gdbm_file, GDBM_CACHESIZE, &gdbm_cache_size, sizeof(gdbm_cache_size));
+
pa_log_info("Sucessfully opened database file '%s'.", fname);
pa_xfree(fname);
commit bdcb3a493cc5bdba254d365b7e567876a72c789b
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Aug 29 19:33:06 2008 +0200
optionally add timestampts to every line logged
diff --git a/src/Makefile.am b/src/Makefile.am
index 94837a6..a20c7c4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -201,22 +201,22 @@ paplay_LDADD = $(AM_LDADD) libpulse.la $(LIBSNDFILE_LIBS)
paplay_CFLAGS = $(AM_CFLAGS) $(LIBSNDFILE_CFLAGS)
paplay_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
-pactl_SOURCES = utils/pactl.c pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
+pactl_SOURCES = utils/pactl.c pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/rtclock.c pulsecore/rtclock.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
pactl_LDADD = $(AM_LDADD) libpulse.la $(LIBSNDFILE_LIBS)
pactl_CFLAGS = $(AM_CFLAGS) $(LIBSNDFILE_CFLAGS)
pactl_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
-pasuspender_SOURCES = utils/pasuspender.c pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
+pasuspender_SOURCES = utils/pasuspender.c pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/rtclock.c pulsecore/rtclock.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
pasuspender_LDADD = $(AM_LDADD) libpulse.la $(LIBSNDFILE_LIBS)
pasuspender_CFLAGS = $(AM_CFLAGS) $(LIBSNDFILE_CFLAGS)
pasuspender_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
-pacmd_SOURCES = utils/pacmd.c pulsecore/pid.c pulsecore/pid.h pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
+pacmd_SOURCES = utils/pacmd.c pulsecore/pid.c pulsecore/pid.h pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/rtclock.c pulsecore/rtclock.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
pacmd_CFLAGS = $(AM_CFLAGS)
pacmd_LDADD = $(AM_LDADD) libpulse.la
pacmd_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
-pax11publish_SOURCES = utils/pax11publish.c pulsecore/x11prop.c pulsecore/x11prop.h pulse/client-conf.c pulse/client-conf.h pulsecore/authkey.h pulsecore/authkey.c pulsecore/random.h pulsecore/random.c pulsecore/conf-parser.c pulsecore/conf-parser.h pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
+pax11publish_SOURCES = utils/pax11publish.c pulsecore/x11prop.c pulsecore/x11prop.h pulse/client-conf.c pulse/client-conf.h pulsecore/authkey.h pulsecore/authkey.c pulsecore/random.h pulsecore/random.c pulsecore/conf-parser.c pulsecore/rtclock.c pulsecore/rtclock.h pulsecore/conf-parser.h pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
pax11publish_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS)
pax11publish_LDADD = $(AM_LDADD) libpulse.la $(X_PRE_LIBS) -lX11 $(X_LIBS) $(X_EXTRA_LIBS)
pax11publish_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
@@ -618,13 +618,14 @@ libpulse_simple_la_SOURCES = \
pulsecore/core-util.c pulsecore/core-util.h \
pulsecore/core-error.c pulsecore/core-error.h \
pulsecore/once.c pulsecore/once.h \
+ pulsecore/rtclock.c pulsecore/rtclock.h \
$(PA_THREAD_OBJS)
libpulse_simple_la_CFLAGS = $(AM_CFLAGS)
libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la
libpulse_simple_la_LDFLAGS = -version-info $(LIBPULSE_SIMPLE_VERSION_INFO) -Wl,-version-script=$(srcdir)/map-file
-libpulse_browse_la_SOURCES = pulse/browser.c pulse/browser.h pulsecore/avahi-wrap.c pulsecore/avahi-wrap.h pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
+libpulse_browse_la_SOURCES = pulse/browser.c pulse/browser.h pulsecore/avahi-wrap.c pulsecore/avahi-wrap.h pulsecore/core-util.c pulsecore/core-util.h pulsecore/core-error.c pulsecore/core-error.h pulsecore/log.c pulsecore/log.h pulsecore/rtclock.c pulsecore/rtclock.h pulsecore/once.c pulsecore/once.h $(PA_THREAD_OBJS)
libpulse_browse_la_CFLAGS = $(AM_CFLAGS) $(AVAHI_CFLAGS)
libpulse_browse_la_LIBADD = $(AM_LIBADD) libpulse.la $(AVAHI_LIBS)
libpulse_browse_la_LDFLAGS = -version-info $(LIBPULSE_BROWSE_VERSION_INFO) -Wl,-version-script=$(srcdir)/map-file
@@ -632,6 +633,7 @@ libpulse_browse_la_LDFLAGS = -version-info $(LIBPULSE_BROWSE_VERSION_INFO) -Wl,-
libpulse_mainloop_glib_la_SOURCES = \
pulse/glib-mainloop.h pulse/glib-mainloop.c \
pulsecore/log.c pulsecore/log.h \
+ pulsecore/rtclock.c pulsecore/rtclock.h \
pulsecore/core-util.c pulsecore/core-util.h \
pulsecore/core-error.c pulsecore/core-error.h \
pulsecore/once.c pulsecore/once.h \
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index 5eda4f6..9507a85 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -37,18 +37,22 @@
#include <pulse/utf8.h>
#include <pulse/xmalloc.h>
#include <pulse/util.h>
+#include <pulse/timeval.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-util.h>
+#include <pulsecore/rtclock.h>
+#include <pulsecore/once.h>
#include "log.h"
#define ENV_LOGLEVEL "PULSE_LOG"
#define ENV_LOGMETA "PULSE_LOG_META"
+#define ENV_LOGTIME "PULSE_LOG_TIME"
static char *log_ident = NULL, *log_ident_local = NULL;
static pa_log_target_t log_target = PA_LOG_STDERR;
-static void (*user_log_func)(pa_log_level_t l, const char *s) = NULL;
+static pa_log_func_t user_log_func = NULL;
static pa_log_level_t maximal_level = PA_LOG_NOTICE;
#ifdef HAVE_SYSLOG_H
@@ -91,7 +95,7 @@ void pa_log_set_maximal_level(pa_log_level_t l) {
maximal_level = l;
}
-void pa_log_set_target(pa_log_target_t t, void (*func)(pa_log_level_t l, const char*s)) {
+void pa_log_set_target(pa_log_target_t t, pa_log_func_t func) {
pa_assert(t == PA_LOG_USER || !func);
log_target = t;
@@ -112,7 +116,7 @@ void pa_log_levelv_meta(
/* We don't use dynamic memory allocation here to minimize the hit
* in RT threads */
- char text[1024], location[128];
+ char text[1024], location[128], timestamp[32];
pa_assert(level < PA_LOG_LEVEL_MAX);
pa_assert(format);
@@ -134,6 +138,23 @@ void pa_log_levelv_meta(
else
location[0] = 0;
+ if (getenv(ENV_LOGTIME)) {
+ static pa_usec_t start;
+ pa_usec_t u;
+
+ u = pa_rtclock_usec();
+
+ PA_ONCE_BEGIN {
+ start = u;
+ } PA_ONCE_END;
+
+ u -= start;
+
+ pa_snprintf(timestamp, sizeof(timestamp), "(%4llu.%03llu) ", (unsigned long long) (u / PA_USEC_PER_SEC), (unsigned long long) (((u / PA_USEC_PER_MSEC)) % 1000));
+
+ } else
+ timestamp[0] = 0;
+
if (!pa_utf8_valid(text))
pa_log_level(level, __FILE__": invalid UTF-8 string following below:");
@@ -168,9 +189,9 @@ void pa_log_levelv_meta(
* minimize the hit in RT threads */
local_t = pa_utf8_to_locale(t);
if (!local_t)
- fprintf(stderr, "%c: %s%s%s%s\n", level_to_char[level], location, prefix, t, suffix);
+ fprintf(stderr, "%s%c: %s%s%s%s\n", timestamp, level_to_char[level], location, prefix, t, suffix);
else {
- fprintf(stderr, "%c: %s%s%s%s\n", level_to_char[level], location, prefix, local_t, suffix);
+ fprintf(stderr, "%s%c: %s%s%s%s\n", timestamp, level_to_char[level], location, prefix, local_t, suffix);
pa_xfree(local_t);
}
@@ -185,9 +206,9 @@ void pa_log_levelv_meta(
local_t = pa_utf8_to_locale(t);
if (!local_t)
- syslog(level_to_syslog[level], "%s%s", location, t);
+ syslog(level_to_syslog[level], "%s%s%s", timestamp, location, t);
else {
- syslog(level_to_syslog[level], "%s%s", location, local_t);
+ syslog(level_to_syslog[level], "%s%s%s", timestamp, location, local_t);
pa_xfree(local_t);
}
@@ -199,7 +220,7 @@ void pa_log_levelv_meta(
case PA_LOG_USER: {
char x[1024];
- pa_snprintf(x, sizeof(x), "%s%s", location, t);
+ pa_snprintf(x, sizeof(x), "%s%s%s", timestamp, location, t);
user_log_func(level, x);
break;
diff --git a/src/pulsecore/log.h b/src/pulsecore/log.h
index 2047696..633227f 100644
--- a/src/pulsecore/log.h
+++ b/src/pulsecore/log.h
@@ -49,8 +49,10 @@ typedef enum pa_log_level {
/* Set an identification for the current daemon. Used when logging to syslog. */
void pa_log_set_ident(const char *p);
+typedef void (*pa_log_func_t)(pa_log_level_t t, const char*s);
+
/* Set another log target. If t is PA_LOG_USER you may specify a function that is called every log string */
-void pa_log_set_target(pa_log_target_t t, void (*func)(pa_log_level_t t, const char*s));
+void pa_log_set_target(pa_log_target_t t, pa_log_func_t func);
/* Minimal log level */
void pa_log_set_maximal_level(pa_log_level_t l);
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list