forked from google/centipede
-
Notifications
You must be signed in to change notification settings - Fork 5
/
rusage_profiler.cc
587 lines (523 loc) · 21.9 KB
/
rusage_profiler.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
// Copyright 2022 The Centipede Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "./rusage_profiler.h"
#include <atomic>
#include <cmath>
#include <cstdint>
#include <deque>
#include <filesystem> // NOLINT
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/synchronization/mutex.h"
#include "absl/synchronization/notification.h"
#include "absl/time/time.h"
namespace centipede::perf {
//------------------------------------------------------------------------------
// RUsageProfiler::Snapshot
//------------------------------------------------------------------------------
std::string RUsageProfiler::Snapshot::WhereStr() const {
return absl::StrFormat("%s:%d", location.file, location.line);
}
std::string RUsageProfiler::Snapshot::ShortWhereStr() const {
return absl::StrFormat( //
"%s:%d", std::filesystem::path(location.file).filename(), location.line);
}
std::string RUsageProfiler::Snapshot::WhenStr() const {
return absl::FormatTime("%E4Y-%m-%dT%H:%M:%E2S", time, absl::LocalTimeZone());
}
std::string RUsageProfiler::Snapshot::ShortWhenStr() const {
return absl::FormatTime("%H:%M:%E2S", time, absl::LocalTimeZone());
}
std::string RUsageProfiler::Snapshot::FormattedMetricsStr() const {
std::string s;
absl::StrAppendFormat( //
&s, " [P.%d:S.%d] TIMING | %s |\n", //
profiler_id, id, timing.FormattedStr());
if (delta_timing != RUsageTiming::Zero()) {
absl::StrAppendFormat( //
&s, " [P.%d:S.%d] TIMING Δ | %s |\n", //
profiler_id, id, delta_timing.FormattedStr());
}
absl::StrAppendFormat( //
&s, " [P.%d:S.%d] MEMORY | %s |\n", //
profiler_id, id, memory.FormattedStr());
if (delta_memory != RUsageMemory::Zero()) {
absl::StrAppendFormat( //
&s, " [P.%d:S.%d] MEMORY Δ | %s |\n", //
profiler_id, id, delta_memory.FormattedStr());
}
return s;
}
std::string RUsageProfiler::Snapshot::ShortMetricsStr() const {
std::string s;
absl::StrAppendFormat( //
&s, "TIMING { %s } ", timing.ShortStr());
if (delta_timing != RUsageTiming::Zero()) {
absl::StrAppendFormat( //
&s, "TIMING Δ { %s } ", delta_timing.ShortStr());
}
absl::StrAppendFormat( //
&s, "MEMORY { %s } ", memory.ShortStr());
if (delta_memory != RUsageMemory::Zero()) {
absl::StrAppendFormat( //
&s, "MEMORY Δ { %s } ", delta_memory.ShortStr());
}
return s;
}
const RUsageProfiler::Snapshot& RUsageProfiler::Snapshot::Log() const {
if (id >= 0) {
LOG(INFO).AtLocation(location.file, location.line)
<< "PROFILER [P." << profiler_id << (profiler_desc.empty() ? "" : " ")
<< profiler_desc << "] SNAPSHOT [S." << id << (title.empty() ? "" : " ")
<< title << "]:\n"
<< FormattedMetricsStr();
}
return *this;
}
std::ostream& operator<<(std::ostream& os, const RUsageProfiler::Snapshot& ss) {
return os << ss.title << ": " << ss.ShortWhereStr() << " @ "
<< ss.ShortWhenStr() << ": " << ss.ShortMetricsStr();
}
//------------------------------------------------------------------------------
// TimelapseThread
//
// Starts a new thread that periodically takes a profiling snapshot using the
// passed parent profiler. The thread is auto-started at construction and
// terminated at destruction.
//------------------------------------------------------------------------------
class RUsageProfiler::TimelapseThread {
public:
TimelapseThread( //
RUsageProfiler* parent, //
SourceLocation loc, //
absl::Duration interval, //
bool also_log, //
std::string title)
: parent_{parent},
loc_{loc},
interval_{interval},
also_log_{also_log},
title_{std::move(title)},
stop_loop_{},
loop_thread_{[this]() { RunLoop(); }} {}
~TimelapseThread() { StopLoop(); }
private:
void RunLoop() {
while (!stop_loop_.HasBeenNotified()) {
const auto& s = parent_->TakeSnapshot(loc_, title_);
if (also_log_) s.Log();
absl::SleepFor(interval_);
}
}
void StopLoop() {
stop_loop_.Notify();
loop_thread_.join();
}
RUsageProfiler* parent_;
const SourceLocation loc_;
const absl::Duration interval_;
const bool also_log_;
const std::string title_;
// NOTE: The order is important.
absl::Notification stop_loop_;
std::thread loop_thread_;
};
namespace {
//------------------------------------------------------------------------------
// ProfileReportGenerator
//
// A helper for RUsageProfiler::GenerateReport(): generates individual
// chronological charts of the tracked metrics and streams them to an ostream.
//------------------------------------------------------------------------------
class ProfileReportGenerator {
public:
ProfileReportGenerator( //
const std::deque<RUsageProfiler::Snapshot>& snapshots, //
RUsageProfiler::ReportSink* report_sink)
: snapshots_{snapshots}, report_sink_{report_sink} {
for (const auto& snapshot : snapshots_) {
timing_low_ = RUsageTiming::LowWater( //
timing_low_, snapshot.timing);
timing_high_ = RUsageTiming::HighWater( //
timing_high_, snapshot.timing);
delta_timing_low_ = RUsageTiming::LowWater( //
delta_timing_low_, snapshot.delta_timing);
delta_timing_high_ = RUsageTiming::HighWater( //
delta_timing_high_, snapshot.delta_timing);
memory_low_ = RUsageMemory::LowWater( //
memory_low_, snapshot.memory);
memory_high_ = RUsageMemory::HighWater( //
memory_high_, snapshot.memory);
delta_memory_low_ = RUsageMemory::LowWater( //
delta_memory_low_, snapshot.delta_memory);
delta_memory_high_ = RUsageMemory::HighWater( //
delta_memory_high_, snapshot.delta_memory);
max_where_len_ = //
std::max<int>(max_where_len_, snapshot.ShortWhereStr().length());
max_when_len_ = //
std::max<int>(max_when_len_, snapshot.ShortWhenStr().length());
max_title_len_ = //
std::max<int>(max_title_len_, snapshot.title.length());
}
}
// GenChartImpl() wrappers for the 2 available "snap" metrics.
template <typename MetricT>
void GenChart(const MetricT RUsageTiming::*metric_field) {
GenChartImpl( //
&RUsageProfiler::Snapshot::timing, metric_field, //
timing_low_, timing_high_, /*is_delta=*/false);
}
template <typename MetricT>
void GenChart(const MetricT RUsageMemory::*metric_field) const {
GenChartImpl( //
&RUsageProfiler::Snapshot::memory, metric_field, //
memory_low_, memory_high_, /*is_delta=*/false);
}
// GenChartImpl() wrappers for the 2 available delta metrics.
template <typename MetricT>
void GenDeltaChart(const MetricT RUsageTiming::*metric_field) {
GenChartImpl( //
&RUsageProfiler::Snapshot::delta_timing, metric_field, //
delta_timing_low_, delta_timing_high_, /*is_delta=*/true);
}
template <typename MetricT>
void GenDeltaChart(const MetricT RUsageMemory::*metric_field) const {
GenChartImpl( //
&RUsageProfiler::Snapshot::delta_memory, metric_field, //
delta_memory_low_, delta_memory_high_, /*is_delta=*/true);
}
private:
// The actual chart generator. For better understanding of the code: an
// example of `metric_field` is `&RUsageProfiler::Snapshot::delta_timing`
// which has type `RUsageTiming`; an example of a matching `submetric_field`
// for that is `&RUsageTiming::wall_time`.
template <typename MetricT, typename SubmetricT>
void GenChartImpl( //
const MetricT RUsageProfiler::Snapshot::*metric_field, //
const SubmetricT MetricT::*submetric_field, //
MetricT metric_low_water, //
MetricT metric_high_water, //
bool is_delta) const {
constexpr SubmetricT kZero{}; // works for both ints and absl::Duration
const SubmetricT low_water = metric_low_water.*submetric_field;
const SubmetricT high_water = metric_high_water.*submetric_field;
// SubmetricT can be int64 or Duration: calculate a notch_size that is a
// double or an unrounded Duration, respectively, so the below calculations
// are exact.
const auto notch_size =
(high_water - low_water) / static_cast<double>(kBarNotches);
// The position of the notch indicating 0 (used for delta metrics only).
// clang-format off
const int notch_zero =
notch_size == kZero ? kBarNotches :
low_water >= kZero ? 0 :
std::floor(std::abs(low_water / notch_size));
// clang-format on
CHECK_GE(kBarNotches, notch_zero);
// Print a zero mark only if a delta metric goes negative.
std::string zero_mark = low_water < kZero ? "|" : "";
for (const auto& snapshot : snapshots_) {
const SubmetricT current = snapshot.*metric_field.*submetric_field;
// Generate a bar of #'s as a graphical representation of the current
// value of the metric relative to its full range [low_water, high_water]:
// low_water is no #'s and all -'s, high_water is kBarNotches of #'s.
const std::string metric_str = FormatInOptimalUnits(current, is_delta);
std::string metric_bar;
// clang-format off
const int notches =
notch_size == kZero
? kBarNotches : std::floor((current - low_water) / notch_size);
// clang-format on
CHECK_GE(kBarNotches, notches);
if (!is_delta) {
// Non-delta metrics can't go negative, so the bar always looks like
// this:
// ###############--------------------------
const std::string filled(notches, '#');
const std::string unfilled(kBarNotches - notches, '-');
metric_bar = absl::StrCat(filled, unfilled);
} else {
// Delta metrics can go negative, so this become more complicated. In
// general, print a zero mark '|' at the proper fixed position of every
// bar for this metric's history, and grow the #'s away from the zero
// mark, to the left for negative and to the right for positive deltas:
// +Delta: --------|#######---------
// -Delta: ########|----------------
std::string pad_minus, minus, plus, pad_plus;
// Notches range from 0 (for low_water) to kBarNotches (for high_water).
if (notches < notch_zero) {
pad_minus = std::string(notches, '-');
minus = std::string(notch_zero - notches, '#');
pad_plus = std::string(kBarNotches - notch_zero, '-');
} else if (notches > notch_zero) {
pad_minus = std::string(notch_zero, '-');
plus = std::string(notches - notch_zero, '#');
pad_plus = std::string(kBarNotches - notches, '-');
} else {
pad_minus = std::string(notch_zero, '-');
pad_plus = std::string(kBarNotches - notch_zero, '-');
}
metric_bar = absl::StrCat(pad_minus, minus, zero_mark, plus, pad_plus);
}
// Finally print a full line for the current snapshot/metric, like on of:
// source.cc:123 @ 21:08:27.61 [P.1:S.1 Snap ] 493.78M [############---]
// source.cc:123 @ 21:08:27.61 [P.1:S.2 +Delta] +138.15M [-----|#####----]
// source.cc:123 @ 21:08:27.61 [P.1:S.3 -Delta] -82.69M [--###|---------]
*report_sink_ << absl::StrFormat( //
" %*s @ %*s [P.%d:S.%-2d %*s] %10s [%s]\n", // '*' is custom width
-max_where_len_, snapshot.ShortWhereStr(), // ...passed here.
-max_when_len_, snapshot.ShortWhenStr(), // '-' left-justifies
snapshot.profiler_id, snapshot.id, //
-max_title_len_, snapshot.title, //
metric_str, metric_bar);
}
}
static constexpr int kBarNotches = 50;
const std::deque<RUsageProfiler::Snapshot>& snapshots_;
RUsageProfiler::ReportSink* report_sink_;
RUsageMemory memory_low_ = RUsageMemory::Max();
RUsageMemory memory_high_ = RUsageMemory::Min();
RUsageMemory delta_memory_low_ = RUsageMemory::Max();
RUsageMemory delta_memory_high_ = RUsageMemory::Min();
RUsageTiming timing_low_ = RUsageTiming::Max();
RUsageTiming timing_high_ = RUsageTiming::Min();
RUsageTiming delta_timing_low_ = RUsageTiming::Max();
RUsageTiming delta_timing_high_ = RUsageTiming::Min();
// NOTE: The values are negated, so have to be signed.
int max_where_len_ = 0;
int max_when_len_ = 0;
int max_title_len_ = 0;
};
} // namespace
//------------------------------------------------------------------------------
// RUsageProfiler
//------------------------------------------------------------------------------
std::atomic<int> RUsageProfiler::next_id_;
RUsageProfiler::RUsageProfiler( //
RUsageScope scope, //
MetricsMask metrics, //
RaiiActionsMask raii_actions, //
SourceLocation location, //
std::string description)
: scope_{std::move(scope)},
metrics_{metrics},
raii_actions_{raii_actions},
ctor_loc_{location},
description_{std::move(description)},
id_{next_id_.fetch_add(1, std::memory_order_relaxed)} {
if (metrics_ == kMetricsOff) return;
if (raii_actions_ & kCtorSnapshot) {
TakeSnapshot(ctor_loc_, "INITIAL").Log();
}
}
RUsageProfiler::RUsageProfiler( //
RUsageScope scope, //
MetricsMask metrics, //
absl::Duration timelapse_interval, //
bool also_log_timelapses, //
SourceLocation location, //
std::string description)
: scope_{std::move(scope)},
metrics_{metrics},
raii_actions_{kDtorSnapshot | kDtorReport},
ctor_loc_{location},
description_{std::move(description)},
id_{next_id_.fetch_add(1, std::memory_order_relaxed)} {
if (metrics_ == kMetricsOff) return;
if (timelapse_interval != absl::ZeroDuration() &&
timelapse_interval != absl::InfiniteDuration()) {
StartTimelapse( //
ctor_loc_, timelapse_interval, also_log_timelapses, "Timelapse");
}
}
RUsageProfiler::~RUsageProfiler() {
if (metrics_ == kMetricsOff) return;
// In case the caller hasn't done this.
if (timelapse_thread_) {
StopTimelapse();
}
if (raii_actions_ & kDtorSnapshot) {
// NOTE: Can't pass the real location from callers, so use next best thing.
TakeSnapshot(ctor_loc_, "FINAL").Log();
}
// If requested, also print a final report.
if (raii_actions_ & kDtorReport) {
const std::string title =
absl::StrFormat("PROFILER [P.%d %s] FINAL REPORT:", id_, description_);
PrintReport(ctor_loc_, title);
}
}
const RUsageProfiler::Snapshot& RUsageProfiler::TakeSnapshot( //
SourceLocation loc, std::string title) {
if (metrics_ == kMetricsOff) {
static const Snapshot kEmpty{};
return kEmpty;
}
absl::WriterMutexLock lock{&mutex_};
RUsageTiming snap_timing = RUsageTiming::Zero();
RUsageTiming delta_timing = RUsageTiming::Zero();
RUsageMemory snap_memory = RUsageMemory::Zero();
RUsageMemory delta_memory = RUsageMemory::Zero();
if (metrics_ & kTiming) {
const auto current = RUsageTiming::Snapshot(scope_, timer_);
if (metrics_ & kSnapTiming) {
snap_timing = current;
}
if (metrics_ & kDeltaTiming && !snapshots_.empty()) {
const auto& previous = snapshots_.back().timing;
delta_timing = current - previous;
}
}
if (metrics_ & kMemory) {
const auto current = RUsageMemory::Snapshot(scope_);
if (metrics_ & kSnapMemory) {
snap_memory = current;
}
if (metrics_ & kDeltaMemory && !snapshots_.empty()) {
const auto& previous = snapshots_.back().memory;
delta_memory = current - previous;
}
}
Snapshot snapshot{
.id = static_cast<int64_t>(snapshots_.size()),
.title = std::move(title),
.location = loc,
.time = absl::Now(),
.profiler_id = id_,
.profiler_desc = description_,
.timing = snap_timing,
.delta_timing = delta_timing,
.memory = snap_memory,
.delta_memory = delta_memory,
};
return snapshots_.emplace_back(std::move(snapshot));
}
void RUsageProfiler::StartTimelapse( //
SourceLocation loc, //
absl::Duration interval, //
bool also_log, //
std::string title) {
absl::WriterMutexLock lock{&mutex_};
CHECK(!timelapse_thread_) << "StopTimelapse() wasn't called";
timelapse_thread_ = std::make_unique<TimelapseThread>(
this, loc, interval, also_log, std::move(title));
}
void RUsageProfiler::StopTimelapse() {
absl::WriterMutexLock lock{&mutex_};
CHECK(timelapse_thread_) << "StartTimelapse() wasn't called";
timelapse_thread_.reset(); // ~TimelapseThread() runs
}
void RUsageProfiler::PrintReport( //
SourceLocation loc, const std::string& title) {
if (metrics_ == kMetricsOff) return;
// Logs streamed-in text to LOG(INFO), while dropping the usual log prefix
// (date/time/thread/source). LOG()'s limit on the size of a single message
// applies to one streamed text fragment only (if needed, this can be reduced
// even further to a single line of text in a fragment): this is the main
// purpose of this class, as profiling reports can get very long. especially
// with automatic timelapse snapshotting.
class ReportLogger final : public ReportSink {
public:
~ReportLogger() override {
if (!buffer_.empty()) {
LOG(INFO).NoPrefix() << buffer_;
}
}
ReportLogger& operator<<(const std::string& fragment) override {
const auto last_newline = fragment.rfind('\n');
if (last_newline == std::string::npos) {
// Accumulate no-'\n' fragments: LOG() always wraps around.
buffer_ += fragment;
} else {
// Now we can log, but save the last bit of text
LOG(INFO).NoPrefix() << buffer_ << fragment.substr(0, last_newline);
buffer_ = fragment.substr(last_newline + 1);
}
return *this;
}
private:
std::string buffer_;
};
LOG(INFO).AtLocation(loc.file, loc.line) << title << "\n";
ReportLogger report_logger;
GenerateReport(&report_logger);
}
void RUsageProfiler::GenerateReport(ReportSink* report_sink) const {
absl::ReaderMutexLock lock{&mutex_};
// Prevent interleaved reports from multiple concurrent RUsageProfilers.
ABSL_CONST_INIT static absl::Mutex report_generation_mutex_{absl::kConstInit};
absl::WriterMutexLock logging_lock{&report_generation_mutex_};
ProfileReportGenerator gen{snapshots_, report_sink};
const std::string desc = absl::StrFormat("[P.%d %s]", id_, description_);
*report_sink << "SCOPE: " << scope_ << "\n";
if (metrics_ & kSnapTiming) {
*report_sink << "\n=== TIMING " << desc << " ===\n";
*report_sink << "\nWALL TIME " << desc << ":\n";
gen.GenChart(&RUsageTiming::wall_time);
*report_sink << "\nUSER TIME " << desc << ":\n";
gen.GenChart(&RUsageTiming::user_time);
*report_sink << "\nSYSTEM TIME " << desc << ":\n";
gen.GenChart(&RUsageTiming::sys_time);
*report_sink << "\nCPU UTILIZATION " << desc << ":\n";
gen.GenChart(&RUsageTiming::cpu_utilization);
*report_sink << "\nAVERAGE CORES " << desc << ":\n";
gen.GenChart(&RUsageTiming::cpu_hyper_cores);
}
if (metrics_ & kDeltaTiming) {
*report_sink << "\n=== Δ TIMING " << desc << " ===\n";
*report_sink << "\nΔ WALL TIME " << desc << ":\n";
gen.GenDeltaChart(&RUsageTiming::wall_time);
*report_sink << "\nΔ USER TIME " << desc << ":\n";
gen.GenDeltaChart(&RUsageTiming::user_time);
*report_sink << "\nΔ SYSTEM TIME " << desc << ":\n";
gen.GenDeltaChart(&RUsageTiming::sys_time);
*report_sink << "\nΔ CPU UTILIZATION " << desc << ":\n";
gen.GenDeltaChart(&RUsageTiming::cpu_utilization);
*report_sink << "\nΔ AVERAGE CORES " << desc << ":\n";
gen.GenDeltaChart(&RUsageTiming::cpu_hyper_cores);
}
if (metrics_ & kSnapMemory) {
*report_sink << "\n=== MEMORY USAGE " << desc << " ===\n";
*report_sink << "\nRESIDENT SET SIZE " << desc << ":\n";
gen.GenChart(&RUsageMemory::mem_rss);
*report_sink << "\nVIRTUAL SIZE " << desc << ":\n";
gen.GenChart(&RUsageMemory::mem_vsize);
*report_sink << "\nVIRTUAL PEAK " << desc << ":\n";
gen.GenChart(&RUsageMemory::mem_vpeak);
*report_sink << "\nDATA SEGMENT " << desc << ":\n";
gen.GenChart(&RUsageMemory::mem_data);
*report_sink << "\nSHARED MEMORY " << desc << ":\n";
gen.GenChart(&RUsageMemory::mem_shared);
}
if (metrics_ & kDeltaMemory) {
*report_sink << "\n=== Δ MEMORY USAGE " << desc << " ===\n";
*report_sink << "\nΔ RESIDENT SET SIZE " << desc << ":\n";
gen.GenDeltaChart(&RUsageMemory::mem_rss);
*report_sink << "\nΔ VIRTUAL SIZE " << desc << ":\n";
gen.GenDeltaChart(&RUsageMemory::mem_vsize);
*report_sink << "\nΔ VIRTUAL PEAK " << desc << ":\n";
gen.GenDeltaChart(&RUsageMemory::mem_vpeak);
*report_sink << "\nΔ DATA SEGMENT " << desc << ":\n";
gen.GenDeltaChart(&RUsageMemory::mem_data);
*report_sink << "\nΔ SHARED MEMORY " << desc << ":\n";
gen.GenDeltaChart(&RUsageMemory::mem_shared);
}
}
} // namespace centipede::perf