Previous: Processor Set Policy, Up: Processor Set Interface


9.1.8 Processor Set Info

— Function: kern_return_t processor_set_info (processor_set_name_t set_name, int flavor, host_t *host, processor_set_info_t processor_set_info, mach_msg_type_number_t *processor_set_info_count)

The function processor_set_info returns the selected information array for a processor set, as specified by flavor.

host is set to the host on which the processor set resides. This is the non-privileged host port.

processor_set_info is an array of integers that is supplied by the caller and returned filled with specified information. processor_set_info_count is supplied as the maximum number of integers in processor_set_info. On return, it contains the actual number of integers in processor_set_info. The maximum number of integers returned by any flavor is PROCESSOR_SET_INFO_MAX.

The type of information returned is defined by flavor, which can be one of the following:

PROCESSOR_SET_BASIC_INFO
The function returns basic information about the processor set, as defined by processor_set_basic_info_t. This includes the number of tasks and threads assigned to the processor set. The number of integers returned is PROCESSOR_SET_BASIC_INFO_COUNT.
PROCESSOR_SET_SCHED_INFO
The function returns information about the scheduling policy for the processor set as defined by processor_set_sched_info_t. The number of integers returned is PROCESSOR_SET_SCHED_INFO_COUNT.

Some machines may define additional (machine-dependent) flavors.

The function returns KERN_SUCCESS if the call succeeded and KERN_INVALID_ARGUMENT if processor_set is not a processor set or flavor is not recognized. The function returns MIG_ARRAY_TOO_LARGE if the returned info array is too large for processor_set_info. In this case, processor_set_info is filled as much as possible and processor_set_info_count is set to the number of elements that would have been returned if there were enough room.

— Data type: struct processor_set_basic_info

This structure is returned in processor_set_info by the processor_set_info function and provides basic information about the processor set. You can cast a variable of type processor_set_info_t to a pointer of this type if you provided it as the processor_set_info parameter for the PROCESSOR_SET_BASIC_INFO flavor of processor_set_info. It has the following members:

int processor_count
number of processors
int task_count
number of tasks
int thread_count
number of threads
int load_average
scaled load average
int mach_factor
scaled mach factor

— Data type: processor_set_basic_info_t

This is a pointer to a struct processor_set_basic_info.

— Data type: struct processor_set_sched_info

This structure is returned in processor_set_info by the processor_set_info function and provides schedule information about the processor set. You can cast a variable of type processor_set_info_t to a pointer of this type if you provided it as the processor_set_info parameter for the PROCESSOR_SET_SCHED_INFO flavor of processor_set_info. It has the following members:

int policies
allowed policies
int max_priority
max priority for new threads

— Data type: processor_set_sched_info_t

This is a pointer to a struct processor_set_sched_info.