class Recorder

Defined at line 34 of file ../../src/performance/memory/sampler/instrumentation/recorder.h

Allocation recorder. This class is designed to be initialized in

static storage, to be thread safe, and to be suitable for use

during an allocation or a deallocation (by being safe to call

from within the scudo allocation hooks).

It establishes a FIDL connection to a sampling profiler on

startup, reports allocations and deallocations, and relevant

information to support symbolization of the collected profiles.

Public Members

static const uint64_t kDefaultSamplingIntervalBytes

Public Methods

void Recorder (const Recorder & )

Defined at line 36 of file ../../src/performance/memory/sampler/instrumentation/recorder.h

void Recorder (Recorder && )

Defined at line 36 of file ../../src/performance/memory/sampler/instrumentation/recorder.h

Recorder & operator= (const Recorder & )

Defined at line 36 of file ../../src/performance/memory/sampler/instrumentation/recorder.h

Recorder & operator= (Recorder && )

Defined at line 36 of file ../../src/performance/memory/sampler/instrumentation/recorder.h

uint64_t GetSamplingIntervalBytes ()

Returns the currently configured mean interval in bytes between two sampled

allocations.

Defined at line 66 of file ../../src/performance/memory/sampler/instrumentation/recorder.h

bool is_disabled ()

Returns true if the recorder has disconnected from the profiler.

Defined at line 75 of file ../../src/performance/memory/sampler/instrumentation/recorder.h

Recorder * Get ()

Returns a reference to the singleton object, initializing (and

blocking) it if necessary.

Defined at line 90 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

Recorder * GetIfReady ()

Returns a pointer to the singleton object if it is initialized;

returns nullptr otherwise.

Defined at line 96 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

void MaybeRecordAllocation (void * address, size_t size)

Decides whether to discard or sample this allocation, and acts

appropriately.

Defined at line 126 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

void MaybeForgetAllocation (void * address)

Decides whether to discard or sample this deallocation, and acts

appropriately.

Defined at line 250 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

void SetModulesInfo ()

Collects the module layout of the current process and

communicates it to the profiler.

Defined at line 391 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

Recorder CreateRecorderForTesting (fidl::SyncClient<fuchsia_memory_sampler::Sampler> client, std::function<PoissonSampler &()> get_poisson_sampler, bool use_socket)

Convenience factory method for use in tests. This eschews the

singleton interface, and supports providing a custom FIDL

client. It does not perform any of the initialisations handled by

the singleton interface. This should not be used outside of tests.

Defined at line 446 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

void ApplyBackpressure ()

When the transport channel that is used to communicate between this process

and the sampling profiler supports reporting congestion, monitor the

current congestion rate and adjust the sampling rate accordingly.

Defined at line 352 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

void Disconnect ()

Disconnects the recorder from the profiler and disables all subsequent recording.

Defined at line 98 of file ../../src/performance/memory/sampler/instrumentation/recorder.cc

Friends

class RecorderTestPeer