]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pjproject_bundled: Compile pjsua with max log level = 2 27/4727/1
authorGeorge Joseph <gjoseph@digium.com>
Tue, 3 Jan 2017 21:14:09 +0000 (14:14 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 16 Jan 2017 17:30:58 +0000 (10:30 -0700)
A while back, we changed config_site.h to set PJ_LOG_MAX_LEVEL = 6.
This allowed us to control the log level better from inside Asterisk.
An unfortunate side effect of this was that the pjsua binary and
python bindings were also compiled with log level set to 6 so whenever
a testsuite test that uses pjsua runs, it spits out 6795 lines of
debug in an instant even before the test starts.  I believe this
overruns the Jenkins capture buffer and prevents the test from
properly terminating.  In turn, this results in the testsuite just
hanging until the job is killed.  It's more frequent on the higher
end agents because they can spit out the messages faster.

Unfortunately, the messages are all spit out before we have control
of the python pj.Lib instance where we can set logging levels so the
only alternative was to actually compile pjsua and _pjsua.so with an
overridden PJ_LOG_MAX_LEVEL.  Although defining a lower max level was
done in the Makefile, the define in config_site.h had to be wrapped
with "#ifndef" so the change would take effect.

Change-Id: I2af9e7d48dde1927279c586c9c725d868fe6f3ff
(cherry picked from commit d7e5a747c312de18647213359103ce6022776864)

third-party/pjproject/Makefile
third-party/pjproject/patches/config_site.h

index b799d4fe440264b59ff59a1e599d2eba95fc3a2a..8b07529300ba67cd47ef9d22598771b16344dd4a 100644 (file)
@@ -165,10 +165,12 @@ source/pjsip-apps/lib/libasterisk_malloc_debug.a: source/pjsip-apps/lib/asterisk
        $(CMD_PREFIX) ar qs $@ $< >/dev/null 2>&1
 
 $(apps): APP = $(filter pj%,$(subst -, ,$(notdir $@)))
+$(apps): CFLAGS += -DPJ_LOG_MAX_LEVEL=2
 $(apps): pjproject.symbols $(APP_THIRD_PARTY_LIB_FILES)
        $(ECHO_PREFIX) Compiling $(APP)
        $(CMD_PREFIX) +$(MAKE) -C source/pjsip-apps/build $(filter pj%,$(subst -, ,$(notdir $@))) $(REALLY_QUIET)
 
+source/pjsip-apps/src/python/_pjsua.o: CFLAGS += -DPJ_LOG_MAX_LEVEL=2
 source/pjsip-apps/src/python/_pjsua.o: source/pjsip-apps/src/python/_pjsua.c $(apps)
        $(ECHO_PREFIX) Compiling python bindings
        $(CMD_PREFIX) $(CC) -o $@ -c $< $(PYTHONDEV_INCLUDE) $(CFLAGS) $(PJ_CFLAGS)
index f84adeb357ed716f1fc5cc698f5dd66e15aac73b..5e29cdb6aa43846e3318dd078667b431c40a066c 100644 (file)
 
 #define PJ_SCANNER_USE_BITWISE 0
 #define PJ_OS_HAS_CHECK_STACK  0
+
+#ifndef PJ_LOG_MAX_LEVEL
 #define PJ_LOG_MAX_LEVEL               6
+#endif
+
 #define PJ_ENABLE_EXTRA_CHECK  1
 #define PJSIP_MAX_TSX_COUNT            ((64*1024)-1)
 #define PJSIP_MAX_DIALOG_COUNT ((64*1024)-1)