[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test5-72-gf6a6d01

Lennart Poettering gitmailer-noreply at 0pointer.de
Tue Mar 24 19:14:27 PDT 2009


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  e41ec51f1bdefe44c7104ce27130999600b7911e (commit)

- Log -----------------------------------------------------------------
f6a6d01 optionally skip initial frames in backtrace
8460fac don't show full so path in backtrace
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/log.c |   37 +++++++++++++++++++++++++++----------
 src/pulsecore/log.h |    3 +++
 2 files changed, 30 insertions(+), 10 deletions(-)

-----------------------------------------------------------------------

commit 8460fac28583f96c039f94d42f1035c266f9a45f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Mar 25 02:50:57 2009 +0100

    don't show full so path in backtrace

diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index d4d3b76..e1b6794 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -156,7 +156,7 @@ static char* get_backtrace(unsigned show_nframes) {
     for (j = 0; j < n; j++) {
         if (j > 0)
             a += 2;
-        a += strlen(symbols[j]);
+        a += strlen(pa_path_get_filename(symbols[j]));
     }
 
     r = pa_xnew(char, a);
@@ -165,13 +165,17 @@ static char* get_backtrace(unsigned show_nframes) {
     e = r + 2;
 
     for (j = 0; j < n; j++) {
+        const char *sym;
+
         if (j > 0) {
             strcpy(e, "<<");
             e += 2;
         }
 
-        strcpy(e, symbols[j]);
-        e += strlen(symbols[j]);
+        sym = pa_path_get_filename(symbols[j]);
+
+        strcpy(e, sym);
+        e += strlen(sym);
     }
 
     strcpy(e, ")");

commit f6a6d013546025806a0449ae51dde70de8baff57
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Mar 25 03:14:00 2009 +0100

    optionally skip initial frames in backtrace

diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index e1b6794..750d73b 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -59,12 +59,13 @@
 #define ENV_LOG_PRINT_META "PULSE_LOG_META"
 #define ENV_LOG_PRINT_LEVEL "PULSE_LOG_LEVEL"
 #define ENV_LOG_BACKTRACE "PULSE_LOG_BACKTRACE"
+#define ENV_LOG_BACKTRACE_SKIP "PULSE_LOG_BACKTRACE_SKIP"
 
 static char *ident = NULL; /* in local charset format */
 static pa_log_target_t target = PA_LOG_STDERR, target_override;
 static pa_bool_t target_override_set = FALSE;
 static pa_log_level_t maximum_level = PA_LOG_ERROR, maximum_level_override = PA_LOG_ERROR;
-static unsigned show_backtrace = 0, show_backtrace_override = 0;
+static unsigned show_backtrace = 0, show_backtrace_override = 0, skip_backtrace = 0;
 static pa_log_flags_t flags = 0, flags_override = 0;
 
 #ifdef HAVE_SYSLOG_H
@@ -128,13 +129,17 @@ void pa_log_set_show_backtrace(unsigned nlevels) {
     show_backtrace = nlevels;
 }
 
+void pa_log_set_skip_backtrace(unsigned nlevels) {
+    skip_backtrace = nlevels;
+}
+
 #ifdef HAVE_EXECINFO_H
 
 static char* get_backtrace(unsigned show_nframes) {
     void* trace[32];
     int n_frames;
     char **symbols, *e, *r;
-    unsigned j, n;
+    unsigned j, n, s;
     size_t a;
 
     pa_assert(show_nframes > 0);
@@ -149,12 +154,13 @@ static char* get_backtrace(unsigned show_nframes) {
     if (!symbols)
         return NULL;
 
-    n = PA_MIN((unsigned) n_frames, show_nframes);
+    s = skip_backtrace;
+    n = PA_MIN((unsigned) n_frames, s + show_nframes);
 
     a = 4;
 
-    for (j = 0; j < n; j++) {
-        if (j > 0)
+    for (j = s; j < n; j++) {
+        if (j > s)
             a += 2;
         a += strlen(pa_path_get_filename(symbols[j]));
     }
@@ -164,10 +170,10 @@ static char* get_backtrace(unsigned show_nframes) {
     strcpy(r, " (");
     e = r + 2;
 
-    for (j = 0; j < n; j++) {
+    for (j = s; j < n; j++) {
         const char *sym;
 
-        if (j > 0) {
+        if (j > s) {
             strcpy(e, "<<");
             e += 2;
         }
@@ -229,6 +235,13 @@ static void init_defaults(void) {
         if (show_backtrace_override <= 0)
             show_backtrace_override = 0;
     }
+
+    if ((e = getenv(ENV_LOG_BACKTRACE_SKIP))) {
+        skip_backtrace = (unsigned) atoi(e);
+
+        if (skip_backtrace <= 0)
+            skip_backtrace = 0;
+    }
 }
 
 void pa_log_levelv_meta(
diff --git a/src/pulsecore/log.h b/src/pulsecore/log.h
index 153e11e..8628bf4 100644
--- a/src/pulsecore/log.h
+++ b/src/pulsecore/log.h
@@ -77,6 +77,9 @@ void pa_log_set_flags(pa_log_flags_t flags, pa_log_merge_t merge);
 /* Enable backtrace */
 void pa_log_set_show_backtrace(unsigned nlevels);
 
+/* Skip the first backtrace frames */
+void pa_log_set_skip_backtrace(unsigned nlevels);
+
 void pa_log_level_meta(
         pa_log_level_t level,
         const char*file,

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list