Here are some screenshots and show cases, gathered by few DeepSee visible features.
For each example, you can refer to the related source code file for more details/comments/explainations.
Logger system
- filter logs with dynamical regex rules
- useful debug infos, colorized by gravity level and mean
- print full infos calling stack at any time
Here is a show case, some logs are skipped because of filter rules, have a look at the source code:
- messages, debug and error default streams can easily be reassigned
- streams can have dispatcher that enable them to dispatch to several other streams
- there are several backends for formating.
Here, we re set the debug stream (-cdbg) to standard error stream, in color format, and add (+=) a file as output as well, in pure text format. Several other output may be added this way:
Handling signals
- want to display the calling backtrace on segfault? Just enable it by adding DS_SIGNAL_CATCH(SIGSEGV); in your main()...
- want to display the calling backtrace on all signals? DS_SIGNAL_CATCH_ALL();
When signal raise, DeepSee handler is called, it displays the backtrace, restore the previous handler, call it and re-register itself for the next time:
Want to see where you currently are in your code? just press Ctrl-Z, the Stop signal will be caught, and the backtrace displayed. Just re-enter by reputing your process in fore ground:
Memory leak detection
- how many memory is used by the host application? how many by DeepSee internally?
- Fine memory leak detection, something like what you see with valgrind, but much more flexible and lite for CPU/memory at runtime!
Works well even on huge projects (used for debugging OWB web browser for example!)
- where do we call malloc(new, realloc, ...)? (by the way, did you know that when you ask for 30, 40 or 450 bytes, you may in fact get more (36, 44 and 452 here) depending of available chunks in malloc engine?)
- you can display list (choose the level of details you want) of all currently allocated buffers at any time. Simply call DS_MEMORY_FINE_DUMP(). See the DoxyGen API for details.
- when a memory leak is detected, the amount of memory is displayed (litest version to detect memory leaks)
- (deprecated) Earlier version of mem tracing:
Timings, instrumentation
Timing macros may use several backends, choose the best for your target system:
Interactive console/prompting
- start a prompt from inside your code when you want
- add custom commands to this console, that directly interact with your application from inside!
- easy formated help for commands, and automatic completion/helper while typing!
Very useful, you have list of possible options (position dependent), with short help, default values, possible operators (=, +=, -=, ...) for each! Don't need to look at doc or code source to remember how to use a custom command:
MACRO API
DeepSee is source code intrusive, that's to say, you'll have to add (very) few lines of code in your software in order to make it work.
But, in compiled binary, you can have no bit from DeepSee, if you decide to disable DeepSee.
Have a look at samples/showBuild/runme.sh in the source tree, you'll find a realtime demo:
Taking a simple hello world c++ file (reference), we copy the file and add some DeepSee things:
All diff between the refmain and main are:
diff ../orig.cpp ../main.cpp
1a2,6
>
> //Tell we want to use the logger system. It will be only effectivly used if DEEPSEE_LOGGER_ENABLE is also defined (cf build command)
> #define DEEPSEE_LOGGER_USE 1
> #include DEEPSEE_INCLUDE
>
4a13,14
> DS_MSG("Hello world from DeepSee!");
>
Now, we compile the reference (no DeepSee code in it), and the version with DeepSee code inside, with DeepSee enabled and disabled. The result:
You can see that DeepSee has exactly ZERO impact on the binary size for a code that contains DeepSee calls, when DeepSee is disabled: 12 -rwxr-xr-x 1 fred fred 8853 2008-09-25 00:15 ./ref_code 12 -rwxr-xr-x 1 fred fred 8853 2008-09-25 00:15 ./all_code_disabled 8 -rwxr-xr-x 1 fred fred 6984 2008-09-25 00:09 ./all_code_enabled now, if we strip files: 8 -rwxr-xr-x 1 fred fred 4720 2008-09-25 00:15 ./ref_code 8 -rwxr-xr-x 1 fred fred 4720 2008-09-25 00:15 ./all_code_disabled 8 -rwxr-xr-x 1 fred fred 6984 2008-09-25 00:15 ./all_code_enabled And if we diff the reference and deepsee disabled binaries, no difference! diff ./ref_code ./all_code_disabled hit [enter] to continue
Enable only needed features
When building a binary, tell which features you want to enable:
Attachments
- console1.png (109.5 kB) - added by fmarmond on 09/24/08 23:45:14.
- console2.png (93.2 kB) - added by fmarmond on 09/24/08 23:45:43.
- logger1.png (64.3 kB) - added by fmarmond on 09/24/08 23:46:16.
- logger2.png (112.0 kB) - added by fmarmond on 09/24/08 23:46:45.
- signal.png (101.0 kB) - added by fmarmond on 09/24/08 23:47:08.
- signal2.png (99.6 kB) - added by fmarmond on 09/24/08 23:47:32.
- memory1.png (51.8 kB) - added by fmarmond on 09/25/08 00:38:48.
- memory2.png (11.8 kB) - added by fmarmond on 09/25/08 00:39:00.
- instrument1.png (52.9 kB) - added by fmarmond on 09/25/08 00:39:19.
- configure1.png (53.4 kB) - added by fmarmond on 09/25/08 00:51:29.
- memory3.png (42.0 kB) - added by fmarmond on 10/16/08 17:45:57.




