Customize the Worst Stack Size Report

The Worst Stack Size report is based on a template called wssreport.template that you can find in the folder <install>/lib/reports.

This template is made of 2 parts:
  • The HTML part that is the common to all reports,
  • A JavaScript part that sets the tables and call graph depending on 2 variables dynamically initialized when the report is created:

    o var data = {{json}}; // the raw data

    o var d = new Date({{date}}); // the date of the generation

Raw data

Raw data is made of four sections at the top level:
  • A summary of the Worst Stack Size metrics:
    • worstStackSize is the worst stack size computed by the tools, depending on the information you provided. This number is provided in bytes.
    • nbFlows is the number of control flows found in your application. A control flow is a set of successive calls starting from an entry point (each function that is never called by another one is considered as an entry point) to a function without calls or to an external function.
    • nbFlowsWithoutStack is the number of control flows for which there is no estimation of the stack size. This happens when one of the functions in this control flow has not been executed, or if it is an external function for which we have not provided an estimation of the stack size.
    • nbRecursiveFlows is the number of recursive control flows found in the application.
    • nbFunctions is the number of functions in your application.
    • nbFunctionsNoValue is the number of functions without stack size estimation. These are the functions that have not been executed, or the external functions for which there is no estimation of the stack size provided.
    Worst Stack Size metrics
The list of the modules, each of them has the following information:
  • name is the short name of the C file,
  • fullname is the name and path of the C file,
  • uuid is a unique identifier of the module,
  • unknown is set to true if the module is not part of the information you provided (there is only one unknown module that gathers all the function calls that are not in the known modules),
  • functions is the list of the unique identifiers of functions of the module.
Modules are listed as Hashmap with the uuid, as following: Hashmap
The list of functions, each of them have the following information:
  • name is the name of the C function.
  • line is the first line of the function in the module.
  • id is the number used in .tsf file to identify this function.
  • stacksize is the stack size computed during the execution if this option has been set (otherwise -1).
  • uuid is a unique identifier of the function.
  • module is a unique identifier of the module in which the function is declared.
  • calls is the list of the calls in this function. Each of them have the following information:
    • calling_uuid is the unique identifier of the calling function.
    • called_uuid is the unique identifier of the called function.
    • line is the line number of the call in the module.
    • col is the column number of the call in the module.
    • same_module is set to true if the called function is in the same module that the calling function.
    • level is a number that represents the level of the function in the call graph, starting from 0.
    • calledby is the list of unique identifiers of functions that call the function.
Functions are listed as hashmap with the uuid, as following: hashmap
The list of the Control Flows, each of them have the following information:
  • stacksize is the size of the stack computed for the control flow. This value is -1 if the tool was unable to compute it.
  • calls is the list of successive calls that composed this control flow, each of them is including the following information:
    • calling_uuid is the unique identifier of the calling function.
    • called_uuid is the unique identifier of the called function.
    • line is the line number of the call in the module.
    • col is the column number of the call in the module.
    • same_module is set to true id. The called function is in the same module that the calling function.
    • alternates is a list of line & column in case of the calling function is called several times in this function.
  • isRecursive is set to true if a recursive call has been found in this control flow.
  • missingFunctions is the list of functions (name and unique identifier) in the control flow for which we have not the stack size.
Control flows are listed as an array, as follows: Array