13 #include "llvm/Support/Casting.h"
14 #include "llvm/Support/Threading.h"
15 #include "llvm/Support/raw_ostream.h"
35 llvm::StringRef phase) {
38 llvm::raw_string_ostream event(str);
41 event << R
"("cat": "PERF", )";
42 event << R
"("ph": ")" << phase << "\", ";
43 event << R
"("pid": 0, )";
44 event << R
"("tid": )" << llvm::get_threadid() << ", ";
45 auto ts = std::chrono::steady_clock::now() - startTime;
47 << std::chrono::duration_cast<std::chrono::microseconds>(ts).count();
49 event << R
"(, "args": {)";
50 event << R
"("desc": ")";
57 std::lock_guard<std::mutex> guard(mutex);
virtual void print(raw_ostream &os) const
virtual StringRef getTag() const =0
Return a string "tag" which intends to uniquely identify this type of action.
This abstract class represents a breakpoint.
Include the generated interface declarations.
This class is used to keep track of the active actions in the stack.
const Action & getAction() const
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 argum...
void afterExecute(const ActionActiveStack *action) override
This method is called after the Action is executed, if it was executed.