Skip to content

DiagnosticsApi

David Anderson edited this page Aug 10, 2023 · 3 revisions

The BOINC diagnostics API

The diagnostics API determines where stdout and stderr are sent, and what's written to them. BOINC's initialization functions - boinc_init() etc. - set reasonable defaults for these settings. If for some reason you want different settings, this API lets you do it.

BOINC applications can call

int boinc_init_diagnostics(int flags)

BOINC graphics applications can call

int boinc_init_graphics_diagnostics(int flags)

to initialize various diagnostic functions. This call should be made early in the program - before boinc_init() - so that error info is routed appropriately. flags is formed by or'ing together a subset of the following flags.

Applications are advised to use at least BOINC_DIAG_DUMPCALLSTACKENABLED, BOINC_DIAG_REDIRECTSTDERR, and BOINC_DIAG_TRACETOSTDERR.

The default is BOINC_DIAG_DUMPCALLSTACKENABLED, BOINC_DIAG_HEAPCHECKENABLED, BOINC_DIAG_MEMORYLEAKCHECKENABLED, BOINC_DIAG_REDIRECTSTDERR, BOINC_DIAG_TRACETOSTDERR

BOINC_DIAG_DUMPCALLSTACKENABLED

If the application crashes, write a symbolic call stack to stderr. If you use this in a Windows application, you can make use of Symbol Stores for just in time debugging.

BOINC_DIAG_HEAPCHECKENABLED

Check the integrity of the malloc heap every N allocations. (N is line 249 in diagnostics.C; default 1024).

BOINC_DIAG_MEMORYLEAKCHECKENABLED

When process exits, write descriptions of any outstanding memory allocations to stderr.

BOINC_DIAG_ARCHIVESTDERR

Rename stderr.txt to stderr.old on startup.

BOINC_DIAG_ARCHIVESTDOUT

Rename stdout.txt to stdout.old on startup.

BOINC_DIAG_REDIRECTSTDERR

Redirect stderr to stderr.txt.

BOINC_DIAG_REDIRECTSTDOUT

Redirect stdout to stdout.txt.

BOINC_DIAG_REDIRECTSTDERROVERWRITE

Overwrite stderr.txt (default is to append).

BOINC_DIAG_REDIRECTSTDOUTOVERWRITE

Overwrite stdout.txt (default is to append).

BOINC_DIAG_TRACETOSTDERR

Write TRACE macros to stderr (Windows specific).

BOINC_DIAG_TRACETOSTDOUT

Write TRACE macros to stdout (Windows specific).

Clone this wiki locally