MLIR  20.0.0git
Public Member Functions | List of all members
mlir::tracing::ActionLogger Struct Reference

This class defines an observer that print Actions before and after execution on the provided stream. More...

#include "mlir/Debug/Observers/ActionLogging.h"

+ Inheritance diagram for mlir::tracing::ActionLogger:

Public Member Functions

 ActionLogger (raw_ostream &os, bool printActions=true, bool printBreakpoints=true, bool printIRUnits=true)
 
void beforeExecute (const ActionActiveStack *action, Breakpoint *breakpoint, bool willExecute) override
 This method is called before the Action is executed If a breakpoint was hit, it is passed as an argument to the callback. More...
 
void afterExecute (const ActionActiveStack *action) override
 This method is called after the Action is executed, if it was executed. More...
 
void addBreakpointManager (const BreakpointManager *manager)
 If one of multiple breakpoint managers are set, only actions that are matching a breakpoint will be logged. More...
 
- Public Member Functions inherited from mlir::tracing::ExecutionContext::Observer
virtual ~Observer ()=default
 

Detailed Description

This class defines an observer that print Actions before and after execution on the provided stream.

Definition at line 23 of file ActionLogging.h.

Constructor & Destructor Documentation

◆ ActionLogger()

mlir::tracing::ActionLogger::ActionLogger ( raw_ostream &  os,
bool  printActions = true,
bool  printBreakpoints = true,
bool  printIRUnits = true 
)
inline

Definition at line 24 of file ActionLogging.h.

Member Function Documentation

◆ addBreakpointManager()

void mlir::tracing::ActionLogger::addBreakpointManager ( const BreakpointManager manager)
inline

If one of multiple breakpoint managers are set, only actions that are matching a breakpoint will be logged.

Definition at line 35 of file ActionLogging.h.

◆ afterExecute()

void ActionLogger::afterExecute ( const ActionActiveStack action)
overridevirtual

This method is called after the Action is executed, if it was executed.

It is not called if the action is skipped. Note that this method will be called from multiple threads concurrently when MLIR multi-threading is enabled.

Reimplemented from mlir::tracing::ExecutionContext::Observer.

Definition at line 66 of file ActionLogging.cpp.

References mlir::tracing::ActionActiveStack::getAction(), and mlir::tracing::Action::getTag().

◆ beforeExecute()

void ActionLogger::beforeExecute ( const ActionActiveStack action,
Breakpoint breakpoint,
bool  willExecute 
)
overridevirtual

This method is called before the Action is executed If a breakpoint was hit, it is passed as an argument to the callback.

The willExecute argument indicates whether the action will be executed or not. Note that this method will be called from multiple threads concurrently when MLIR multi-threading is enabled.

Reimplemented from mlir::tracing::ExecutionContext::Observer.

Definition at line 32 of file ActionLogging.cpp.

References mlir::tracing::ActionActiveStack::getAction(), mlir::tracing::Action::getContextIRUnits(), mlir::tracing::Action::getTag(), and mlir::tracing::Action::print().


The documentation for this struct was generated from the following files: