perfstat_hfistat_window Subroutine

Purpose

Retrieves Host Fabric Interface (HFI) window-based performance statistics.

Library

Perfstat Library (libperfstat.a)

Syntax

#include <libperfstat.h>
int perfstat_hfistat_window (name,userbuff,sizeof_userbuff,desired_number)
perfstat_id_window_t* name;
perfstat_hfistat_window_t* userbuff;
int sizeof_userbuff;
int desired_number;

Description

The perfstat_hfistat_window subroutine returns window-based performance statistics of a Host Fabric Interface in a perfstat_hfistat_window_t structure.

To get the maximum number of windows of a HFI in the system, specify the HFI name in the name parameter. The userbuff parameter must be specified as NULL, the sizeof_userbuff must be equal to the sizeof (perfstat_hfistat_window_t) and the value of the desired_number parameter must be set to zero.

To get one or more sets of HFI window-based performance metrics, specify the Host Fabric Interface name in the name parameter and the first desired window number in the windowid parameter. Specify the number of Host Fabric Interface windows for which performance statistics are to be collected in the desired_number parameter. The userbuff parameter must be allocated.

Note: A perfstat_config() query verifies if the HFI statistics collection is available or not (perfstat_config(PERFSTAT_QUERY|PERFSTAT_HFISTATS, NULL);).

Parameters

Item Description
name–>name Specifies the Host Fabric Interface. For example: hfi0, hfi1, and so forth.
name->windowid Specifies the first desired window ID. For example: 0, 1, 2, 3, and so forth.
userbuff Points to the memory area that is to be filled with the perfstat_hfistat_window_t structure.
sizeof_userbuff Specifies the size of the perfstat_hfistat_window_t structure.
desired_number Specifies the number of structures to return.

Return Values

Unless the subroutine is used to retrieve the number of available structures, the number of structures filled is returned upon successful completion. If unsuccessful, a value of -1 is returned and the errno global variable is set.

Error Codes

The subroutine is unsuccessful if the following are true:

Item Description
EINVAL One of the parameters is not valid.
ENOENT The HFI statistics collection is not currently available.

Files

The libperfstat.h file defines standard macros, data types, and subroutines.