[banshee/stable-2.6] build: use the gui-thread-check profiler module by default when debugging



commit 5af28414c370667100b25f723ffa0a96b06ae0fd
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Tue Dec 11 00:40:02 2012 +0000

    build: use the gui-thread-check profiler module by default when debugging
    
    Upcoming versions of gtk# (2.99.1 and higher) will bundle this useful
    profiler module by default. To reduce the feedback loop between developers
    and bug reporters, banshee will run it whenever launched with the --debug
    flag or when running in uninstalled mode (via "make run").
    
    This way the logs that we get will include any traces of GUI calls that
    were incorrectly not sent to the main thread, which in occassions can cause
    crashes or unexpected behaviour.
    
    Even though this is not bundled in gtk# 2.x series, it may still useful to
    try to run it at launch, in case the user has installed the profiler module
    on his own, or advised by devs: https://github.com/slluis/gui-thread-check
    
    Signed-off-by: Alexander Kojevnikov <alexander kojevnikov com>

 Makefile.am                         |   10 +++++++---
 src/Clients/Booter/banshee.linux.in |    4 ++++
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 1f47e59..28407be 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -57,11 +57,15 @@ check-bootstrap-env:
                done; \
        fi
 
+PROFILE_DEFAULT=--profile=log:time=fast,calls,noalloc,maxframes=5
+PROFILE_HEAP=--profile=logging:heap=all,gc-dumps=-1
+PROFILE_GUI=--profile=gui-thread-check
+
 run: check-bootstrap-env $(MO_FILES)
-       (cd bin; $(MONO) --debug $(BANSHEE_DEV_MONO_OPTIONS) Nereid.exe --debug --uninstalled 
$(BANSHEE_DEV_OPTIONS))
+       (cd bin; $(MONO) --debug $(PROFILE_GUI) $(BANSHEE_DEV_MONO_OPTIONS) Nereid.exe --debug --uninstalled 
$(BANSHEE_DEV_OPTIONS))
 
 run-profiled: check-bootstrap-env $(MO_FILES)
-       (cd bin; LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/local/lib $(MONO) --debug 
$(BANSHEE_DEV_MONO_OPTIONS) --profile=log:time=fast,calls,noalloc,maxframes=5 Nereid.exe --uninstalled 
$(BANSHEE_DEV_OPTIONS))
+       (cd bin; LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/local/lib $(MONO) --debug 
$(BANSHEE_DEV_MONO_OPTIONS) $(PROFILE_DEFAULT) Nereid.exe --uninstalled $(BANSHEE_DEV_OPTIONS))
 
 run-logged: check-bootstrap-env $(MO_FILES)
        (cd bin; $(MONO) --debug $(BANSHEE_DEV_MONO_OPTIONS) Nereid.exe --debug --uninstalled 
$(BANSHEE_DEV_OPTIONS) | tee last-run-log)
@@ -78,7 +82,7 @@ run-trace: $(MO_FILES)
                Nereid.exe --uninstalled $(BANSHEE_DEV_OPTIONS) > ../banshee.trace)
 
 run-profile-heap: $(MO_FILES)
-       (cd bin; $(MONO) --profile=logging:heap=all,gc-dumps=-1 --debug $(BANSHEE_DEV_MONO_OPTIONS) 
Nereid.exe --debug --uninstalled $(BANSHEE_DEV_OPTIONS))
+       (cd bin; $(MONO) $(PROFILE_HEAP) --debug $(BANSHEE_DEV_MONO_OPTIONS) Nereid.exe --debug --uninstalled 
$(BANSHEE_DEV_OPTIONS))
 
 query-trace:
        @echo "Did you set BANSHEE_DEV_MONO_OPTIONS to --trace=disabled?"; \
diff --git a/src/Clients/Booter/banshee.linux.in b/src/Clients/Booter/banshee.linux.in
index a255940..724a6d7 100644
--- a/src/Clients/Booter/banshee.linux.in
+++ b/src/Clients/Booter/banshee.linux.in
@@ -44,6 +44,10 @@ if [ ! -z "$BANSHEE_CLIENT" ]; then
        BANSHEE_CLIENT="--client=${BANSHEE_CLIENT}"
 fi
 
+if [ "$BANSHEE_DEBUG" = "--debug" ] && [ "x$BANSHEE_PROFILE" = "x" ]; then
+       BANSHEE_PROFILE="--profile=gui-thread-check"
+fi
+
 # We were testing the SGen compacting GC; disabled for 2.0 release b/c there are serious
 # issues with sgen on Mono 2.8.0
 #export MONO_ENV_OPTIONS="--gc=sgen"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]