mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:27:45 +00:00
AK: Rename Stream::write_entire_buffer to Stream::write_until_depleted
No functional changes.
This commit is contained in:
parent
a3f73e7d85
commit
ecd1862859
46 changed files with 141 additions and 141 deletions
|
@ -509,7 +509,7 @@ void Emulator::emit_profile_sample(Stream& output)
|
|||
builder.appendff(R"~(, {{"type": "sample", "pid": {}, "tid": {}, "timestamp": {}, "lost_samples": 0, "stack": [)~", getpid(), gettid(), tv.tv_sec * 1000 + tv.tv_usec / 1000);
|
||||
builder.join(',', raw_backtrace());
|
||||
builder.append("]}\n"sv);
|
||||
output.write_entire_buffer(builder.string_view().bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
output.write_until_depleted(builder.string_view().bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
void Emulator::emit_profile_event(Stream& output, StringView event_name, DeprecatedString const& contents)
|
||||
|
@ -519,7 +519,7 @@ void Emulator::emit_profile_event(Stream& output, StringView event_name, Depreca
|
|||
gettimeofday(&tv, nullptr);
|
||||
builder.appendff(R"~(, {{"type": "{}", "pid": {}, "tid": {}, "timestamp": {}, "lost_samples": 0, "stack": [], {}}})~", event_name, getpid(), gettid(), tv.tv_sec * 1000 + tv.tv_usec / 1000, contents);
|
||||
builder.append('\n');
|
||||
output.write_entire_buffer(builder.string_view().bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
output.write_until_depleted(builder.string_view().bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
DeprecatedString Emulator::create_instruction_line(FlatPtr address, X86::Instruction const& insn)
|
||||
|
|
|
@ -70,10 +70,10 @@ int main(int argc, char** argv, char** env)
|
|||
profile_strings = make<Vector<NonnullOwnPtr<DeprecatedString>>>();
|
||||
profile_string_id_map = make<Vector<int>>();
|
||||
|
||||
profile_stream->write_entire_buffer(R"({"events":[)"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
profile_stream->write_until_depleted(R"({"events":[)"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
timeval tv {};
|
||||
gettimeofday(&tv, nullptr);
|
||||
profile_stream->write_entire_buffer(
|
||||
profile_stream->write_until_depleted(
|
||||
DeprecatedString::formatted(
|
||||
R"~({{"type": "process_create", "parent_pid": 1, "executable": "{}", "pid": {}, "tid": {}, "timestamp": {}, "lost_samples": 0, "stack": []}})~",
|
||||
executable_path, getpid(), gettid(), tv.tv_sec * 1000 + tv.tv_usec / 1000)
|
||||
|
@ -109,13 +109,13 @@ int main(int argc, char** argv, char** env)
|
|||
int rc = emulator.exec();
|
||||
|
||||
if (dump_profile) {
|
||||
emulator.profile_stream().write_entire_buffer("], \"strings\": ["sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
emulator.profile_stream().write_until_depleted("], \"strings\": ["sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
if (emulator.profiler_strings().size()) {
|
||||
for (size_t i = 0; i < emulator.profiler_strings().size() - 1; ++i)
|
||||
emulator.profile_stream().write_entire_buffer(DeprecatedString::formatted("\"{}\", ", emulator.profiler_strings().at(i)).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
emulator.profile_stream().write_entire_buffer(DeprecatedString::formatted("\"{}\"", emulator.profiler_strings().last()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
emulator.profile_stream().write_until_depleted(DeprecatedString::formatted("\"{}\", ", emulator.profiler_strings().at(i)).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
emulator.profile_stream().write_until_depleted(DeprecatedString::formatted("\"{}\"", emulator.profiler_strings().last()).bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
emulator.profile_stream().write_entire_buffer("]}"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
emulator.profile_stream().write_until_depleted("]}"sv.bytes()).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue