| fi_hook(7) | #VERSION# | fi_hook(7) |
fi_hook - The Hook Fabric Provider Utility
The hooking provider is a utility function that can intercept calls to any provider. The hook provider is always available, but has zero impact on calls unless enabled. It is useful for providing performance data on selected calls or debugging information.
Hooking support is enabled through the FI_HOOK environment variable. To enable hooking, FI_HOOK must be set to the name of one or more of the available hooking providers. When multiple hooks are specified, the names must be separated by a semi-colon. To obtain a list of hooking providers available on the current system, one can use the fi_info utility with the `–env' command line option. Hooking providers are usually identified by `hook' appearing in the provider name.
Known hooking providers include the following:
The hook provider allows capturing inline performance data by accessing the CPU Performance Management Unit (PMU). PMU data is only available on Linux systems. Additionally, access to PMU data may be restricted to privileged (super-user) applications.
Performance data is captured for critical data transfer calls: fi_msg, fi_rma, fi_tagged, fi_cq, and fi_cntr. Captured data is displayed as logged data using the FI_LOG_LEVEL trace level. Performance data is logged when the associated fabric is destroyed.
The environment variable FI_PERF_CNTR is used to identify which performance counter is tracked. The following counters are available:
This hook provider allows tracing each API call and its runtime parameters. It is enabled by setting FI_HOOK to “trace”.
The trace data include the provider’s name, API function, and input/output parameter values. The APIs enabled for tracing include the following:
The trace data is logged after API is invoked using the FI_LOG_LEVEL trace level
This hook provider allows capturing data operation calls and the amount of data being operated. It is enabled by setting FI_HOOK to “profile”.
The provider counts the API invoked and accumulates the data size each API call operates. For data and cq operations, instead of accumulating all data together, it breaks down the data size into size buckets and accumulates the amount of data in the corresponding bucket based on the size of the data operated. For mr registration operations, it breaks down memory registered per HMEM iface. At the end when the associated fabric is destroyed, the provider generates a profile report.
The report contains the usage of data operation APIs, the amount of data received in each CQ format and the amount of memory registered for rma operations if any exist. In addition, the data operation APIs are grouped into 4 groups based on the nature of the operations, message send (fi_sendXXX, fi_tsendXXX), message receive (fi_recvXXX, fi_trecvXXX), rma read (fi_readXXX) and rma write (fi_writeXXX) to present the percentage usage of each API.
The report is in a table format which has APIs invoked in rows, and the columns contain the following fields:
The report is logged using the FI_LOG_LEVEL trace level.
Hooking functionality is not available for providers built using the FI_FABRIC_DIRECT feature. That is, directly linking to a provider prevents hooking.
The hooking provider does not work with triggered operations. Application that use FI_TRIGGER operations that attempt to hook calls will likely crash.
OpenFabrics.
| 2024-12-10 | Libfabric Programmer’s Manual |