tracetools_analysis.processor.memory_usage module

Module for memory usage events processing.

class tracetools_analysis.processor.memory_usage.KernelMemoryUsageHandler(**kwargs)

Bases: MemoryUsageHandler

Handler that extracts userspace memory usage data.

It uses the following events:
  • kmem_mm_page_alloc

  • kmem_mm_page_free

Implementation inspired by Trace Compass’ implementation: https://git.eclipse.org/c/tracecompass/org.eclipse.tracecompass.git/tree/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/kernelmemoryusage/KernelMemoryStateProvider.java#n84

PAGE_SIZE = 4096
static required_events() Set[str]

Get the set of events required by this EventHandler.

Without these events, the EventHandler would be invalid/useless. Inheriting classes can decide not to declare that they require specific events.

class tracetools_analysis.processor.memory_usage.MemoryUsageHandler(**kwargs)

Bases: EventHandler

Generic handler for memory usage.

property data: MemoryUsageDataModel

Get the data model.

class tracetools_analysis.processor.memory_usage.UserspaceMemoryUsageHandler(**kwargs)

Bases: MemoryUsageHandler

Handler that extracts userspace memory usage data.

It uses the following events:
  • lttng_ust_libc:malloc

  • lttng_ust_libc:calloc

  • lttng_ust_libc:realloc

  • lttng_ust_libc:free

  • lttng_ust_libc:memalign

  • lttng_ust_libc:posix_memalign

The above events are generated when LD_PRELOAD-ing liblttng-ust-libc-wrapper.so, see: https://lttng.org/docs/v2.10/#doc-liblttng-ust-libc-pthread-wrapper

Implementation inspired by Trace Compass’ implementation: https://git.eclipse.org/c/tracecompass/org.eclipse.tracecompass.git/tree/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/memory/UstMemoryStateProvider.java#n161

static required_events() Set[str]

Get the set of events required by this EventHandler.

Without these events, the EventHandler would be invalid/useless. Inheriting classes can decide not to declare that they require specific events.