Dear All,
If I interrupt my DirectFB program with ctrl-C, or if it gets a
divide-by-zero or similar, or if call exit(), there's clearly some
sort of automatic tidying up going on e.g.
(!) [ 2306: 0.000] --> Caught signal 2 (sent by the kernel) <--
Currently I'm trying to profile my code, and I believe that compiling
with profiling enabled links in something that runs at termination to
save the gmon.out file. I call exit(0) when I've done the activity
that I want to profile. Sometimes gmon.out is written e.g. when I got
output like this:
(!!!) *** WARNING [Application exited without deinitialization of
DirectFB!] *** [core.c:775 in dfb_core_deinit_check()]
Interface instances remaining (79):
- 'IDirectFB' at 0x99d17a0 (dfb) allocated in DirectFBCreate
(directfb.c: 197)
- 'IDirectFBSurface' at 0x99e0b08 (iface) allocated in
IDirectFB_CreateSurface (idirectfb.c: 699)
- 'IDirectFBInputDevice' at 0x99e0d28 (*context->interface) allocated
in GetInputDevice_Callback (idirectfb.c: 1503)
- 'IDirectFBEventBuffer' at 0x99e1058 (b) allocated in
IDirectFBInputDevice_CreateEventBuffer (idirectfbinputdevice.c: 141)
...more similar....
but more often it's not written, presumably because the DirectFB
termination code has somehow bypassed it; for example when I got output
like this:
(!!!) *** WARNING [Application exited without deinitialization of
DirectFB!] *** [core.c:775 in dfb_core_deinit_check()]
(!) [ NO NAME 0.000] ( 2387) *** Assertion [layersfield !=
NULL] failed *** [layers.c:482 in dfb_layer_at_translated()]
(!) [ 2387: 0.000] --> Caught signal 5 (unknown origin) <--
Trace/breakpoint trap
What is the "official" way to terminate a DirectFB program, so that the
gprof stuff will run? Presumably it would terminate tidily if I
released all of the DFB interfaces, but that's pretty hard in this case
because I'm typically using code like this:
for (.....) {
while (....) {
// you get the idea, deeply nested function calls, loops
if (n>10000) {
// we've been running for long enough to develop a good profile
exit(0);
Thanks for any suggestions.
Phil.
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users