Skip to content

File trace.h

FileList > include > simtix > trace.h

Go to the source code of this file

  • #include <fmt/format.h>
  • #include <fmt/ostream.h>
  • #include <fmt/printf.h>
  • #include <simtix/clocked.h>
  • #include <simtix/macro.h>
  • #include <cstdio>
  • #include <iostream>
  • #include <string>

Namespaces

Type Name
namespace simtix
namespace trace

Classes

Type Name
class KonataTracer
Dump Konata traces to a given std::ostream. This class is a singleton class and only one instance will exist in a program. Users should dump the trace with <KONATA>.
class OstreamTracer
Dump traces to a given std::ostream. This class is a singleton class and only one instance will exist in a program. Users should dump the trace with <DDUMP> or <DPRINTF>.

Public Attributes

Type Name
const char * TRACE_FMT = "[{:d}\t" FLAG\_FMT(MAX\_FLAG\_LENGTH) "] {}"
constant Trace format: | [<tick> <flag>] <msg>

Macros

Type Name
define DDUMP (flag, ...) /* multi line expression */
Dump a trace verbatim to the output stream if the debug flag is turned on.
define DPRINT (flag, ...) /* multi line expression */
Dump a trace with the flag name and current tick to the output stream if the debug flag is turned on.
define DPRINTF (flag, ...) /* multi line expression */
Dump a trace with the flag name and current tick to the output stream if the debug flag is turned on.
define FLAG_FMT (length) "{:&lt;" STRINGIFY(length) "}"
define KONATA (cmd, ...) /* multi line expression */
Dump the Kanata log if Konata debug flag is turned on.
define MAX_FLAG_LENGTH 10
define TRACE_ENABLED (flag) DEFINED\_MACRO(flag##\_TRACE\_ENABLED)
An constant expression to examine whether a debug flag is turned on.

Public Attributes Documentation

variable TRACE_FMT

constant Trace format: | [<tick> <flag>] <msg>

const char* TRACE_FMT;


Macro Definition Documentation

define DDUMP

Dump a trace verbatim to the output stream if the debug flag is turned on.

#define DDUMP (
    flag,
    ...
) `/* multi line expression */`

Parameters:

  • flag The debug flag.
  • ... The message in fmt-style format arguments.

define DPRINT

Dump a trace with the flag name and current tick to the output stream if the debug flag is turned on.

#define DPRINT (
    flag,
    ...
) `/* multi line expression */`

Parameters:

  • flag The debug flag.
  • ... The message in fmt-style format arguments.

define DPRINTF

Dump a trace with the flag name and current tick to the output stream if the debug flag is turned on.

#define DPRINTF (
    flag,
    ...
) `/* multi line expression */`

Parameters:

  • flag The debug flag.
  • ... The message in C-style printf format arguments.

define FLAG_FMT

#define FLAG_FMT (
    length
) `"{:<" STRINGIFY(length) "}"`

define KONATA

Dump the Kanata log if Konata debug flag is turned on.

#define KONATA (
    cmd,
    ...
) `/* multi line expression */`

Parameters:


define MAX_FLAG_LENGTH

#define MAX_FLAG_LENGTH `10`

define TRACE_ENABLED

An constant expression to examine whether a debug flag is turned on.

#define TRACE_ENABLED (
    flag
) `DEFINED_MACRO(flag##_TRACE_ENABLED)`

Parameters:

  • flag The debug flag to examine.


The documentation for this class was generated from the following file projects/simtix/include/simtix/trace.h