debug_utilities: Create the ast_coredumper utility

This utility allows easy manipulation of asterisk coredumps.

* Configurable search paths and patterns for existing coredumps
* Can generate a consistent coredump from the running instance
* Can dump the lock_infos table from a coredump
* Dumps backtraces to separate files...
  - thread apply 1 bt full -> <coredump>.thread1.txt
  - thread apply all bt -> <coredump>.brief.txt
  - thread apply all bt full -> <coredump>.full.txt
  - lock_infos table -> <coredump>.locks.txt
* Can tarball corefiles and optionally delete them after processing
* Can tarball results files and optionally delete them after processing
* Converts ':' in coredump and results file names '-' to facilitate
  uploading.  Jira for instance, won't accept file names with colons
  in them.

Tested on Fedora24+, Ubuntu14+, Debian6+, CentOS6+ and FreeBSD9+[1].

[1] For *BSDs, the "devel/gdb" package might have to be installed to
get a recent gdb.  The utility will check all instances of gdb
it finds in $PATH and if one isn't found that can run python, it
prints a friendly error.

Change-Id: I935d37ab9db85ef923f32b05579897f0893d33cd
This commit is contained in:
George Joseph
2017-01-10 17:10:39 -07:00
parent ac4d6828f5
commit 47474cfd54
3 changed files with 563 additions and 1 deletions

View File

@@ -20,10 +20,12 @@ clean:
include $(ASTTOPDIR)/Makefile.rules
install:
$(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/scripts"
$(INSTALL) -m 755 scripts/ast_coredumper "$(DESTDIR)$(ASTDATADIR)/scripts/ast_coredumper"
if [ -n "$(findstring REF_DEBUG,$(MENUSELECT_CFLAGS))" ]; then \
$(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/scripts"; \
$(INSTALL) -m 755 scripts/refcounter.py "$(DESTDIR)$(ASTDATADIR)/scripts/refcounter.py"; \
fi
uninstall:
rm -f "$(DESTDIR)$(ASTDATADIR)/scripts/ast_coredumper"
rm -f "$(DESTDIR)$(ASTDATADIR)/scripts/refcounter.py"