Class default

This class provides a parser for callgrind files. It can be used to extract profile information from the callgrind file. Specification of callgrind type files can be found in valgrind website.

Hierarchy

  • default

Constructors

  • Creates an instance of CallGrind.

    Parameters

    • file: string | Readable

      The file parameter is either a string representing the path to a file or a Readable stream for the callgrind file to be parsed.

    Returns default

Properties

HEADER_REGEX: RegExp = ...

The regular expression for matching header lines.

REGEXLIST: {
    cfi: RegExp;
    cfl: RegExp;
    cfn: RegExp;
    fl: RegExp;
    fn: RegExp;
} = ...

The regular expression list for matching different types of lines.

Type declaration

  • cfi: RegExp
  • cfl: RegExp
  • cfn: RegExp
  • fl: RegExp
  • fn: RegExp
errorLines: string[] = []

The list of error lines encountered during parsing.

eventList: string[] = []

The list of events specified in the callgrind file.

fileList: {
    [fkey: string]: string;
} = {}

The list of files specified in the callgrind file.

Type declaration

  • [fkey: string]: string
fstream: Interface

The readline.Interface instance that is used to read the file.

functionList: {
    [fkey: string]: string;
} = {}

The list of functions specified in the callgrind file.

Type declaration

  • [fkey: string]: string
header: {
    [key: string]: any;
} = {}

The header section of the callgrind file.

Type declaration

  • [key: string]: any
profiledb: ProfileDatabase = {}

The profile database that stores the extracted profile information.

scope: {
    parameters?: {
        [field: string]: string;
    };
    section: string;
} = ...

The current scope of the parser.

Type declaration

  • Optional parameters?: {
        [field: string]: string;
    }
    • [field: string]: string
  • section: string

Methods

  • Private

    Returns the current scope of the caller function in the parser.

    Returns

    The current scope of the caller function in the parser.

    Returns {
        file: {
            id: string;
            name: string;
        };
        function: {
            id: string;
            name: string;
        };
    }

    • file: {
          id: string;
          name: string;
      }
      • id: string
      • name: string
    • function: {
          id: string;
          name: string;
      }
      • id: string
      • name: string
  • Private

    Returns the current scope of the parser.

    Returns

    The current scope of the parser.

    Returns {
        file: {
            id: string;
            name: string;
        };
        function: {
            id: string;
            name: string;
        };
    }

    • file: {
          id: string;
          name: string;
      }
      • id: string
      • name: string
    • function: {
          id: string;
          name: string;
      }
      • id: string
      • name: string
  • Private

    Checks if a line is a comment line.

    Returns

    true if the line is a comment line, false otherwise.

    Parameters

    • line: string

      The line to be checked.

    Returns boolean

  • Parses a single line of a Callgrind file asynchronously, updating the internal states of the CallGrind object.

    Returns

    A Promise that resolves to void.

    Parameters

    • line: string

      A single line from a Callgrind file.

    Returns void

Generated using TypeDoc