PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
solaris-common.c
Go to the documentation of this file.
1 #include "papi.h"
2 #include "papi_internal.h"
3 #include "papi_vector.h"
4 #include "papi_memory.h"
5 
6 #include "solaris-common.h"
7 
8 #include <sys/utsname.h>
9 
10 
11 #if 0
12 /* once the bug in dladdr is fixed by SUN, (now dladdr caused deadlock when
13  used with pthreads) this function can be used again */
14 int
16 {
17  char fname[80], name[PAPI_HUGE_STR_LEN];
18  prmap_t newp;
19  int count, t_index;
20  FILE *map_f;
21  void *vaddr;
22  Dl_info dlip;
23  PAPI_address_map_t *tmp = NULL;
24 
25  sprintf( fname, "/proc/%d/map", getpid( ) );
26  map_f = fopen( fname, "r" );
27  if ( !map_f ) {
28  PAPIERROR( "fopen(%s) returned < 0", fname );
29  return ( PAPI_OK );
30  }
31 
32  /* count the entries we need */
33  count = 0;
34  t_index = 0;
35  while ( fread( &newp, sizeof ( prmap_t ), 1, map_f ) > 0 ) {
36  vaddr = ( void * ) ( 1 + ( newp.pr_vaddr ) ); // map base address
37  if ( dladdr( vaddr, &dlip ) > 0 ) {
38  count++;
39  if ( ( newp.pr_mflags & MA_EXEC ) && ( newp.pr_mflags & MA_READ ) ) {
40  if ( !( newp.pr_mflags & MA_WRITE ) )
41  t_index++;
42  }
43  strcpy( name, dlip.dli_fname );
45  basename( name ) ) == 0 ) {
46  if ( ( newp.pr_mflags & MA_EXEC ) &&
47  ( newp.pr_mflags & MA_READ ) ) {
48  if ( !( newp.pr_mflags & MA_WRITE ) ) {
50  ( caddr_t ) newp.pr_vaddr;
52  ( caddr_t ) ( newp.pr_vaddr + newp.pr_size );
53  } else {
55  ( caddr_t ) newp.pr_vaddr;
57  ( caddr_t ) ( newp.pr_vaddr + newp.pr_size );
58  }
59  }
60  }
61  }
62 
63  }
64  rewind( map_f );
65  tmp =
66  ( PAPI_address_map_t * ) papi_calloc( t_index - 1,
67  sizeof ( PAPI_address_map_t ) );
68 
69  if ( tmp == NULL ) {
70  PAPIERROR( "Error allocating shared library address map" );
71  return ( PAPI_ENOMEM );
72  }
73  t_index = -1;
74  while ( fread( &newp, sizeof ( prmap_t ), 1, map_f ) > 0 ) {
75  vaddr = ( void * ) ( 1 + ( newp.pr_vaddr ) ); // map base address
76  if ( dladdr( vaddr, &dlip ) > 0 ) { // valid name
77  strcpy( name, dlip.dli_fname );
79  basename( name ) ) == 0 )
80  continue;
81  if ( ( newp.pr_mflags & MA_EXEC ) && ( newp.pr_mflags & MA_READ ) ) {
82  if ( !( newp.pr_mflags & MA_WRITE ) ) {
83  t_index++;
84  tmp[t_index].text_start = ( caddr_t ) newp.pr_vaddr;
85  tmp[t_index].text_end =
86  ( caddr_t ) ( newp.pr_vaddr + newp.pr_size );
87  strncpy( tmp[t_index].name, dlip.dli_fname,
88  PAPI_HUGE_STR_LEN - 1 );
89  tmp[t_index].name[PAPI_HUGE_STR_LEN - 1] = '\0';
90  } else {
91  if ( t_index < 0 )
92  continue;
93  tmp[t_index].data_start = ( caddr_t ) newp.pr_vaddr;
94  tmp[t_index].data_end =
95  ( caddr_t ) ( newp.pr_vaddr + newp.pr_size );
96  }
97  }
98  }
99  }
100 
101  fclose( map_f );
102 
106  _papi_hwi_system_info.shlib_info.count = t_index + 1;
107 
108  return PAPI_OK;
109 }
110 #endif
111 
112 
113 int
115 
116  struct utsname uname_buffer;
117 
118  uname(&uname_buffer);
119 
120  strncpy(_papi_os_info.name,uname_buffer.sysname,PAPI_MAX_STR_LEN);
121 
122  strncpy(_papi_os_info.version,uname_buffer.release,PAPI_MAX_STR_LEN);
123 
128 
129  return PAPI_OK;
130 }
131 
132 #if 0
133 int
134 _ultra_hwd_update_shlib_info( papi_mdi_t *mdi )
135 {
136  /*??? system call takes very long */
137 
138  char cmd_line[PAPI_HUGE_STR_LEN + PAPI_HUGE_STR_LEN], fname[L_tmpnam];
139  char line[256];
140  char address[16], size[10], flags[64], objname[256];
141  PAPI_address_map_t *tmp = NULL;
142 
143  FILE *f = NULL;
144  int t_index = 0, i;
145  struct map_record
146  {
147  long address;
148  int size;
149  int flags;
150  char objname[256];
151  struct map_record *next;
152  } *tmpr, *head, *curr;
153 
154  tmpnam( fname );
155  SUBDBG( "Temporary name %s\n", fname );
156 
157  sprintf( cmd_line, "/bin/pmap %d > %s", ( int ) getpid( ), fname );
158  if ( system( cmd_line ) != 0 ) {
159  PAPIERROR( "Could not run %s to get shared library address map",
160  cmd_line );
161  return ( PAPI_OK );
162  }
163 
164  f = fopen( fname, "r" );
165  if ( f == NULL ) {
166  PAPIERROR( "fopen(%s) returned < 0", fname );
167  remove( fname );
168  return ( PAPI_OK );
169  }
170 
171  /* ignore the first line */
172  fgets( line, 256, f );
173  head = curr = NULL;
174  while ( fgets( line, 256, f ) != NULL ) {
175  /* discard the last line */
176  if ( strncmp( line, " total", 6 ) != 0 ) {
177  sscanf( line, "%s %s %s %s", address, size, flags, objname );
178  if ( objname[0] == '/' ) {
179  tmpr =
180  ( struct map_record * )
181  papi_malloc( sizeof ( struct map_record ) );
182  if ( tmpr == NULL )
183  return ( -1 );
184  tmpr->next = NULL;
185  if ( curr ) {
186  curr->next = tmpr;
187  curr = tmpr;
188  }
189  if ( head == NULL ) {
190  curr = head = tmpr;
191  }
192 
193  SUBDBG( "%s\n", objname );
194 
195  if ( ( strstr( flags, "read" ) && strstr( flags, "exec" ) ) ||
196  ( strstr( flags, "r" ) && strstr( flags, "x" ) ) ) {
197  if ( !( strstr( flags, "write" ) || strstr( flags, "w" ) ) ) { /* text segment */
198  t_index++;
199  tmpr->flags = 1;
200  } else {
201  tmpr->flags = 0;
202  }
203  sscanf( address, "%lx", &tmpr->address );
204  sscanf( size, "%d", &tmpr->size );
205  tmpr->size *= 1024;
206  strcpy( tmpr->objname, objname );
207  }
208 
209  }
210 
211  }
212  }
213  tmp =
214  ( PAPI_address_map_t * ) papi_calloc( t_index - 1,
215  sizeof ( PAPI_address_map_t ) );
216 
217  if ( tmp == NULL ) {
218  PAPIERROR( "Error allocating shared library address map" );
219  return ( PAPI_ENOMEM );
220  }
221 
222  t_index = -1;
223  tmpr = curr = head;
224  i = 0;
225  while ( curr != NULL ) {
227  basename( curr->objname ) ) == 0 ) {
228  if ( curr->flags ) {
230  ( caddr_t ) curr->address;
232  ( caddr_t ) ( curr->address + curr->size );
233  } else {
235  ( caddr_t ) curr->address;
237  ( caddr_t ) ( curr->address + curr->size );
238  }
239  } else {
240  if ( curr->flags ) {
241  t_index++;
242  tmp[t_index].text_start = ( caddr_t ) curr->address;
243  tmp[t_index].text_end =
244  ( caddr_t ) ( curr->address + curr->size );
245  strncpy( tmp[t_index].name, curr->objname,
246  PAPI_HUGE_STR_LEN - 1 );
247  tmp[t_index].name[PAPI_HUGE_STR_LEN - 1] = '\0';
248  } else {
249  if ( t_index < 0 )
250  continue;
251  tmp[t_index].data_start = ( caddr_t ) curr->address;
252  tmp[t_index].data_end =
253  ( caddr_t ) ( curr->address + curr->size );
254  }
255  }
256  tmpr = curr->next;
257  /* free the temporary allocated memory */
258  papi_free( curr );
259  curr = tmpr;
260  } /* end of while */
261 
262  remove( fname );
263  fclose( f );
267  _papi_hwi_system_info.shlib_info.count = t_index + 1;
268 
269  return ( PAPI_OK );
270 
271 }
272 
273 #endif
274 
275 /* From niagara2 code */
276 int
278 {
279  char *file = "/proc/self/map";
280  char *resolve_pattern = "/proc/self/path/%s";
281 
282  char lastobject[PRMAPSZ];
283  char link[PAPI_HUGE_STR_LEN];
284  char path[PAPI_HUGE_STR_LEN];
285 
286  prmap_t mapping;
287 
288  int fd, count = 0, total = 0, position = -1, first = 1;
289  caddr_t t_min, t_max, d_min, d_max;
290 
291  PAPI_address_map_t *pam, *cur;
292 
293 #ifdef DEBUG
294  SUBDBG( "ENTERING FUNCTION >>%s<< at %s:%d\n", __func__, __FILE__,
295  __LINE__ );
296 #endif
297 
298  fd = open( file, O_RDONLY );
299 
300  if ( fd == -1 ) {
301  return PAPI_ESYS;
302  }
303 
304  memset( lastobject, 0, PRMAPSZ );
305 
306 #ifdef DEBUG
307  SUBDBG( " -> %s: Preprocessing memory maps from procfs\n", __func__ );
308 #endif
309 
310  /* Search through the list of mappings in order to identify a) how many
311  mappings are available and b) how many unique mappings are available. */
312  while ( read( fd, &mapping, sizeof ( prmap_t ) ) > 0 ) {
313 #ifdef DEBUG
314  SUBDBG( " -> %s: Found a new memory map entry\n", __func__ );
315 #endif
316  /* Another entry found, just the total count of entries. */
317  total++;
318 
319  /* Is the mapping accessible and not anonymous? */
320  if ( mapping.pr_mflags & ( MA_READ | MA_WRITE | MA_EXEC ) &&
321  !( mapping.pr_mflags & MA_ANON ) ) {
322  /* Test if a new library has been found. If a new library has been
323  found a new entry needs to be counted. */
324  if ( strcmp( lastobject, mapping.pr_mapname ) != 0 ) {
325  strncpy( lastobject, mapping.pr_mapname, PRMAPSZ );
326  count++;
327 
328 #ifdef DEBUG
329  SUBDBG( " -> %s: Memory mapping entry valid for %s\n", __func__,
330  mapping.pr_mapname );
331 #endif
332  }
333  }
334  }
335 #ifdef DEBUG
336  SUBDBG( " -> %s: Preprocessing done, starting to analyze\n", __func__ );
337 #endif
338 
339 
340  /* Start from the beginning, now fill in the found mappings */
341  if ( lseek( fd, 0, SEEK_SET ) == -1 ) {
342  return PAPI_ESYS;
343  }
344 
345  memset( lastobject, 0, PRMAPSZ );
346 
347  /* Allocate memory */
348  pam =
349  ( PAPI_address_map_t * ) papi_calloc( count,
350  sizeof ( PAPI_address_map_t ) );
351 
352  while ( read( fd, &mapping, sizeof ( prmap_t ) ) > 0 ) {
353 
354  if ( mapping.pr_mflags & MA_ANON ) {
355 #ifdef DEBUG
356  SUBDBG
357  ( " -> %s: Anonymous mapping (MA_ANON) found for %s, skipping\n",
358  __func__, mapping.pr_mapname );
359 #endif
360  continue;
361  }
362 
363  /* Check for a new entry */
364  if ( strcmp( mapping.pr_mapname, lastobject ) != 0 ) {
365 #ifdef DEBUG
366  SUBDBG( " -> %s: Analyzing mapping for %s\n", __func__,
367  mapping.pr_mapname );
368 #endif
369  cur = &( pam[++position] );
370  strncpy( lastobject, mapping.pr_mapname, PRMAPSZ );
371  snprintf( link, PAPI_HUGE_STR_LEN, resolve_pattern, lastobject );
372  memset( path, 0, PAPI_HUGE_STR_LEN );
373  readlink( link, path, PAPI_HUGE_STR_LEN );
374  strncpy( cur->name, path, PAPI_HUGE_STR_LEN );
375 #ifdef DEBUG
376  SUBDBG( " -> %s: Resolved name for %s: %s\n", __func__,
377  mapping.pr_mapname, cur->name );
378 #endif
379  }
380 
381  if ( mapping.pr_mflags & MA_READ ) {
382  /* Data (MA_WRITE) or text (MA_READ) segment? */
383  if ( mapping.pr_mflags & MA_WRITE ) {
384  cur->data_start = ( caddr_t ) mapping.pr_vaddr;
385  cur->data_end =
386  ( caddr_t ) ( mapping.pr_vaddr + mapping.pr_size );
387 
388  if ( strcmp
389  ( cur->name,
392  cur->data_start;
394  cur->data_end;
395  }
396 
397  if ( first )
398  d_min = cur->data_start;
399  if ( first )
400  d_max = cur->data_end;
401 
402  if ( cur->data_start < d_min ) {
403  d_min = cur->data_start;
404  }
405 
406  if ( cur->data_end > d_max ) {
407  d_max = cur->data_end;
408  }
409  } else if ( mapping.pr_mflags & MA_EXEC ) {
410  cur->text_start = ( caddr_t ) mapping.pr_vaddr;
411  cur->text_end =
412  ( caddr_t ) ( mapping.pr_vaddr + mapping.pr_size );
413 
414  if ( strcmp
415  ( cur->name,
418  cur->text_start;
420  cur->text_end;
421  }
422 
423  if ( first )
424  t_min = cur->text_start;
425  if ( first )
426  t_max = cur->text_end;
427 
428  if ( cur->text_start < t_min ) {
429  t_min = cur->text_start;
430  }
431 
432  if ( cur->text_end > t_max ) {
433  t_max = cur->text_end;
434  }
435  }
436  }
437 
438  first = 0;
439  }
440 
441  close( fd );
442 
443  /* During the walk of shared objects the upper and lower bound of the
444  segments could be discovered. The bounds are stored in the PAPI info
445  structure. The information is important for the profiling functions of
446  PAPI. */
447 
448 /* This variant would pass the addresses of all text and data segments
449  _papi_hwi_system_info.exe_info.address_info.text_start = t_min;
450  _papi_hwi_system_info.exe_info.address_info.text_end = t_max;
451  _papi_hwi_system_info.exe_info.address_info.data_start = d_min;
452  _papi_hwi_system_info.exe_info.address_info.data_end = d_max;
453 */
454 
455 #ifdef DEBUG
456  SUBDBG( " -> %s: Analysis of memory maps done, results:\n", __func__ );
457  SUBDBG( " -> %s: text_start=%#x, text_end=%#x, text_size=%lld\n", __func__,
462  SUBDBG( " -> %s: data_start=%#x, data_end=%#x, data_size=%lld\n", __func__,
467 #endif
468 
469  /* Store the map read and the total count of shlibs found */
472 
473 #ifdef DEBUG
474  SUBDBG( "LEAVING FUNCTION >>%s<< at %s:%d\n", __func__, __FILE__,
475  __LINE__ );
476 #endif
477 
478  return PAPI_OK;
479 }
480 
481 #if 0
482 int
483 _niagara2_get_system_info( papi_mdi_t *mdi )
484 {
485  // Used for evaluating return values
486  int retval = 0;
487  // Check for process settings
488  pstatus_t *proc_status;
489  psinfo_t *proc_info;
490  // Used for string truncating
491  char *c_ptr;
492  // For retrieving the executable full name
493  char exec_name[PAPI_HUGE_STR_LEN];
494  // For retrieving processor information
496 
497 #ifdef DEBUG
498  SUBDBG( "ENTERING FUNCTION >>%s<< at %s:%d\n", __func__, __FILE__,
499  __LINE__ );
500 #endif
501 
502  /* Get and set pid */
503  pid = getpid( );
504 
505  /* Check for microstate accounting */
506  proc_status = __sol_get_proc_status( pid );
507 
508  if ( proc_status->pr_flags & PR_MSACCT == 0 ||
509  proc_status->pr_flags & PR_MSFORK == 0 ) {
510  /* Solaris 10 should have microstate accounting always activated */
511  return PAPI_ECMP;
512  }
513 
514  /* Fill _papi_hwi_system_info.exe_info.fullname */
515  proc_info = __sol_get_proc_info( pid );
516 
517  // If there are arguments, trim the string to the executable name.
518  if ( proc_info->pr_argc > 1 ) {
519  c_ptr = strchr( proc_info->pr_psargs, ' ' );
520  if ( c_ptr != NULL )
521  c_ptr = '\0';
522  }
523 
524  /* If the path can be qualified, use the full path, otherwise the trimmed
525  name. */
526  if ( realpath( proc_info->pr_psargs, exec_name ) != NULL ) {
527  strncpy( _papi_hwi_system_info.exe_info.fullname, exec_name,
529  } else {
530  strncpy( _papi_hwi_system_info.exe_info.fullname, proc_info->pr_psargs,
532  }
533 
534  /* Fill _papi_hwi_system_info.exe_info.address_info */
535  // Taken from the old component
540 
541  /* Fill _papi_hwi_system_info.hw_info */
542 
543  // Taken from the old component
544  _papi_hwi_system_info.hw_info.ncpu = sysconf( _SC_NPROCESSORS_ONLN );
548  _papi_hwi_system_info.hw_info.totalcpus = sysconf( _SC_NPROCESSORS_CONF );
551 
552  /* The field sparc-version is no longer in prtconf -pv */
554 
555  /* Clock speed */
560 
561  /* Fill _niagara2_vector.cmp_info.mem_hierarchy */
562 
564 
565  /* Fill _papi_hwi_system_info.sub_info */
566  strcpy( _niagara2_vector.cmp_info.name, "SunNiagara2" );
570 
571  /* libcpc2 uses SIGEMT using real hardware signals, no sw emu */
572 
573 #ifdef DEBUG
574  SUBDBG( "LEAVING FUNCTION >>%s<< at %s:%d\n", __func__, __FILE__,
575  __LINE__ );
576 #endif
577 
578  return PAPI_OK;
579 }
580 
581 #endif
582 
583 int
585 {
586  int retval;
587  pid_t pid;
588  char maxargs[PAPI_MAX_STR_LEN] = "<none>";
589  psinfo_t psi;
590  int fd;
591  int hz, version;
592  char cpuname[PAPI_MAX_STR_LEN], pname[PAPI_HUGE_STR_LEN];
593 
594  /* Check counter access */
595 
596  if ( cpc_version( CPC_VER_CURRENT ) != CPC_VER_CURRENT )
597  return PAPI_ECMP;
598  SUBDBG( "CPC version %d successfully opened\n", CPC_VER_CURRENT );
599 
600  if ( cpc_access( ) == -1 )
601  return PAPI_ECMP;
602 
603  /* Global variable cpuver */
604 
605  cpuver = cpc_getcpuver( );
606  SUBDBG( "Got %d from cpc_getcpuver()\n", cpuver );
607  if ( cpuver == -1 )
608  return PAPI_ECMP;
609 
610 #ifdef DEBUG
611  {
612  if ( ISLEVEL( DEBUG_SUBSTRATE ) ) {
613  const char *name;
614  int i;
615 
616  name = cpc_getcpuref( cpuver );
617  if ( name ) {
618  SUBDBG( "CPC CPU reference: %s\n", name );
619  }
620  else {
621  SUBDBG( "Could not get a CPC CPU reference\n" );
622  }
623 
624  for ( i = 0; i < cpc_getnpic( cpuver ); i++ ) {
625  SUBDBG( "\n%6s %-40s %8s\n", "Reg", "Symbolic name", "Code" );
626  cpc_walk_names( cpuver, i, "%6d %-40s %02x\n",
628  }
629  SUBDBG( "\n" );
630  }
631  }
632 #endif
633 
634 
635  /* Initialize other globals */
636 
637  if ( ( retval = build_tables( ) ) != PAPI_OK )
638  return retval;
639 
641  if ( cpuver <= CPC_ULTRA2 ) {
642  SUBDBG( "cpuver (==%d) <= CPC_ULTRA2 (==%d)\n", cpuver, CPC_ULTRA2 );
643  pcr_shift[0] = CPC_ULTRA_PCR_PIC0_SHIFT;
644  pcr_shift[1] = CPC_ULTRA_PCR_PIC1_SHIFT;
645  } else if ( cpuver <= LASTULTRA3 ) {
646  SUBDBG( "cpuver (==%d) <= CPC_ULTRA3x (==%d)\n", cpuver, LASTULTRA3 );
647  pcr_shift[0] = CPC_ULTRA_PCR_PIC0_SHIFT;
648  pcr_shift[1] = CPC_ULTRA_PCR_PIC1_SHIFT;
651  } else
652  return PAPI_ECMP;
653 
654  /* Path and args */
655 
656  pid = getpid( );
657  if ( pid == -1 )
658  return ( PAPI_ESYS );
659 
660  /* Turn on microstate accounting for this process and any LWPs. */
661 
662  sprintf( maxargs, "/proc/%d/ctl", ( int ) pid );
663  if ( ( fd = open( maxargs, O_WRONLY ) ) == -1 )
664  return ( PAPI_ESYS );
665  {
666  int retval;
667  struct
668  {
669  long cmd;
670  long flags;
671  } cmd;
672  cmd.cmd = PCSET;
673  cmd.flags = PR_MSACCT | PR_MSFORK;
674  retval = write( fd, &cmd, sizeof ( cmd ) );
675  close( fd );
676  SUBDBG( "Write PCSET returned %d\n", retval );
677  if ( retval != sizeof ( cmd ) )
678  return ( PAPI_ESYS );
679  }
680 
681  /* Get executable info */
682 
683  sprintf( maxargs, "/proc/%d/psinfo", ( int ) pid );
684  if ( ( fd = open( maxargs, O_RDONLY ) ) == -1 )
685  return ( PAPI_ESYS );
686  read( fd, &psi, sizeof ( psi ) );
687  close( fd );
688 
689  /* Cut off any arguments to exe */
690  {
691  char *tmp;
692  tmp = strchr( psi.pr_psargs, ' ' );
693  if ( tmp != NULL )
694  *tmp = '\0';
695  }
696 
697  if ( realpath( psi.pr_psargs, pname ) )
698  strncpy( _papi_hwi_system_info.exe_info.fullname, pname,
700  else
701  strncpy( _papi_hwi_system_info.exe_info.fullname, psi.pr_psargs,
703 
704  /* please don't use pr_fname here, because it can only store less that
705  16 characters */
708 
709  SUBDBG( "Full Executable is %s\n",
711 
712  /* Executable regions, reading /proc/pid/maps file */
713  retval = _ultra_hwd_update_shlib_info( &_papi_hwi_system_info );
714 
715  /* Hardware info */
716 
717  _papi_hwi_system_info.hw_info.ncpu = sysconf( _SC_NPROCESSORS_ONLN );
719  _papi_hwi_system_info.hw_info.totalcpus = sysconf( _SC_NPROCESSORS_CONF );
720 
721  retval = scan_prtconf( cpuname, PAPI_MAX_STR_LEN, &hz, &version );
722  if ( retval == -1 )
723  return PAPI_ECMP;
724 
726  cpc_getcciname( cpuver ) );
731 
732  _papi_hwi_system_info.hw_info.mhz = ( ( float ) hz / 1.0e6 );
733  SUBDBG( "hw_info.mhz = %f\n", _papi_hwi_system_info.hw_info.mhz );
734 
737 
738 
739  /* Number of PMCs */
740 
741  retval = cpc_getnpic( cpuver );
742  if ( retval < 0 )
743  return PAPI_ECMP;
744 
751 
752  /* Setup presets */
753 
755  if ( retval )
756  return ( retval );
757 
758  return ( PAPI_OK );
759 }
760 
761 
762 long long
764 {
765  return ( ( long long ) gethrtime( ) / ( long long ) 1000 );
766 }
767 
768 long long
770 {
771  return ( _ultra_hwd_get_real_usec( ) *
772  ( long long ) _papi_hwi_system_info.hw_info.cpu_max_mhz );
773 }
774 
775 long long
777 {
778  return ( ( long long ) gethrvtime( ) / ( long long ) 1000 );
779 }
780 
781 
782 
783 
784 
char name[PAPI_HUGE_STR_LEN]
Definition: papi.h:691
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:625
int _niagara2_get_memory_info(PAPI_hw_info_t *hw, int id)
#define PAPI_HUGE_STR_LEN
Definition: fpapi.h:42
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
ssize_t read(int fd, void *buf, size_t count)
Definition: appio.c:225
memset(eventId, 0, size)
int close(int fd)
Definition: appio.c:175
double f(double a)
Definition: cpi.c:23
#define PAPI_ENOMEM
Definition: fpapi.h:107
#define PAPI_VENDOR_SUN
Definition: papi.h:350
#define PAPI_INT_MPX_DEF_US
Definition: papi_internal.h:65
int _solaris_update_shlib_info(papi_mdi_t *mdi)
long long _solaris_get_virt_usec(void)
long long _solaris_get_real_cycles(void)
long long flags
Definition: iozone.c:12330
papi_vector_t _solaris_vector
#define papi_free(a)
Definition: papi_memory.h:35
static psinfo_t * __sol_get_proc_info(const pid_t pid)
caddr_t text_end
Definition: papi.h:693
gc head
Definition: libasync.c:669
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
#define papi_malloc(a)
Definition: papi_memory.h:34
hwi_search_t * preset_table
int cpu_min_mhz
Definition: papi.h:792
off_t lseek(int fd, off_t offset, int whence)
Definition: appio.c:210
int fd
Definition: iozone.c:1291
static cpc_t * cpc
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
Definition: appio.c:275
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
PAPI_exe_info_t exe_info
static int pcr_shift[2]
fclose(thread_wqfd)
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int _niagara2_update_shlib_info(papi_mdi_t *mdi)
static int cpuver
char kernel_version[PAPI_MIN_STR_LEN]
Definition: papi.h:631
void print_walk_names(void *arg, int regno, const char *name, uint8_t bits)
PAPI_shlib_info_t shlib_info
Return codes and api definitions.
char name[PAPI_MAX_STR_LEN]
float mhz
Definition: papi.h:802
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:184
#define LASTULTRA3
Definition: solaris-ultra.c:33
float revision
Definition: papi.h:786
int _papi_hwi_setup_all_presets(hwi_search_t *findem, int cidx)
Definition: papi_preset.c:37
static int scan_prtconf(char *cpuname, int len_cpuname, int *hz, int *ver)
int i
Definition: fileop.c:140
unsigned int fast_real_timer
Definition: papi.h:655
unsigned int fast_virtual_timer
Definition: papi.h:656
long long _solaris_get_real_usec(void)
ssize_t write(int fd, const void *buf, size_t count)
Definition: appio.c:298
PAPI_os_info_t _papi_os_info
Definition: aix.c:1210
static pstatus_t * __sol_get_proc_status(const pid_t pid)
static int pid
char *long long size
Definition: iozone.c:12023
#define __CHECK_ERR_PAPI(retval)
caddr_t text_start
Definition: papi.h:692
#define PAPI_ECMP
Definition: fpapi.h:109
PAPI_address_map_t address_info
Definition: papi.h:704
get the executable&#39;s address space info
Definition: papi.h:690
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PAPI_INT_ITIMER
Definition: papi_internal.h:54
int nnodes
Definition: papi.h:780
void PAPIERROR(char *format,...)
char version[PAPI_MAX_STR_LEN]
static int __sol_get_processor_clock(void)
char version[]
Definition: fileop.c:134
static int build_tables(void)
#define PAPI_INT_MPX_SIGNAL
Definition: papi_internal.h:52
#define PAPI_ESYS
Definition: fpapi.h:108
hwi_search_t * preset_search_map
unsigned int hardware_intr
Definition: papi.h:647
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
caddr_t data_start
Definition: papi.h:694
nsize_list next
Definition: iozone.c:20053
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)
int _solaris_get_system_info(papi_mdi_t *mdi)
int model
Definition: papi.h:784
char * name
Definition: iozone.c:23648
static int total
Definition: rapl_overflow.c:5
PAPI_address_map_t * map
Definition: papi.h:709
int cpu_max_mhz
Definition: papi.h:791
#define ISLEVEL(a)
Definition: papi_debug.h:54
char version[PAPI_MIN_STR_LEN]
Definition: papi.h:629
caddr_t data_end
Definition: papi.h:695
int clock_mhz
Definition: papi.h:803
char support_version[PAPI_MIN_STR_LEN]
Definition: papi.h:630
papi_vector_t _niagara2_vector
int totalcpus
Definition: papi.h:781
char model_string[PAPI_MAX_STR_LEN]
Definition: papi.h:785
char fullname[PAPI_HUGE_STR_LEN]
Definition: papi.h:703
#define PAPI_DOM_USER
Definition: fpapi.h:21
int system()
ssize_t retval
Definition: libasync.c:338
long long tmp
Definition: iozone.c:12031
rewind(w_traj_fd)
#define papi_calloc(a, b)
Definition: papi_memory.h:37
#define DEBUG_SUBSTRATE
Definition: papi_debug.h:27
int ncpu
Definition: papi.h:776