From 35b06ef1eb1b503f9f4850ba449719f8f8889b38 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 21 Feb 2022 13:55:53 -0800 Subject: [PATCH] UserspaceEmulator: Fix syntax of generated profiles While trying out `ue --profile` today, I received an invalid json profile. After poking around at the file it looks like we never close the `events: [..` array that we generate, and thus end up with an invalid document. The fix is straight forward, always emit the closing brace. --- Userland/DevTools/UserspaceEmulator/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/DevTools/UserspaceEmulator/main.cpp b/Userland/DevTools/UserspaceEmulator/main.cpp index da4975644f..b97a2ff23a 100644 --- a/Userland/DevTools/UserspaceEmulator/main.cpp +++ b/Userland/DevTools/UserspaceEmulator/main.cpp @@ -116,7 +116,7 @@ int main(int argc, char** argv, char** env) rc = emulator.exec(); if (dump_profile) { - emulator.profile_stream().write_or_error(", \"strings\": ["sv.bytes()); + emulator.profile_stream().write_or_error("], \"strings\": ["sv.bytes()); if (emulator.profiler_strings().size()) { for (size_t i = 0; i < emulator.profiler_strings().size() - 1; ++i) emulator.profile_stream().write_or_error(String::formatted("\"{}\", ", emulator.profiler_strings().at(i)).bytes());