From bab4b821dc6bcee4ff86751743762584c17e9103 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:03:27 -0500 Subject: Feature/replayer (#4750) * record/replay: Implement the json consumer Finish the implementation of json consumer. Fix some bug in the block processing as Tailer is not a necessary block so if the Magic bit is "HEAD", we should keep processing. * record/replay: Implement the replayer component Implement the replayer consumer, and also finish the slang-replay standalone app that will run the while replayer. It can take an option "--convert-json | -cj" which will convert the record binary file to a human readable json file. If there is no option provided, it will replay the record file by default. TODO: #4764 is created to remove the std::filesystem usage. --- source/slang-record-replay/record/record-manager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/slang-record-replay/record/record-manager.cpp') diff --git a/source/slang-record-replay/record/record-manager.cpp b/source/slang-record-replay/record/record-manager.cpp index f10d2c704..0979a170f 100644 --- a/source/slang-record-replay/record/record-manager.cpp +++ b/source/slang-record-replay/record/record-manager.cpp @@ -4,6 +4,7 @@ #include #include "../util/record-utility.h" #include "record-manager.h" +#include "../../core/slang-io.h" namespace SlangRecord { @@ -15,7 +16,8 @@ namespace SlangRecord m_recordFileDirectory = m_recordFileDirectory / "slang-record"; - if (!std::filesystem::exists(m_recordFileDirectory)) + Slang::String recordFileDirectory {m_recordFileDirectory.string().c_str()}; + if (!Slang::File::exists(recordFileDirectory)) { std::error_code ec; if (!std::filesystem::create_directory(m_recordFileDirectory, ec)) @@ -78,7 +80,7 @@ namespace SlangRecord return &m_recorder; } - void RecordManager::endMethodRecordAppendOutput() + void RecordManager::apendOutput() { FunctionTailer* pTailer = const_cast( reinterpret_cast(m_memoryStream.getData())); -- cgit v1.2.3