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/util/record-utility.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/slang-record-replay/util/record-utility.cpp') diff --git a/source/slang-record-replay/util/record-utility.cpp b/source/slang-record-replay/util/record-utility.cpp index 8bf89ea67..ea7618e81 100644 --- a/source/slang-record-replay/util/record-utility.cpp +++ b/source/slang-record-replay/util/record-utility.cpp @@ -6,6 +6,7 @@ #include #include "record-utility.h" +#include "../../core/slang-string-util.h" constexpr const char* kRecordLayerEnvVar = "SLANG_RECORD_LAYER"; constexpr const char* kRecordLayerLogLevel = "SLANG_RECORD_LOG_LEVEL"; @@ -74,9 +75,13 @@ namespace SlangRecord return; } + Slang::StringBuilder builder; + va_list args; va_start(args, fmt); - vfprintf(stdout, fmt, args); + Slang::StringUtil::append(fmt, args, builder); va_end(args); + + fprintf(stdout, "[slang-record-replay]: %s", builder.begin()); } } -- cgit v1.2.3