2#include <sys/utsname.h>
15 struct utsname uname_info;
26 printf(
"%s", prompt );
28 (
"--------------------------------------------------------------------------------\n" );
29 printf(
"PAPI version : %d.%d.%d.%d\n",
34 printf(
"Operating system : %s %s\n",
35 uname_info.sysname, uname_info.release);
36 printf(
"Vendor string and code : %s (%d, 0x%x)\n",
37 ( *hwinfo )->vendor_string,
39 ( *hwinfo )->vendor );
40 printf(
"Model string and code : %s (%d, 0x%x)\n",
41 ( *hwinfo )->model_string,
44 printf(
"CPU revision : %f\n", ( *hwinfo )->revision );
45 if ( ( *hwinfo )->cpuid_family > 0 ) {
46 printf(
"CPUID : Family/Model/Stepping %d/%d/%d, "
47 "0x%02x/0x%02x/0x%02x\n",
48 ( *hwinfo )->cpuid_family,
49 ( *hwinfo )->cpuid_model,
50 ( *hwinfo )->cpuid_stepping,
51 ( *hwinfo )->cpuid_family,
52 ( *hwinfo )->cpuid_model,
53 ( *hwinfo )->cpuid_stepping );
55 printf(
"CPU Max MHz : %d\n", ( *hwinfo )->cpu_max_mhz );
56 printf(
"CPU Min MHz : %d\n", ( *hwinfo )->cpu_min_mhz );
57 printf(
"Total cores : %d\n", ( *hwinfo )->totalcpus );
59 if ( ( *hwinfo )->threads > 0 )
60 printf(
"SMT threads per core : %d\n", ( *hwinfo )->threads );
61 if ( ( *hwinfo )->cores > 0 )
62 printf(
"Cores per socket : %d\n", ( *hwinfo )->cores );
63 if ( ( *hwinfo )->sockets > 0 )
64 printf(
"Sockets : %d\n", ( *hwinfo )->sockets );
65 printf(
"Cores per NUMA region : %d\n", ( *hwinfo )->ncpu );
66 printf(
"NUMA regions : %d\n", ( *hwinfo )->nnodes );
67 printf(
"Running in a VM : %s\n", ( *hwinfo )->virtualized?
69 if ( (*hwinfo)->virtualized) {
70 printf(
"VM Vendor : %s\n", (*hwinfo)->virtual_vendor_string);
75 printf(
"Number Hardware Counters : %d\n",cnt );
77 printf(
"Number Hardware Counters : PAPI error %d: %s\n", cnt,
PAPI_strerror(cnt));
80 printf(
"Max Multiplex Counters : %d\n", mpx );
82 printf(
"Max Multiplex Counters : PAPI error %d: %s\n", mpx,
PAPI_strerror(mpx));
84 printf(
"Fast counter read (rdpmc): %s\n",
85 options.cmp_info->fast_counter_read?
"yes":
"no");
86 printf(
"--------------------------------------------------------------------------------\n" );
get information about the system hardware
Get PAPI library or event set options.
Returns a string describing the PAPI error code.
#define PAPI_MAX_MPX_CTRS
#define PAPI_COMPONENTINFO
Return codes and api definitions.
#define PAPI_VERSION_REVISION(x)
#define PAPI_VERSION_MAJOR(x)
#define PAPI_VERSION_INCREMENT(x)
#define PAPI_VERSION_MINOR(x)
A pointer to the following is passed to PAPI_set/get_opt()