© Copyright IBM Corporation 2009
ALL RIGHTS RESERVED
When Really Small Message Broker hits a problem, it writes a file that contains the full state of the system. This is a binary data file that requires special decoding in order to extract information from it. This decoding is done with a tool called BE - Andy's Binary Folding Editor.
BE is a freely available tool that takes an ini file which describes the structure of the data to parse and then provides an interactive console to view and explore it.
The following things are needed to run BE:
be
- the tool itself, available from the link above.rsmb.heapdump.20091124.213117.363.dmp
rsmb.ini
- the BE ini file containing the structure informationbersmb.so
- the BE extension that enables BE to read the heapdump file. (TODO: sort out Windows)The ini file is built from the .h
files of RSMB. Wherever a data structure is defined in the C code, a matching RSMB
definition is also provided. It is important that they are kept in sync - any changes to one must be reflected in the other.
A basic guide for doing this will be written shortly.
To generate the ini file, a perl script is provided to pull out the BE definitions from the .h files. It is located in rsmb/src/tools/be/be.pl
. The easiest way
to run it is:
cd /src/dir/containing/broker.h perl tools/be/be.pl
By default, the tool will look for broker.h in the current directory and create rsmb.ini there as well. This can be changed, for example:
perl be.pl -s /src/dir/containing/ -o /tmp/rsmb.ini
To be updated for Windows
The source for the shared library is located in rsmb/src/tools/be/bersmb.c
and rsmb/src/tools/be/bememext.h
. The header file
is the standard BE one. bersmb.c is the RSMB specific code. A Makefile is also provided, so compiling the extension is as simple as invoking make
.
Once built, bersmb.so needs to be put somewhere where BE can find it. On linux, BE locates shared libraries by looking along the
LD_LIBRARY_PATH
, directories listed in the /etc/ld.so.cache
file, and in the /usr/lib
and /lib
directories.