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>,
    pub symbol_table: Option<Arc<SymbolTable>>,
}
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 AVMA of the first segment, i.e. of the mapping created by the first ELF LOAD command.

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”. This is used for macOS system libraries in the dyld shared cache, in order to avoid loading the wrong cache files, as a performance optimization. In the past, this was also used to find the correct sub-binary in a mach-O fat binary. But we now use the debug_id for that purpose.

§symbol_table: Option<Arc<SymbolTable>>

An optional symbol table, for “pre-symbolicating” stack frames.

Usually, symbolication is something that should happen asynchronously, because it can be very slow, so the regular way to use the profiler is to store only frame addresses and no symbols in the profile JSON, and perform symbolication only once the profile is loaded in the Firefox Profiler UI.

However, sometimes symbols are only available during recording and are not easily accessible afterwards. One such example the symbol table of the Linux kernel: Users with root privileges can access the symbol table of the currently-running kernel via /proc/kallsyms, but we don’t want to have to run the local symbol server with root privileges. So it’s easier to resolve kernel symbols when generating the profile JSON.

This way of symbolicating does not support file names, line numbers, or inline frames. It is intended for relatively “small” symbol tables for which an address lookup is fast.

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 ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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
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.