BOREALIS DEVELOPER NOTES
These are random notes by and for developers.
For debugging, you can use DEBUG and INFO macros instead of NOTICE or WARN.
NOTICE and WARN always appear (so they are meant for messages that we always
want to show rather than for debugging messages) while DEBUG and INFO can be
enabled and disabled on a per-file basis as follows:
Enable all INFO messages in all files:
export LOG_LEVEL=1
Enable all DEBUG and INFO messages in all files:
export LOG_LEVEL=2
Disable all DEBUG and INFO messages in all files:
export LOG_LEVEL=0
Enable all INFO messages for file foo.cc only:
export LOG_LEVEL="0 foo.cc:1"
Enable all INFO and DEBUG messages for file foo.cc only:
export LOG_LEVEL="0 foo.cc:2"
To see RPC calls set:
export LOG_LEVEL="2 rpc:2"
To see TCP RPC calls set:
export LOG_LEVEL="2 tcprpc:2"
nmstl/debug contains a simple debugging framework. There are six debug levels,
and six corresponding macros to generate debug messages:
DEBUG << "foo is " << foo
INFO << "Accepted connection from " << addr;
WARN << "...";
ERROR << "...";
FATAL << "Assertion failed"; // Also kills program
COREDUMP << "Assertion failed"; // Kills program, leaving core dump
You can pass any sorts of arguments to these macros, in the typical iostreams
fashion (although they're not technically iostreams). Each argument will be
stringified, if necessary, using to_string. To determine which messages are
printed, the debugging code reads the DEBUG environment variable. Warnings,
errors, fatal errors, and core dumps are always displayed. Info messages are
displayed only if the DEBUG environment variable is set to 1 or higher; debug
messages are displayed only if the DEBUG environment variables is set to 2 or
higher.
To run gdb you need to go through libtool to access the dynamic libraries:
borealis/src/src> libtool --mode=execute gdb borealis
(gdb) run -d :15100
Starting program: /home/user/borealis/src/src/.libs/lt-borealis -d :15100
:
If you configure with --enable-static (or without
any option at all), then libtool should create static libraries for you in
addition to shared libraries. To test it easily, you can configure with
--disable-shared --enable-static,
then you will only get the static libraries.
You can use ccache speed up Borealis builds. Just set the environment variable:
export CXX="ccache g++"
Here is how to install CCache.
I have that set and thus I use ccache, but I still find that compiling
takes time. I upgraded ccache to version 2.3, it makes a tremendous
difference. [Using] ccache makes a *huge* difference and if it doesn't
then it might be a problem with that version of ccache. -magda
I gathered the random design/spec/API docs on Borealis and added them
to CVS under:
borealis/doc/specs/
Many of these are not quite up-to-date, but it's all the documentation
that we have. Feel free to add, remove or update documents and
subdirectories in this section. I probably missed some things.
Note: It is best to add the original source of your docs. If these are
word docs, please add them as binary (with cvs add -kb foo.doc). -magda
src/config.log
If you use your old config.log to remember the parameters you used in your "wtf
configure" command, be careful. It appears that the command in the log file may
contain extra arguments that you don't need. One of these can be "--no-create"
which will prevent the configure script from creating any Makfiles.
So, please just make sure to re-use only the parameters that you recognize.
wip.txt
Some might find it useful to keep a list of files they are currently
modifying so they don't lose track when making lots of changes. Keep a
wip.txt file (work in progress) with changed file or directory
paths plus any reminders and status. After a checkin just draw a line at
the top and start a new section. Retain the old section so you can see
what you did before.