PAPI  5.7.0.0
print_header.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int papi_print_header (char *prompt, const PAPI_hw_info_t **hwinfo)
 

Function Documentation

◆ papi_print_header()

int papi_print_header ( char *  prompt,
const PAPI_hw_info_t **  hwinfo 
)

Definition at line 12 of file print_header.c.

13 {
14  int cnt, mpx;
15  struct utsname uname_info;
17 
18  if ( ( *hwinfo = PAPI_get_hardware_info( ) ) == NULL ) {
19  return PAPI_ESYS;
20  }
21 
23 
24  uname(&uname_info);
25 
26  printf( "%s", prompt );
27  printf
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,
38  ( *hwinfo )->vendor,
39  ( *hwinfo )->vendor );
40  printf( "Model string and code : %s (%d, 0x%x)\n",
41  ( *hwinfo )->model_string,
42  ( *hwinfo )->model,
43  ( *hwinfo )->model );
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 );
54  }
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 );
58 
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?
68  "yes":"no");
69  if ( (*hwinfo)->virtualized) {
70  printf( "VM Vendor : %s\n", (*hwinfo)->virtual_vendor_string);
71  }
72  cnt = PAPI_get_opt( PAPI_MAX_HWCTRS, NULL );
73  mpx = PAPI_get_opt( PAPI_MAX_MPX_CTRS, NULL );
74  if ( cnt >= 0 ) {
75  printf( "Number Hardware Counters : %d\n",cnt );
76  } else {
77  printf( "Number Hardware Counters : PAPI error %d: %s\n", cnt, PAPI_strerror(cnt));
78  }
79  if ( mpx >= 0 ) {
80  printf( "Max Multiplex Counters : %d\n", mpx );
81  } else {
82  printf( "Max Multiplex Counters : PAPI error %d: %s\n", mpx, PAPI_strerror(mpx));
83  }
84  printf("Fast counter read (rdpmc): %s\n",
85  options.cmp_info->fast_counter_read?"yes":"no");
86  printf( "--------------------------------------------------------------------------------\n" );
87  printf( "\n" );
88  return PAPI_OK;
89 }
#define PAPI_OK
Definition: fpapi.h:105
#define PAPI_COMPONENTINFO
Definition: fpapi.h:65
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:849
#define PAPI_MAX_MPX_CTRS
Definition: fpapi.h:54
#define PAPI_VERSION
Definition: fpapi.h:15
#define PAPI_ESYS
Definition: fpapi.h:108
#define PAPI_VERSION_MAJOR(x)
Definition: papi.h:217
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4143
#define PAPI_VERSION_REVISION(x)
Definition: papi.h:219
#define PAPI_VERSION_MINOR(x)
Definition: papi.h:218
int cnt[ctr_pcp_ntv_code_to_info+1]
Definition: linux-pcp.c:215
char * PAPI_strerror(int errorCode)
Definition: papi.c:4603
#define PAPI_MAX_HWCTRS
Definition: fpapi.h:58
static options_t options
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6185
#define PAPI_VERSION_INCREMENT(x)
Definition: papi.h:220
Here is the call graph for this function: