llvm/mlir/include/mlir/Debug/Counter.h

//===- DebugCounter.h - Debug Counter support -------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_TRACING_DEBUGCOUNTER_H
#define MLIR_TRACING_DEBUGCOUNTER_H

#include "mlir/IR/Action.h"
#include "llvm/ADT/StringMap.h"
#include <string>

namespace mlir {
namespace tracing {

/// This class implements an action handler that attaches a counter value
/// to debug actions and enables/disables execution of these action based on the
/// value of the counter. The counter controls the execution of the action with
/// a "skip" and "count" value. The "skip" value is used to skip a certain
/// number of initial executions of an action. The "count" value is used to
/// prevent an action from executing after it has executed for a set number
/// of times (not including any executions that have been skipped). For example,
/// a counter for an action with `skip=47` and `count=2`, would skip the
/// first 47 executions, then execute twice, and finally prevent any further
/// executions.
class DebugCounter {};

} // namespace tracing
} // namespace mlir

#endif // MLIR_TRACING_DEBUGCOUNTER_H