System info functions

Functions that provide information about the system or the enclosing profiler.

int allinea_get_logical_core_count(void)

Counts the number of logical cores on this system.

This count includes effective cores reported by hyperthreading.

Returns

The number of CPU cores known to the kernel (including those added by hyperthreading). -1 if this information is not available.

See also allinea_get_physical_core_count

int allinea_get_physical_core_count(void)

Counts the number of physical cores on this system.

This count does not include the effective cores that are reported when using hyperthreading.

Returns

The number of CPU cores known to the kernel (excluding those added by hyperthreading). -1 if this information is not available.

See also allinea_get_logical_core_count

int allinea_read_config_file (const char * variable, const char * metricId, char * value, int length)

Reads the configuration file to find the value of a variable.

int allinea_read_config_file  ( const char *  variable,
                                const char *  metricId,
                                char *        value,
                                int           length
                              )

This function returns the value of a configuration variable, or an error. If the file is empty, the variable is not found or the variable is improperly declared. This function must only be called from outside of the Linaro Forge sampler (such as in allinea_plugin_initialise and similar functions) because it is not async signal safe.

Parameters

Direction

Parameter

Description

[in]

variable

The name of the configuration variable.

[in]

metricId

The ID of the metric with the configuration file environment variable.

[out]

value

The value of the configuration variable.

[in]

length

The length of value.

Returns

0 if there are no errors. -1 if the file name is too long. -2 if the file does not exist. -3 if the variable is not found or is improperly declared.