MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | #include <driver_info.h> |
| 3 | |
| 4 | int dump_driver_info(int what) |
| 5 | int dump_driver_info(int what, string filename) |
| 6 | |
| 7 | DESCRIPTION |
| 8 | Dumps information specificied by <what> into a file |
| 9 | specified by <filename>. If <filename> is omitted, |
| 10 | a default file name is used. The function calls |
| 11 | master->valid_write() to check that it can write |
| 12 | the files. The file in question is always written anew |
| 13 | |
| 14 | On success the efun returns 1, or 0 if an error occured. |
| 15 | |
| 16 | <what> == DDI_OBJECTS: |
| 17 | Dumps information about all live objects. |
| 18 | Default filename is '/OBJ_DUMP', |
| 19 | valid_write() will read 'objdump' for the function. |
| 20 | |
| 21 | For every object, a line is written into the file with the |
| 22 | following information in the given order: |
| 23 | - object name |
| 24 | - size in memory, shared data counted only once |
| 25 | - size in memory if data wouldn't be shared |
| 26 | - number of references |
| 27 | - 'HB' if the object has a heartbeat, nothing if not. |
| 28 | - the name of the environment, or '--' if the object |
| 29 | has no environment |
| 30 | - in parentheses the number of execution ticks spent |
| 31 | in this object |
| 32 | - the swap status: |
| 33 | nothing if not swapped, |
| 34 | 'PROG SWAPPED' if only the program is swapped |
| 35 | 'VAR SWAPPED' if only the variabes are swapped |
| 36 | 'SWAPPED' if both program and variables are swapped |
| 37 | - the time the object was created |
| 38 | |
| 39 | <what> == DDI_OBJECTS_DESTRUCTED: |
| 40 | Dumps information about all destructed objects. |
| 41 | Default filename is '/DEST_OBJ_DUMP', |
| 42 | valid_write() will read 'objdump' for the function. |
| 43 | |
| 44 | For every object, a line is written into the file with the |
| 45 | following information in the given order: |
| 46 | - object name |
| 47 | - number of references |
| 48 | - 'NEW' if the object was destructed in this execution |
| 49 | thread, nothing if it is older already. |
| 50 | |
| 51 | <what> == DDI_OPCODES: |
| 52 | Dumps usage information about the opcodes. |
| 53 | Default filename is '/OPC_DUMP', |
| 54 | valid_write() will read 'opcdump' for the function. |
| 55 | |
| 56 | <what> == DDI_MEMORY: |
| 57 | Dumps a list of all allocated memory blocks (if the allocator |
| 58 | supports this). |
| 59 | Default filename is '/MEMORY_DUMP', |
| 60 | valid_write() will read 'memdump' for the function, |
| 61 | and the new data will be appended to the end of the file. |
| 62 | |
| 63 | If the allocator doesn't support memory dumps, this call will |
| 64 | always return 0, and nothing will be written. |
| 65 | |
| 66 | This works best if the allocator is compiled with |
| 67 | MALLOC_TRACE and/or MALLOC_LPC_TRACE. |
| 68 | |
| 69 | NOTE: Make sure that this option can't be abused! |
| 70 | |
| 71 | HISTORY |
| 72 | Introduced in LDMud 3.5.0. |
| 73 | |
| 74 | SEE ALSO |
| 75 | driver_info(E), object_info(E), interactive_info(E) |