The cctools debugging system is built into all software components. Any code may invoke debug with a printf-style message to log relevant information. Each debug call uses a flag to indicate which subsystem is doing the logging, so that various subsystems may be easily turned on and off. For example, the Chirp subsystem has many statements like this:
debug(D_CHIRP,"reading file %s from host %s:d",filename,hostname,port);
The main
routine of a program is responsible for calling debug_config, debug_config_file and debug_flags_set to choose what to display and where to send it. By default, nothing is displayed, unless it has the flags D_NOTICE or D_FATAL. For example, a main program might do this:
debug_config("superprogram"); debug_config_file("/tmp/myoutputfile"); debug_flags_set("tcp"); debug_flags_set("chirp");
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
Go to the source code of this file.
Defines | |
#define | D_SYSCALL 0x00000001 |
Debug system calls in Parrot. | |
#define | D_CHANNEL 0x00000002 |
Debug the I/O channel in Parrot. | |
#define | D_PROCESS 0x00000004 |
Debug jobs and process. | |
#define | D_NOTICE 0x00000008 |
Indicates a message that is always shown. | |
#define | D_RESOLVE 0x00000010 |
Debug the file name resolver in Parrot. | |
#define | D_LIBCALL 0x00000020 |
Debug I/O library calls in Parrot. | |
#define | D_LOCAL 0x00000040 |
Debug the local I/O module in Parrot. | |
#define | D_DNS 0x00000080 |
Debug domain name lookups. | |
#define | D_TCP 0x00000100 |
Debug TCP connections and disconnections. | |
#define | D_AUTH 0x00000200 |
Debug authentication and authorization actions. | |
#define | D_IRODS 0x00000400 |
Debug the iRODS module in Parrot. | |
#define | D_CLOUD 0x00000800 |
Debug Cloud operations. | |
#define | D_HTTP 0x00001000 |
Debug HTTP queries. | |
#define | D_FTP 0x00002000 |
Debug FTP operations. | |
#define | D_NEST 0x00004000 |
Debug the NEST module in Parrot. | |
#define | D_GROW 0x00008000 |
Debug the GROW filesystem in Parrot. | |
#define | D_CHIRP 0x00010000 |
Debug Chirp protocol operations. | |
#define | D_DCAP 0x00020000 |
Debug the DCAP module in Parrot. | |
#define | D_RFIO 0x00040000 |
Debug the RFIO module in Parrot. | |
#define | D_GLITE 0x00080000 |
Debug the gLite module in Parrot. | |
#define | D_MULTI 0x00100000 |
Debug Chirp Multi filesystems. | |
#define | D_PSTREE 0x00200000 |
Debug process trees in Parrot. | |
#define | D_ALLOC 0x00400000 |
Debug space allocations in the Chirp server. | |
#define | D_LFC 0x00800000 |
Debug LFC file lookups in Parrot. | |
#define | D_GFAL 0x01000000 |
Debug the GFAL module in Parrot. | |
#define | D_SUMMARY 0x02000000 |
Show I/O summary stats in Parrot. | |
#define | D_DEBUG 0x04000000 |
Show general debugging messages. | |
#define | D_LOGIN 0x08000000 |
Debug logins on the Chirp server. | |
#define | D_CACHE 0x10000000 |
Debug cache operations in Parrot. | |
#define | D_POLL 0x20000000 |
Debug FD polling in Parrot. | |
#define | D_GETENV 0x40000000 |
Debug calls to getenv. | |
#define | D_REMOTE (D_HTTP|D_FTP|D_NEST|D_CHIRP|D_DCAP|D_RFIO|D_LFC|D_GFAL|D_MULTI|D_GROW|D_IRODS) |
Debug all remote I/O operations. | |
#define | D_ALL 0xffffffff |
Show all debugging info. | |
Functions | |
void | debug (int flags, char *fmt,...) |
Emit a debugging message. | |
void | fatal (char *fmt,...) |
Emit a fatal debugging message and exit. | |
void | debug_config (char *name) |
Initialize the debugging system. | |
void | debug_config_file (const char *file) |
Direct debug output to a file. | |
void | debug_config_file_size (int size) |
Set the maximum debug file size. | |
int | debug_flags_set (const char *flagname) |
Set debugging flags to enable output. | |
void | debug_flags_print (FILE *stream) |
Display the available debug flags. | |
int | debug_flags_clear () |
Clear all debugging flags. |
|
Debug system calls in Parrot.
|
|
Debug the I/O channel in Parrot.
|
|
Debug jobs and process.
|
|
Indicates a message that is always shown.
|
|
Debug the file name resolver in Parrot.
|
|
Debug I/O library calls in Parrot.
|
|
Debug the local I/O module in Parrot.
|
|
Debug domain name lookups.
|
|
Debug TCP connections and disconnections.
|
|
Debug authentication and authorization actions.
|
|
Debug the iRODS module in Parrot.
|
|
Debug Cloud operations.
|
|
Debug HTTP queries.
|
|
Debug FTP operations.
|
|
Debug the NEST module in Parrot.
|
|
Debug the GROW filesystem in Parrot.
|
|
Debug Chirp protocol operations.
|
|
Debug the DCAP module in Parrot.
|
|
Debug the RFIO module in Parrot.
|
|
Debug the gLite module in Parrot.
|
|
Debug Chirp Multi filesystems.
|
|
Debug process trees in Parrot.
|
|
Debug space allocations in the Chirp server.
|
|
Debug LFC file lookups in Parrot.
|
|
Debug the GFAL module in Parrot.
|
|
Show I/O summary stats in Parrot.
|
|
Show general debugging messages.
|
|
Debug logins on the Chirp server.
|
|
Debug cache operations in Parrot.
|
|
Debug FD polling in Parrot.
|
|
Debug calls to getenv.
|
|
Debug all remote I/O operations.
|
|
Show all debugging info.
|
|
Emit a debugging message. Logs a debugging message, if the given flags are active.
|
|
Emit a fatal debugging message and exit. Displays a printf-style message, and then forcibly exits the program.
|
|
Initialize the debugging system. Must be called before any other calls take place.
|
|
Direct debug output to a file. All enabled debugging statements will be sent to this file.
|
|
Set the maximum debug file size. Debugging files can very quickly become large and fill up your available disk space. This functions sets the maximum size of a debug file. When it exceeds this size, it will be renamed to (file).old, and a new file will be started.
|
|
Set debugging flags to enable output.
Accepts a debug flag in ASCII form, and enables that subsystem. For example:
|
|
Display the available debug flags. Prints on the standard output all possible debug flag names that can be passed to debug_flags_set. Useful for constructing a program help text.
|
|
Clear all debugging flags. Clear all currently set flags, so that no output will occur.
|