pub struct LibraryInfo {
    pub base_avma: u64,
    pub avma_range: Range<u64>,
    pub name: String,
    pub debug_name: String,
    pub path: String,
    pub debug_path: String,
    pub debug_id: DebugId,
    pub code_id: Option<CodeId>,
    pub arch: Option<String>,
}
Expand description

A library (“binary” / “module” / “DSO”) which is loaded into a process. This can be the main executable file or a dynamic library, or any other mapping of executable memory.

Library information makes after-the-fact symbolication possible: The profile JSON contains raw code addresses, and then the symbols for these addresses get resolved later.

Fields

base_avma: u64

The “actual virtual memory address”, in the address space of the process, where this library’s base address is located. The base address is the address which “relative addresses” are relative to.

For ELF binaries, the base address is equal to the “image bias”, i.e. the offset that is added to the virtual memory addresses as stated in the library file (SVMAs, “stated virtual memory addresses”). In other words, the base AVMA corresponds to SVMA zero.

For mach-O binaries, the base address is the start of the __TEXT segment.

For Windows binaries, the base address is the image load address.

avma_range: Range<u64>

The address range that this mapping occupies in the virtual memory address space of the process. AVMA = “actual virtual memory address”

name: String

The name of this library that should be displayed in the profiler. Usually this is the filename of the binary, but it could also be any other name, such as “[kernel.kallsyms]” or “[vdso]”.

debug_name: String

The debug name of this library which should be used when looking up symbols. On Windows this is the filename of the PDB file, on other platforms it’s usually the same as the filename of the binary.

path: String

The absolute path to the binary file.

debug_path: String

The absolute path to the debug file. On Linux and macOS this is the same as the path to the binary file. On Windows this is the path to the PDB file.

debug_id: DebugId

The debug ID of the library. This lets symbolication confirm that it’s getting symbols for the right file, and it can sometimes allow obtaining a symbol file from a symbol server.

code_id: Option<CodeId>

The code ID of the library. This lets symbolication confirm that it’s getting symbols for the right file, and it can sometimes allow obtaining a symbol file from a symbol server.

arch: Option<String>

An optional string with the CPU arch of this library, for example “x86_64”, “arm64”, or “arm64e”. Historically, this was used on macOS to find the correct sub-binary in a fat binary. But we now use the debug_id for that purpose.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.