#summary Specification of the structure of the preprocessed files. ==Preprocessed file format== Specification of the structure of the preprocessed files in EBNF(almost). ===Version 6=== Very much like version 5 except it includes information about which functions is called from each function, *Notes* * Address numbers refer to byte-offsets into the file. * Count numbers typically indicate the number of the following elements that can be read. * Function numbers refer to a function numbered in the order they occur in the function_addresses list. Numbering starts from 0. *Format* {{{ file_contents: version_number header_address function_count function_addresses functions headers version_number: number header_address: number function_count: number function_addresses: {number} functions: {summed_self_cost summed_inclusive_cost invocation_count called_from_count sub_call_count called_from_information sub_call_information file_name function_name} summed_self_cost: number summed_inclusive_cost: number summed_call_cost: number invocation_count: number called_from_count: number sub_call_count: number called_from_information: call_information sub_call_information: call_information call_information: {function_number line call_count summed_call_cost} function_number: number line: number call_count: number summed_call_cost: number file_name: string_newline function_name: string_newline headers: {string_newline} string_newline: any string terminated by a newline character number: unsigned long (always 32 bit, little endian byte order) }}} ===Version 5 (introduced after webgrind 0.4)=== Simpler than version 4. It does not contain the full tree structure of the execution, but is simpler to generate and contains the information needed for webgrind(as of version 0.5). As this format does not contain information for each invocation it requires much less space. *Notes* * Address numbers refer to byte-offsets into the file. * Count numbers typically indicate the number of the following elements that can be read. * Function numbers refer to a function numbered in the order they occur in the function_addresses list. Numbering starts from 0. *Format* {{{ file_contents: version_number header_address function_count function_addresses functions headers version_number: number header_address: number function_count: number function_addresses: {number} functions: {summed_self_cost summed_inclusive_cost invocation_count called_from_count call_information file_name function_name} summed_self_cost: number summed_inclusive_cost: number summed_call_cost: number invocation_count: number called_from_count: number call_information: {function_number line call_count summed_call_cost} function_number: number line: number call_count: number summed_call_cost: number file_name: string_newline function_name: string_newline headers: {string_newline} string_newline: any string terminated by a newline character number: unsigned long (always 32 bit, little endian byte order) }}} ===Version 4 (last used in webgrind 0.4)=== Contains all information from the callgrind file. The tree structure of the trace is preserved and contains pointers so that it can be traversed top-down and bottom up. *Notes* * Address numbers refer to byte-offsets into the file. * Count numbers typically indicate the number of the following elements that can be read. * Function numbers refer to a function numbered in the order they occur in the function_addresses list. Numbering starts from 0. * Invocation numbers refer to an invocation of a function in the order they occur in the invocations list. Numbering starts from 0. *Format* {{{ file_contents: version_number header_address function_count function_addresses functions subcalls headers version_number: number header_address: number function_count: number function_addresses: {number} functions: {total_self_cost total_inclusive_self_cost total_call_cost invocation_count invocations file_name function_name} total_self_cost: number total_inclusive_self_cost: number total_call_cost: number invocation_count: number invocations: self_cost inclusive_self_cost called_from subcall_count subcall_address file_name: string_newline function_name: string_newline self_cost: number inclusive_self_cost: number called_from: call_cost function invocation line_number call_cost: number function: number invocation: number line_number: number subcall_count: number subcall_address: number subcalls: {function invocation line_number call_cost} headers: {string_newline} string_newline: any string terminated by a newline character number: unsigned long (always 32 bit, little endian byte order) }}}