PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-common.c
Go to the documentation of this file.
1 /*
2 * File: linux-common.c
3 */
4 
5 #include <unistd.h>
6 #include <string.h>
7 #include <stdlib.h>
8 #include <ctype.h>
9 #include <err.h>
10 #include <stdarg.h>
11 #include <stdio.h>
12 #include <errno.h>
13 #include <syscall.h>
14 #include <sys/utsname.h>
15 #include <sys/time.h>
16 
17 #include "papi.h"
18 #include "papi_internal.h"
19 #include "papi_vector.h"
20 
21 #include "linux-memory.h"
22 #include "linux-common.h"
23 #include "linux-timer.h"
24 
25 #include "x86_cpuid_info.h"
26 
28 
29 /* The locks used by Linux */
30 
31 #if defined(USE_PTHREAD_MUTEXES)
32 pthread_mutex_t _papi_hwd_lock_data[PAPI_MAX_LOCK];
33 #else
34 volatile unsigned int _papi_hwd_lock_data[PAPI_MAX_LOCK];
35 #endif
36 
37 
38 static int _linux_init_locks(void) {
39 
40  int i;
41 
42  for ( i = 0; i < PAPI_MAX_LOCK; i++ ) {
43 #if defined(USE_PTHREAD_MUTEXES)
44  pthread_mutex_init(&_papi_hwd_lock_data[i],NULL);
45 #else
47 #endif
48  }
49 
50  return PAPI_OK;
51 }
52 
53 
54 int
55 _linux_detect_hypervisor(char *virtual_vendor_name) {
56 
57  int retval=0;
58 
59 #if defined(__i386__)||defined(__x86_64__)
60  retval=_x86_detect_hypervisor(virtual_vendor_name);
61 #else
62  (void) virtual_vendor_name;
63 #endif
64 
65  return retval;
66 }
67 
68 
69 #define _PATH_SYS_SYSTEM "/sys/devices/system"
70 #define _PATH_SYS_CPU0 _PATH_SYS_SYSTEM "/cpu/cpu0"
71 
72 static char pathbuf[PATH_MAX] = "/";
73 
74 
75 static char *
76 search_cpu_info( FILE * f, char *search_str, char *line )
77 {
78  /* This function courtesy of Rudolph Berrendorf! */
79  /* See the home page for the German version of PAPI. */
80  char *s;
81 
82  while ( fgets( line, 256, f ) != NULL ) {
83  if ( strstr( line, search_str ) != NULL ) {
84  /* ignore all characters in line up to : */
85  for ( s = line; *s && ( *s != ':' ); ++s );
86  if ( *s )
87  return s;
88  }
89  }
90  return NULL;
91 }
92 
93 static void
94 decode_vendor_string( char *s, int *vendor )
95 {
96  if ( strcasecmp( s, "GenuineIntel" ) == 0 )
97  *vendor = PAPI_VENDOR_INTEL;
98  else if ( ( strcasecmp( s, "AMD" ) == 0 ) ||
99  ( strcasecmp( s, "AuthenticAMD" ) == 0 ) )
100  *vendor = PAPI_VENDOR_AMD;
101  else if ( strcasecmp( s, "IBM" ) == 0 )
102  *vendor = PAPI_VENDOR_IBM;
103  else if ( strcasecmp( s, "Cray" ) == 0 )
104  *vendor = PAPI_VENDOR_CRAY;
105  else if ( strcasecmp( s, "ARM" ) == 0 )
106  *vendor = PAPI_VENDOR_ARM;
107  else if ( strcasecmp( s, "MIPS" ) == 0 )
108  *vendor = PAPI_VENDOR_MIPS;
109  else if ( strcasecmp( s, "SiCortex" ) == 0 )
110  *vendor = PAPI_VENDOR_MIPS;
111  else
112  *vendor = PAPI_VENDOR_UNKNOWN;
113 }
114 
115 static FILE *
116 xfopen( const char *path, const char *mode )
117 {
118  FILE *fd = fopen( path, mode );
119  if ( !fd )
120  err( EXIT_FAILURE, "error: %s", path );
121  return fd;
122 }
123 
124 static FILE *
125 path_vfopen( const char *mode, const char *path, va_list ap )
126 {
127  vsnprintf( pathbuf, sizeof ( pathbuf ), path, ap );
128  return xfopen( pathbuf, mode );
129 }
130 
131 
132 static int
133 path_sibling( const char *path, ... )
134 {
135  int c;
136  long n;
137  int result = 0;
138  char s[2];
139  FILE *fp;
140  va_list ap;
141  va_start( ap, path );
142  fp = path_vfopen( "r", path, ap );
143  va_end( ap );
144 
145  while ( ( c = fgetc( fp ) ) != EOF ) {
146  if ( isxdigit( c ) ) {
147  s[0] = ( char ) c;
148  s[1] = '\0';
149  for ( n = strtol( s, NULL, 16 ); n > 0; n /= 2 ) {
150  if ( n % 2 )
151  result++;
152  }
153  }
154  }
155 
156  fclose( fp );
157  return result;
158 }
159 
160 static int
161 path_exist( const char *path, ... )
162 {
163  va_list ap;
164  va_start( ap, path );
165  vsnprintf( pathbuf, sizeof ( pathbuf ), path, ap );
166  va_end( ap );
167  return access( pathbuf, F_OK ) == 0;
168 }
169 
170 int
171 _linux_get_cpu_info( PAPI_hw_info_t *hwinfo, int *cpuinfo_mhz )
172 {
173  int tmp, retval = PAPI_OK;
174  char maxargs[PAPI_HUGE_STR_LEN], *t, *s;
175  float mhz = 0.0;
176  FILE *f;
177 
178  if ( ( f = fopen( "/proc/cpuinfo", "r" ) ) == NULL ) {
179  PAPIERROR( "fopen(/proc/cpuinfo) errno %d", errno );
180  return PAPI_ESYS;
181  }
182 
183  /* All of this information maybe overwritten by the component */
184 
185  /* MHZ */
186  rewind( f );
187  s = search_cpu_info( f, "clock", maxargs );
188  if ( !s ) {
189  rewind( f );
190  s = search_cpu_info( f, "cpu MHz", maxargs );
191  }
192  if ( s ) {
193  sscanf( s + 1, "%f", &mhz );
194  }
195  *cpuinfo_mhz = mhz;
196 
197  /* Vendor Name and Vendor Code */
198  rewind( f );
199  s = search_cpu_info( f, "vendor_id", maxargs );
200  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
201  *t = '\0';
202  strcpy( hwinfo->vendor_string, s + 2 );
203  } else {
204  rewind( f );
205  s = search_cpu_info( f, "vendor", maxargs );
206  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
207  *t = '\0';
208  strcpy( hwinfo->vendor_string, s + 2 );
209  } else {
210  rewind( f );
211  s = search_cpu_info( f, "system type", maxargs );
212  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
213  *t = '\0';
214  s = strtok( s + 2, " " );
215  strcpy( hwinfo->vendor_string, s );
216  } else {
217  rewind( f );
218  s = search_cpu_info( f, "platform", maxargs );
219  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
220  *t = '\0';
221  s = strtok( s + 2, " " );
222  if ( ( strcasecmp( s, "pSeries" ) == 0 ) ||
223  ( strcasecmp( s, "PowerMac" ) == 0 ) ) {
224  strcpy( hwinfo->vendor_string, "IBM" );
225  }
226  } else {
227  rewind( f );
228  s = search_cpu_info( f, "CPU implementer", maxargs );
229  if ( s ) {
230  strcpy( hwinfo->vendor_string, "ARM" );
231  }
232  }
233  }
234  }
235  }
236 
237  if ( strlen( hwinfo->vendor_string ) ) {
238  decode_vendor_string( hwinfo->vendor_string, &hwinfo->vendor );
239  }
240 
241  /* Revision */
242  rewind( f );
243  s = search_cpu_info( f, "stepping", maxargs );
244  if ( s ) {
245  sscanf( s + 1, "%d", &tmp );
246  hwinfo->revision = ( float ) tmp;
247  hwinfo->cpuid_stepping = tmp;
248  } else {
249  rewind( f );
250  s = search_cpu_info( f, "revision", maxargs );
251  if ( s ) {
252  sscanf( s + 1, "%d", &tmp );
253  hwinfo->revision = ( float ) tmp;
254  hwinfo->cpuid_stepping = tmp;
255  }
256  }
257 
258  /* Model Name */
259  rewind( f );
260  s = search_cpu_info( f, "model name", maxargs );
261  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
262  *t = '\0';
263  strcpy( hwinfo->model_string, s + 2 );
264  } else {
265  rewind( f );
266  s = search_cpu_info( f, "family", maxargs );
267  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
268  *t = '\0';
269  strcpy( hwinfo->model_string, s + 2 );
270  } else {
271  rewind( f );
272  s = search_cpu_info( f, "cpu model", maxargs );
273  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
274  *t = '\0';
275  strtok( s + 2, " " );
276  s = strtok( NULL, " " );
277  strcpy( hwinfo->model_string, s );
278  } else {
279  rewind( f );
280  s = search_cpu_info( f, "cpu", maxargs );
281  if ( s && ( t = strchr( s + 2, '\n' ) ) ) {
282  *t = '\0';
283  /* get just the first token */
284  s = strtok( s + 2, " " );
285  strcpy( hwinfo->model_string, s );
286  }
287  }
288  }
289  }
290 
291  /* Family */
292  rewind( f );
293  s = search_cpu_info( f, "family", maxargs );
294  if ( s ) {
295  sscanf( s + 1, "%d", &tmp );
296  hwinfo->cpuid_family = tmp;
297  } else {
298  rewind( f );
299  s = search_cpu_info( f, "cpu family", maxargs );
300  if ( s ) {
301  sscanf( s + 1, "%d", &tmp );
302  hwinfo->cpuid_family = tmp;
303  }
304  }
305 
306  /* CPU Model */
307  rewind( f );
308  s = search_cpu_info( f, "model", maxargs );
309  if ( s ) {
310  sscanf( s + 1, "%d", &tmp );
311  hwinfo->model = tmp;
312  hwinfo->cpuid_model = tmp;
313  }
314 
315 
316  /* The following members are set using the same methodology */
317  /* used in lscpu. */
318 
319  /* Total number of CPUs */
320  /* The following line assumes totalcpus was initialized to zero! */
321  while ( path_exist( _PATH_SYS_SYSTEM "/cpu/cpu%d", hwinfo->totalcpus ) )
322  hwinfo->totalcpus++;
323 
324  /* Number of threads per core */
325  if ( path_exist( _PATH_SYS_CPU0 "/topology/thread_siblings" ) )
326  hwinfo->threads =
327  path_sibling( _PATH_SYS_CPU0 "/topology/thread_siblings" );
328 
329  /* Number of cores per socket */
330  if ( path_exist( _PATH_SYS_CPU0 "/topology/core_siblings" ) &&
331  hwinfo->threads > 0 )
332  hwinfo->cores =
333  path_sibling( _PATH_SYS_CPU0 "/topology/core_siblings" ) /
334  hwinfo->threads;
335 
336  /* Number of NUMA nodes */
337  /* The following line assumes nnodes was initialized to zero! */
338  while ( path_exist( _PATH_SYS_SYSTEM "/node/node%d", hwinfo->nnodes ) )
339  hwinfo->nnodes++;
340 
341  /* Number of CPUs per node */
342  hwinfo->ncpu =
343  hwinfo->nnodes >
344  1 ? hwinfo->totalcpus / hwinfo->nnodes : hwinfo->totalcpus;
345 
346  /* Number of sockets */
347  if ( hwinfo->threads > 0 && hwinfo->cores > 0 )
348  hwinfo->sockets = hwinfo->totalcpus / hwinfo->cores / hwinfo->threads;
349 
350 #if 0
351  int *nodecpu;
352  /* cpumap data is not currently part of the _papi_hw_info struct */
353  nodecpu = malloc( (unsigned int) hwinfo->nnodes * sizeof(int) );
354  if ( nodecpu ) {
355  int i;
356  for ( i = 0; i < hwinfo->nnodes; ++i ) {
357  nodecpu[i] = path_sibling(
358  _PATH_SYS_SYSTEM "/node/node%d/cpumap", i );
359  }
360  } else {
361  PAPIERROR( "malloc failed for variable not currently used" );
362  }
363 #endif
364 
365 
366  /* Fixup missing Megahertz Value */
367  /* This is missing from cpuinfo on ARM and MIPS */
368  if (*cpuinfo_mhz < 1.0) {
369  rewind( f );
370 
371  s = search_cpu_info( f, "BogoMIPS", maxargs );
372  if ((!s) || (sscanf( s + 1, "%f", &mhz ) != 1)) {
373  INTDBG("Mhz detection failed. Please edit file %s at line %d.\n",
374  __FILE__,__LINE__);
375  }
376 
377  if (hwinfo->vendor == PAPI_VENDOR_MIPS) {
378  /* MIPS has 2x clock multiplier */
379  *cpuinfo_mhz = 2*(((int)mhz)+1);
380 
381  /* Also update version info on MIPS */
382  rewind( f );
383  s = search_cpu_info( f, "cpu model", maxargs );
384  s = strstr(s+1," V")+2;
385  strtok(s," ");
386  sscanf(s, "%f ", &hwinfo->revision );
387  }
388  else {
389  /* In general bogomips is proportional to number of CPUs */
390  if (hwinfo->totalcpus) {
391  if (mhz!=0) *cpuinfo_mhz = mhz / hwinfo->totalcpus;
392  }
393  }
394  }
395 
396  fclose( f );
397 
398  return retval;
399 }
400 
401 int
402 _linux_get_mhz( int *sys_min_mhz, int *sys_max_mhz ) {
403 
404  FILE *fff;
405  int result;
406 
407  /* Try checking for min MHz */
408  /* Assume cpu0 exists */
409  fff=fopen("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq","r");
410  if (fff==NULL) return PAPI_EINVAL;
411  result=fscanf(fff,"%d",sys_min_mhz);
412  fclose(fff);
413  if (result!=1) return PAPI_EINVAL;
414 
415  fff=fopen("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq","r");
416  if (fff==NULL) return PAPI_EINVAL;
417  result=fscanf(fff,"%d",sys_max_mhz);
418  fclose(fff);
419  if (result!=1) return PAPI_EINVAL;
420 
421  return PAPI_OK;
422 
423 }
424 
425 int
427 
428  int retval;
429 
430  char maxargs[PAPI_HUGE_STR_LEN];
431  pid_t pid;
432 
433  int cpuinfo_mhz,sys_min_khz,sys_max_khz;
434 
435  /* Software info */
436 
437  /* Path and args */
438 
439  pid = getpid( );
440  if ( pid < 0 ) {
441  PAPIERROR( "getpid() returned < 0" );
442  return PAPI_ESYS;
443  }
444  mdi->pid = pid;
445 
446  sprintf( maxargs, "/proc/%d/exe", ( int ) pid );
447  if ( readlink( maxargs, mdi->exe_info.fullname, PAPI_HUGE_STR_LEN ) < 0 ) {
448  PAPIERROR( "readlink(%s) returned < 0", maxargs );
449  return PAPI_ESYS;
450  }
451 
452  /* Careful, basename can modify it's argument */
453 
454  strcpy( maxargs, mdi->exe_info.fullname );
455  strcpy( mdi->exe_info.address_info.name, basename( maxargs ) );
456 
457  SUBDBG( "Executable is %s\n", mdi->exe_info.address_info.name );
458  SUBDBG( "Full Executable is %s\n", mdi->exe_info.fullname );
459 
460  /* Executable regions, may require reading /proc/pid/maps file */
461 
462  retval = _linux_update_shlib_info( mdi );
463  SUBDBG( "Text: Start %p, End %p, length %d\n",
466  ( int ) ( mdi->exe_info.address_info.text_end -
468  SUBDBG( "Data: Start %p, End %p, length %d\n",
471  ( int ) ( mdi->exe_info.address_info.data_end -
473  SUBDBG( "Bss: Start %p, End %p, length %d\n",
476  ( int ) ( mdi->exe_info.address_info.bss_end -
478 
479  /* PAPI_preload_option information */
480 
481  strcpy( mdi->preload_info.lib_preload_env, "LD_PRELOAD" );
482  mdi->preload_info.lib_preload_sep = ' ';
483  strcpy( mdi->preload_info.lib_dir_env, "LD_LIBRARY_PATH" );
484  mdi->preload_info.lib_dir_sep = ':';
485 
486  /* Hardware info */
487 
488  retval = _linux_get_cpu_info( &mdi->hw_info, &cpuinfo_mhz );
489  if ( retval )
490  return retval;
491 
492  /* Handle MHz */
493 
494  retval = _linux_get_mhz( &sys_min_khz, &sys_max_khz );
495  if ( retval ) {
496 
497  mdi->hw_info.cpu_max_mhz=cpuinfo_mhz;
498  mdi->hw_info.cpu_min_mhz=cpuinfo_mhz;
499 
500  /*
501  mdi->hw_info.mhz=cpuinfo_mhz;
502  mdi->hw_info.clock_mhz=cpuinfo_mhz;
503  */
504  }
505  else {
506  mdi->hw_info.cpu_max_mhz=sys_max_khz/1000;
507  mdi->hw_info.cpu_min_mhz=sys_min_khz/1000;
508 
509  /*
510  mdi->hw_info.mhz=sys_max_khz/1000;
511  mdi->hw_info.clock_mhz=sys_max_khz/1000;
512  */
513  }
514 
515  /* Set Up Memory */
516 
517  retval = _linux_get_memory_info( &mdi->hw_info, mdi->hw_info.model );
518  if ( retval )
519  return retval;
520 
521  SUBDBG( "Found %d %s(%d) %s(%d) CPUs at %d Mhz.\n",
522  mdi->hw_info.totalcpus,
523  mdi->hw_info.vendor_string,
524  mdi->hw_info.vendor,
525  mdi->hw_info.model_string,
526  mdi->hw_info.model,
527  mdi->hw_info.cpu_max_mhz);
528 
529  /* Get virtualization info */
531 
532  return PAPI_OK;
533 }
534 
535 int
537 
538  int major=0,minor=0,sub=0;
539  char *ptr;
540  struct utsname uname_buffer;
541 
542  /* Initialize the locks */
544 
545  /* Get the kernel info */
546  uname(&uname_buffer);
547 
548  SUBDBG("Native kernel version %s\n",uname_buffer.release);
549 
550  strncpy(_papi_os_info.name,uname_buffer.sysname,PAPI_MAX_STR_LEN);
551 
552 #ifdef ASSUME_KERNEL
553  strncpy(_papi_os_info.version,ASSUME_KERNEL,PAPI_MAX_STR_LEN);
554  SUBDBG("Assuming kernel version %s\n",_papi_os_info.name);
555 #else
556  strncpy(_papi_os_info.version,uname_buffer.release,PAPI_MAX_STR_LEN);
557 #endif
558 
559  ptr=strtok(_papi_os_info.version,".");
560  if (ptr!=NULL) major=atoi(ptr);
561 
562  ptr=strtok(NULL,".");
563  if (ptr!=NULL) minor=atoi(ptr);
564 
565  ptr=strtok(NULL,".");
566  if (ptr!=NULL) sub=atoi(ptr);
567 
568  _papi_os_info.os_version=LINUX_VERSION(major,minor,sub);
569 
570  _papi_os_info.itimer_sig = PAPI_INT_MPX_SIGNAL;
571  _papi_os_info.itimer_num = PAPI_INT_ITIMER;
572  _papi_os_info.itimer_ns = PAPI_INT_MPX_DEF_US * 1000;
573  _papi_os_info.itimer_res_ns = 1;
574  _papi_os_info.clock_ticks = sysconf( _SC_CLK_TCK );
575 
576  /* Get Linux-specific system info */
578 
579  return PAPI_OK;
580 }
581 
582 
583 
585 
586  int watchdog_detected=0,watchdog_value=0;
587  FILE *fff;
588 
589  fff=fopen("/proc/sys/kernel/nmi_watchdog","r");
590  if (fff!=NULL) {
591  if (fscanf(fff,"%d",&watchdog_value)==1) {
592  if (watchdog_value>0) watchdog_detected=1;
593  }
594  fclose(fff);
595  }
596 
597  return watchdog_detected;
598 }
599 
602  .get_dmem_info = _linux_get_dmem_info,
603  .get_real_cycles = _linux_get_real_cycles,
604  .update_shlib_info = _linux_update_shlib_info,
605  .get_system_info = _linux_get_system_info,
606 
607 
608 #if defined(HAVE_CLOCK_GETTIME)
609  .get_real_usec = _linux_get_real_usec_gettime,
610 #elif defined(HAVE_GETTIMEOFDAY)
611  .get_real_usec = _linux_get_real_usec_gettimeofday,
612 #else
613  .get_real_usec = _linux_get_real_usec_cycles,
614 #endif
615 
616 
617 #if defined(USE_PROC_PTTIMER)
618  .get_virt_usec = _linux_get_virt_usec_pttimer,
619 #elif defined(HAVE_CLOCK_GETTIME_THREAD)
620  .get_virt_usec = _linux_get_virt_usec_gettime,
621 #elif defined(HAVE_PER_THREAD_TIMES)
622  .get_virt_usec = _linux_get_virt_usec_times,
623 #elif defined(HAVE_PER_THREAD_GETRUSAGE)
624  .get_virt_usec = _linux_get_virt_usec_rusage,
625 #endif
626 
627 
628 #if defined(HAVE_CLOCK_GETTIME)
629  .get_real_nsec = _linux_get_real_nsec_gettime,
630 #endif
631 
632 #if defined(HAVE_CLOCK_GETTIME_THREAD)
633  .get_virt_nsec = _linux_get_virt_nsec_gettime,
634 #endif
635 
636 
637 };
char name[PAPI_HUGE_STR_LEN]
Definition: papi.h:691
#define PAPI_HUGE_STR_LEN
Definition: fpapi.h:42
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
int atoi()
static void decode_vendor_string(char *s, int *vendor)
Definition: linux-common.c:94
long long _linux_get_real_cycles(void)
Definition: linux-timer.c:245
int errno
int cores
Definition: papi.h:778
double f(double a)
Definition: cpi.c:23
#define PAPI_INT_MPX_DEF_US
Definition: papi_internal.h:65
long long _linux_get_virt_usec_gettime(void)
Definition: linux-timer.c:376
Hardware info structure.
Definition: papi.h:775
caddr_t text_end
Definition: papi.h:693
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
int cpu_min_mhz
Definition: papi.h:792
int fd
Definition: iozone.c:1291
static char pathbuf[PATH_MAX]
Definition: linux-common.c:72
return PAPI_OK
Definition: linux-nvml.c:458
static int path_sibling(const char *path,...)
Definition: linux-common.c:133
caddr_t bss_start
Definition: papi.h:696
PAPI_preload_info_t preload_info
PAPI_exe_info_t exe_info
fclose(thread_wqfd)
void
Definition: iozone.c:18627
return PAPI_EINVAL
Definition: linux-nvml.c:408
double c
Definition: multiplex.c:22
int _linux_get_mhz(int *sys_min_mhz, int *sys_max_mhz)
Definition: linux-common.c:402
Return codes and api definitions.
int cpuid_stepping
Definition: papi.h:789
#define PAPI_MAX_LOCK
Definition: papi_lock.h:18
#define _PATH_SYS_SYSTEM
Definition: linux-common.c:69
char name[PAPI_MAX_STR_LEN]
long long _linux_get_real_nsec_gettime(void)
Definition: linux-timer.c:466
FILE * fff[MAX_EVENTS]
#define INTDBG(format, args...)
Definition: papi_debug.h:65
err
Definition: linux-cuda.c:323
char lib_preload_env[PAPI_MAX_STR_LEN]
Definition: papi.h:617
int _linux_update_shlib_info(papi_mdi_t *mdi)
Definition: linux-memory.c:936
t
Definition: iozone.c:23562
int threads
Definition: papi.h:777
#define _PATH_SYS_CPU0
Definition: linux-common.c:70
papi_os_vector_t _papi_os_vector
Definition: aix.c:1288
float revision
Definition: papi.h:786
int i
Definition: fileop.c:140
static int path_exist(const char *path,...)
Definition: linux-common.c:161
static FILE * path_vfopen(const char *mode, const char *path, va_list ap)
Definition: linux-common.c:125
PAPI_os_info_t _papi_os_info
Definition: aix.c:1210
int _linux_get_memory_info(PAPI_hw_info_t *hwinfo, int cpu_type)
Definition: linux-memory.c:912
#define PAPI_VENDOR_IBM
Definition: papi.h:348
static int pid
char virtual_vendor_string[PAPI_MAX_STR_LEN]
Definition: papi.h:796
char lib_preload_sep
Definition: papi.h:618
caddr_t text_start
Definition: papi.h:692
static FILE * xfopen(const char *path, const char *mode)
Definition: linux-common.c:116
PAPI_address_map_t address_info
Definition: papi.h:704
long long _linux_get_real_usec_cycles(void)
Definition: linux-timer.c:310
int cpuid_model
Definition: papi.h:788
volatile unsigned int _papi_hwd_lock_data[PAPI_MAX_LOCK]
Definition: darwin-common.c:32
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PAPI_INT_ITIMER
Definition: papi_internal.h:54
#define PAPI_VENDOR_MIPS
Definition: papi.h:353
s
Definition: iozone.c:20289
int nnodes
Definition: papi.h:780
static FILE * fp
void PAPIERROR(char *format,...)
int _linux_get_dmem_info(PAPI_dmem_info_t *d)
Definition: linux-memory.c:48
char version[PAPI_MAX_STR_LEN]
#define PAPI_VENDOR_ARM
Definition: papi.h:352
long long _linux_get_virt_usec_times(void)
Definition: linux-timer.c:352
int cpuid_family
Definition: papi.h:787
#define PAPI_INT_MPX_SIGNAL
Definition: papi_internal.h:52
int _linux_get_cpu_info(PAPI_hw_info_t *hwinfo, int *cpuinfo_mhz)
Definition: linux-common.c:171
#define PAPI_ESYS
Definition: fpapi.h:108
#define PAPI_VENDOR_CRAY
Definition: papi.h:349
char vendor_string[PAPI_MAX_STR_LEN]
Definition: papi.h:783
papi_mdi_t _papi_hwi_system_info
Definition: papi_internal.c:57
strcpy(filename, default_filename)
PAPI_hw_info_t hw_info
static int _linux_init_locks(void)
Definition: linux-common.c:38
#define PAPI_VENDOR_INTEL
Definition: papi.h:346
caddr_t data_start
Definition: papi.h:694
int _x86_detect_hypervisor(char *vendor_name)
#define LINUX_VERSION(a, b, c)
Definition: linux-common.h:4
int vendor
Definition: papi.h:782
int _papi_hwi_init_os(void)
Definition: aix.c:1213
sscanf(mnc->m_child_port,"%d",&mc.m_child_port)
#define MUTEX_OPEN
Definition: perfctr-ppc64.h:75
#define PATH_MAX
Definition: fileop.c:68
int model
Definition: papi.h:784
long long _linux_get_real_usec_gettime(void)
Definition: linux-timer.c:273
int cpu_max_mhz
Definition: papi.h:791
int
Definition: iozone.c:18528
long long _linux_get_virt_usec_pttimer(void)
Definition: linux-timer.c:395
caddr_t bss_end
Definition: papi.h:697
caddr_t data_end
Definition: papi.h:695
int totalcpus
Definition: papi.h:781
int _linux_detect_nmi_watchdog()
Definition: linux-common.c:584
long long _linux_get_virt_nsec_gettime(void)
Definition: linux-timer.c:489
char model_string[PAPI_MAX_STR_LEN]
Definition: papi.h:785
char fullname[PAPI_HUGE_STR_LEN]
Definition: papi.h:703
int _linux_detect_hypervisor(char *virtual_vendor_name)
Definition: linux-common.c:55
int virtualized
Definition: papi.h:795
ssize_t retval
Definition: libasync.c:338
long long tmp
Definition: iozone.c:12031
char lib_dir_sep
Definition: papi.h:620
long long _linux_get_virt_usec_rusage(void)
Definition: linux-timer.c:330
int _linux_get_system_info(papi_mdi_t *mdi)
Definition: linux-common.c:426
int(* get_memory_info)(PAPI_hw_info_t *, int)
Definition: papi_vector.h:69
char lib_dir_env[PAPI_MAX_STR_LEN]
Definition: papi.h:619
static char * search_cpu_info(FILE *f, char *search_str, char *line)
Definition: linux-common.c:76
int sockets
Definition: papi.h:779
rewind(w_traj_fd)
long long _linux_get_real_usec_gettimeofday(void)
Definition: linux-timer.c:295
#define PAPI_VENDOR_AMD
Definition: papi.h:347
int n
Definition: mendes-alt.c:164
int ncpu
Definition: papi.h:776
#define PAPI_VENDOR_UNKNOWN
Definition: papi.h:345
char * ptr
Definition: iozone.c:23586