crash.types.node module

The crash.types.node module offers helpers to work with NUMA nodes.

class crash.types.node.Node(obj: gdb.Value)[source]

Bases: object

A wrapper around the Linux kernel ‘struct node’ structure

for_each_zone() → Iterable[crash.types.zone.Zone][source]

Iterate over each zone contained in this NUMA node

Yields:Zone – The next Zone in this Node
classmethod from_nid(nid: int) → crash.types.node.Node[source]

Obtain a Node using the NUMA Node ID (nid)

Parameters:nid – The NUMA Node ID
Returns:the Node wrapper for the struct node for this NID
Return type:Node
class crash.types.node.NodeStates[source]

Bases: object

A state holder for Node states.

nids_online

A list of the online node IDs.

Type:list of int
nids_possible

A list of the possible node IDs.

Type:list of int
for_each_nid() → Iterable[int][source]

Iterate over each NUMA Node ID

Yields:int – The next NUMA Node ID
for_each_online_nid() → Iterable[int][source]

Iterate over each online NUMA Node ID

Yields:int – The next NUMA Node ID
nids_online = []
nids_possible = []
classmethod setup_node_states(node_states_sym: gdb.Symbol) → None[source]

Detect names of node states and which nodes are possible and online.

Meant to be used as a SymbolCallback.

Parameters:node_states_sym – The node_states symbol.
crash.types.node.for_each_nid() → Iterable[int][source]

Iterate over each NUMA Node ID

Yields:int – The next NUMA Node ID
crash.types.node.for_each_node() → Iterable[crash.types.node.Node][source]

Iterate over each NUMA Node

Yields:int – The next NUMA Node
crash.types.node.for_each_online_nid() → Iterable[int][source]

Iterate over each online NUMA Node ID

Yields:int – The next NUMA Node ID
crash.types.node.for_each_online_node() → Iterable[crash.types.node.Node][source]

Iterate over each Online NUMA Node

Yields:int – The next NUMA Node
crash.types.node.for_each_populated_zone() → Iterable[crash.types.zone.Zone][source]
crash.types.node.for_each_zone() → Iterable[crash.types.zone.Zone][source]
crash.types.node.numa_node_id(cpu: int) → int[source]

Return the NUMA node ID for a given CPU

Parameters:cpu – The CPU number to obtain the NUMA node ID
Returns:The NUMA node ID for the specified CPU.
Return type:int