beostat_get_cpuinfo_x86

Name

beostat_get_cpuinfo_x86 -- get the time of the last update for node

Synopsis

#include <sys/beostat.h>

int beostat_get_cpuinfo_x86 (int node, struct cpuinfo_x86*cpuinfo);

Arguments

node

The node to query

cpuinfo

A pointer to a struct beostat_cpuinfo_x86, which is defined as follows (names in comments are entries from cpuinfo_x86 in asm/processor.h):

struct beostat_cpuinfo_x86
{
  int processor;            /* [which cpu (SMP)] */
  char vendor_id[16];       /* x86_vendor_id */
  int family;               /* x86 */
  int model;                /* x86 model */
  char name[64];            /* x86 model ID */
  int stepping;             /* x86 mask */
  float MHz;                /* derived from bogomips */
  int cache_size_KB;        /* x86_cache_size */
  boolean fdiv_bug;         /* same */
  boolean hlt_bug;          /* ~hlt_works_ok */
  boolean sep_bug;          /* [Derived] */
  boolean f00f_bug;         /* same */
  boolean coma_bug;         /* same */
  boolean fpu;              /* hard_math */
  boolean fpu_exception;    /* based on exception 16 */
  int cpuid_level;          /* same */
  boolean wp;               /* wp_works_ok */
  float bogomips;           /* loops_per_sec derived */
};

Description

beostat_get_cpuinfo_x86 will set a structure describing information about the CPU on the host node. The information in this structure parallels the output seen in /proc/cpuinfo. Note that since this information is architecture specific, this function has "x86" in its name.

Examples

 struct beostat_cpuinfo_x86 cpuinfo;
 beostat_get_cpuinfo_x86 (3, &cpuinfo);
 printf ("Node 3 has a %f MHz processor\n", cpuinfo.MHz);

Return Value

Return 0 on success. If an error occurs, it will return -1.

Errors

This function relies on the Beostat subsystem, which consists of the proc filesystem on the remote node, the sendstats daemon on the remote node, the recvstats daemon on the master node, and two shared memory files in the directory /var/shm. If any part of the system breaks down, this function could fail.