PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-lustre.c
Go to the documentation of this file.
1 /****************************/
2 /* THIS IS OPEN SOURCE CODE */
3 /****************************/
4 
16 #include <string.h>
17 #include <sys/types.h>
18 #include <sys/stat.h>
19 #include <fcntl.h>
20 #include <dirent.h>
21 #include <stdint.h>
22 #include <ctype.h>
23 
24 #include "papi.h"
25 #include "papi_internal.h"
26 #include "papi_vector.h"
27 #include "papi_memory.h"
28 
30 typedef struct counter_info_struct
31 {
32  int idx;
33  char *name;
34  char *description;
35  char *unit;
36  unsigned long long value;
37 } counter_info;
38 
39 typedef struct
40 {
41  int count;
42  char **data;
43 } string_list;
44 
45 
47 typedef struct lustre_fs_struct
48 {
49  char *proc_file;
54  struct lustre_fs_struct *next;
55 } lustre_fs;
56 
57 #define LUSTRE_MAX_COUNTERS 100
58 #define LUSTRE_MAX_COUNTER_TERMS LUSTRE_MAX_COUNTERS
59 
63 
64 
65 typedef struct LUSTRE_control_state
66 {
67  long long start_count[LUSTRE_MAX_COUNTERS];
68  long long current_count[LUSTRE_MAX_COUNTERS];
69  long long difference[LUSTRE_MAX_COUNTERS];
70  int which_counter[LUSTRE_MAX_COUNTERS];
73 
74 
75 typedef struct LUSTRE_context
76 {
79 
80 /* Default path to lustre stats */
81 #ifdef FAKE_LUSTRE
82 const char proc_base_path[] = "./components/lustre/fake_proc/fs/lustre/";
83 #else
84 const char proc_base_path[] = "/proc/fs/lustre/";
85 #endif
86 
88 static int num_events = 0;
89 static int table_size = 32;
90 
91 /* mount Lustre fs are kept in a list */
92 static lustre_fs *root_lustre_fs = NULL;
93 
95 
96 /******************************************************************************
97  ******** BEGIN FUNCTIONS USED INTERNALLY SPECIFIC TO THIS COMPONENT ********
98  *****************************************************************************/
99 static int resize_native_table() {
100  counter_info** new_table;
101  int new_size = table_size*2;
102  new_table = (counter_info**)papi_malloc(sizeof(counter_info*) * new_size);
103  if (NULL==new_table)
104  return PAPI_ENOMEM;
105  if ( lustre_native_table) {
106  memcpy(new_table, lustre_native_table, sizeof(counter_info*) * table_size );
107  papi_free(lustre_native_table);
108  }
109  lustre_native_table = new_table;
110  table_size*=2;
111  return PAPI_OK;
112 }
113 
120 static counter_info *
121 addCounter( const char *name, const char *desc, const char *unit )
122 {
123  counter_info *cntr;
124 
125  if ( num_events >= table_size )
126  if (PAPI_OK != resize_native_table())
127  return NULL;
128 
129  cntr = malloc( sizeof ( counter_info ) );
130 
131  if ( cntr == NULL ) {
132  SUBDBG("can not allocate memory for new counter\n" );
133  return NULL;
134  }
135 
136  cntr->idx=num_events;
137  cntr->name = strdup( name );
138  cntr->description = strdup( desc );
139  cntr->unit = strdup( unit );
140  cntr->value = 0;
141 
142  lustre_native_table[num_events]=cntr;
143 
144  num_events++;
145 
146  return cntr;
147 }
148 
155 static int
156 addLustreFS( const char *name,
157  const char *procpath_general,
158  const char *procpath_readahead )
159 {
160  lustre_fs *fs, *last;
161  char counter_name[512];
162  FILE *fff;
163 
164  SUBDBG("Adding lustre fs\n");
165 
166  fs = malloc( sizeof ( lustre_fs ) );
167  if ( fs == NULL ) {
168  SUBDBG("can not allocate memory for new Lustre FS description\n" );
169  return PAPI_ENOMEM;
170  }
171 
172  fs->proc_file=strdup(procpath_general);
173  fff = fopen( procpath_general, "r" );
174  if ( fff == NULL ) {
175  SUBDBG("can not open '%s'\n", procpath_general );
176  free(fs);
177  return PAPI_ESYS;
178  }
179  fclose(fff);
180 
181  fs->proc_file_readahead = strdup(procpath_readahead);
182  fff = fopen( procpath_readahead, "r" );
183  if ( fff == NULL ) {
184  SUBDBG("can not open '%s'\n", procpath_readahead );
185  free(fs);
186  return PAPI_ESYS;
187  }
188  fclose(fff);
189 
190  sprintf( counter_name, "%s_llread", name );
191  if (NULL == (fs->read_cntr = addCounter( counter_name,
192  "bytes read on this lustre client",
193  "bytes" ))) {
194  free(fs);
195  return PAPI_ENOMEM;
196  }
197 
198  sprintf( counter_name, "%s_llwrite", name );
199  if ( NULL == (fs->write_cntr = addCounter( counter_name,
200  "bytes written on this lustre client",
201  "bytes" ))) {
202  free(fs->read_cntr);
203  free(fs);
204  return PAPI_ENOMEM;
205  }
206 
207  sprintf( counter_name, "%s_wrong_readahead", name );
208  if ( NULL == (fs->readahead_cntr = addCounter( counter_name,
209  "bytes read but discarded due to readahead",
210  "bytes" ))) {
211  free(fs->read_cntr);
212  free(fs->write_cntr);
213  free(fs);
214  return PAPI_ENOMEM;
215  }
216 
217  fs->next = NULL;
218 
219  /* Insert into the linked list */
220  /* Does this need locking? */
221  if ( root_lustre_fs == NULL ) {
222  root_lustre_fs = fs;
223  } else {
224  last = root_lustre_fs;
225 
226  while ( last->next != NULL )
227  last = last->next;
228 
229  last->next = fs;
230  }
231  return PAPI_OK;
232 }
233 
234 
238 static int
240 {
241  char lustre_dir[PATH_MAX];
242  char path[PATH_MAX];
243  char path_readahead[PATH_MAX],path_stats[PATH_MAX];
244  char *ptr;
245  char fs_name[100];
246  int idx = 0;
247  int tmp_fd;
248  DIR *proc_dir;
249  struct dirent *entry;
250 
251  sprintf(lustre_dir,"%s/llite",proc_base_path);
252 
253  proc_dir = opendir( lustre_dir );
254  if ( proc_dir == NULL ) {
255  SUBDBG("Cannot open %s\n",lustre_dir);
256  return PAPI_ESYS;
257  }
258 
259  entry = readdir( proc_dir );
260 
261  while ( entry != NULL ) {
262  memset( path, 0, PATH_MAX );
263  snprintf( path, PATH_MAX - 1, "%s/%s/stats", lustre_dir,
264  entry->d_name );
265  SUBDBG("checking for file %s\n", path);
266 
267  if ( ( tmp_fd = open( path, O_RDONLY ) ) != -1 ) {
268  close( tmp_fd );
269 
270  /* erase \r and \n at the end of path */
271  /* why is this necessary? */
272 
273  idx = strlen( path );
274  idx--;
275 
276  while ( path[idx] == '\r' || path[idx] == '\n' )
277  path[idx--] = 0;
278 
279  /* Lustre paths are of type server-UUID */
280 
281  idx = 0;
282 
283  ptr = strstr(path,"llite/") + 6;
284 
285  while ( *ptr && idx < 100 ) {
286  fs_name[idx] = *ptr;
287  ptr++;
288  idx++;
289  }
290 
291  SUBDBG("found Lustre FS: %s\n", fs_name);
292 
293  snprintf( path_stats, PATH_MAX - 1,
294  "%s/%s/stats",
295  lustre_dir,
296  entry->d_name );
297  SUBDBG("Found file %s\n", path_stats);
298 
299  snprintf( path_readahead, PATH_MAX - 1,
300  "%s/%s/read_ahead_stats",
301  lustre_dir,
302  entry->d_name );
303  SUBDBG("Now checking for file %s\n", path_readahead);
304 
305 
306  strcpy( ptr, "read_ahead_stats" );
307  addLustreFS( fs_name, path_stats, path_readahead );
308 
309  }
310  entry = readdir( proc_dir );
311  }
312  closedir( proc_dir );
313 
314  return PAPI_OK;
315 
316 }
317 
321 static void
323 {
325  FILE *fff;
326  char buffer[BUFSIZ];
327 
328  while ( fs != NULL ) {
329 
330  /* read values from stats file */
331  fff=fopen(fs->proc_file,"r" );
332  if (fff != NULL) {
333  while(1) {
334  if (fgets(buffer,BUFSIZ,fff)==NULL) break;
335 
336  if (strstr( buffer, "write_bytes" )) {
337  sscanf(buffer,"%*s %*d %*s %*s %*d %*d %lld",&fs->write_cntr->value);
338  SUBDBG("Read %lld write_bytes\n",fs->write_cntr->value);
339  }
340 
341  if (strstr( buffer, "read_bytes" )) {
342  sscanf(buffer,"%*s %*d %*s %*s %*d %*d %lld",&fs->read_cntr->value);
343  SUBDBG("Read %lld read_bytes\n",fs->read_cntr->value);
344  }
345  }
346  fclose(fff);
347  }
348 
349  fff=fopen(fs->proc_file_readahead,"r");
350  if (fff != NULL) {
351  while(1) {
352  if (fgets(buffer,BUFSIZ,fff)==NULL) break;
353 
354  if (strstr( buffer, "read but discarded")) {
355  sscanf(buffer,"%*s %*s %*s %lld",&fs->readahead_cntr->value);
356  SUBDBG("Read %lld discared\n",fs->readahead_cntr->value);
357  break;
358  }
359  }
360  fclose(fff);
361  }
362  fs = fs->next;
363  }
364 }
365 
366 
370 static void
372 {
373  int i;
374  lustre_fs *fs, *next_fs;
375  counter_info *cntr;
376 
377  for(i=0;i<num_events;i++) {
378  cntr=lustre_native_table[i];
379  if ( cntr != NULL ) {
380  free( cntr->name );
381  free( cntr->description );
382  free( cntr->unit );
383  free( cntr );
384  }
385  lustre_native_table[i]=NULL;
386  }
387 
388  fs = root_lustre_fs;
389 
390  while ( fs != NULL ) {
391  next_fs = fs->next;
392  free(fs->proc_file);
394  free( fs );
395  fs = next_fs;
396  }
397 
398  root_lustre_fs = NULL;
399 }
400 
401 
405 static int
407 {
408  char lustre_directory[BUFSIZ];
409  DIR *proc_dir;
410 
411  sprintf(lustre_directory,"%s/llite",proc_base_path);
412 
413  proc_dir = opendir( proc_base_path );
414  if ( proc_dir == NULL ) {
415  SUBDBG("we are not able to read %s\n",lustre_directory);
416  return PAPI_ESYS;
417  }
418 
419  closedir(proc_dir);
420 
421  return PAPI_OK;
422 }
423 
424 
425 /*****************************************************************************
426  ******************* BEGIN PAPI's COMPONENT REQUIRED FUNCTIONS *************
427  *****************************************************************************/
428 
429 /*
430  * Component setup and shutdown
431  */
432 
433 int
435 {
436 
437  int ret = PAPI_OK;
438 
439  /* See if lustre filesystem exists */
440  ret=detect_lustre();
441  if (ret!=PAPI_OK) {
442  strncpy(_lustre_vector.cmp_info.disabled_reason,
443  "No lustre filesystems found",PAPI_MAX_STR_LEN);
444  return ret;
445  }
446 
448  ret=init_lustre_counters();
449 
450  _lustre_vector.cmp_info.num_native_events=num_events;
451  _lustre_vector.cmp_info.CmpIdx = cidx;
452 
453  return ret;
454 }
455 
456 
457 
458 
459 
460 /*
461  * This is called whenever a thread is initialized
462  */
463 int
465 {
466  (void) ctx;
467 
468  return PAPI_OK;
469 }
470 
471 
472 /*
473  *
474  */
475 int
477 {
478 
479  host_finalize( );
480  papi_free( lustre_native_table );
481 
482  return PAPI_OK;
483 }
484 
485 /*
486  *
487  */
488 int
490 {
491  ( void ) ctx;
492 
493  return PAPI_OK;
494 }
495 
496 
497 
498 /*
499  * Control of counters (Reading/Writing/Starting/Stopping/Setup) functions
500  */
501 int
503 {
504  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
505 
506  memset(lustre_ctl->start_count,0,sizeof(long long)*LUSTRE_MAX_COUNTERS);
507  memset(lustre_ctl->current_count,0,sizeof(long long)*LUSTRE_MAX_COUNTERS);
508 
509  return PAPI_OK;
510 }
511 
512 
513 /*
514  *
515  */
516 int
519  int count,
520  hwd_context_t *ctx )
521 {
522  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
523  ( void ) ctx;
524  int i, index;
525 
526  for ( i = 0; i < count; i++ ) {
527  index = native[i].ni_event;
528  lustre_ctl->which_counter[i]=index;
529  native[i].ni_position = i;
530  }
531 
532  lustre_ctl->num_events=count;
533 
534  return PAPI_OK;
535 }
536 
537 
538 /*
539  *
540  */
541 int
543 {
544  ( void ) ctx;
545 
546  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
547  int i;
548 
550 
551  for(i=0;i<lustre_ctl->num_events;i++) {
552  lustre_ctl->current_count[i]=
553  lustre_native_table[lustre_ctl->which_counter[i]]->value;
554  }
555 
556  memcpy( lustre_ctl->start_count,
557  lustre_ctl->current_count,
558  LUSTRE_MAX_COUNTERS * sizeof ( long long ) );
559 
560  return PAPI_OK;
561 }
562 
563 
564 /*
565  *
566  */
567 int
569 {
570 
571  (void) ctx;
572  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
573  int i;
574 
576 
577  for(i=0;i<lustre_ctl->num_events;i++) {
578  lustre_ctl->current_count[i]=
579  lustre_native_table[lustre_ctl->which_counter[i]]->value;
580  }
581 
582  return PAPI_OK;
583 
584 }
585 
586 
587 
588 /*
589  *
590  */
591 int
593  long long **events, int flags )
594 {
595  (void) ctx;
596  ( void ) flags;
597 
598  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
599  int i;
600 
602 
603  for(i=0;i<lustre_ctl->num_events;i++) {
604  lustre_ctl->current_count[i]=
605  lustre_native_table[lustre_ctl->which_counter[i]]->value;
606  lustre_ctl->difference[i]=lustre_ctl->current_count[i]-
607  lustre_ctl->start_count[i];
608  }
609 
610  *events = lustre_ctl->difference;
611 
612  return PAPI_OK;
613 
614 }
615 
616 
617 
618 
619 /*
620  *
621  */
622 int
624 {
625 
626  /* re-initializes counter_start values to current */
627 
628  _lustre_start(ctx,ctrl);
629 
630  return PAPI_OK;
631 }
632 
633 
634 /*
635  *
636  */
637 int
638 _lustre_write( hwd_context_t * ctx, hwd_control_state_t * ctrl, long long *from )
639 {
640  ( void ) ctx;
641  ( void ) ctrl;
642  ( void ) from;
643 
644  return PAPI_OK;
645 }
646 
647 
648 /*
649  * Functions for setting up various options
650  */
651 
652 /* This function sets various options in the component
653  * The valid codes being passed in are PAPI_SET_DEFDOM,
654  * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT
655  */
656 int
657 _lustre_ctl( hwd_context_t * ctx, int code, _papi_int_option_t * option )
658 {
659  ( void ) ctx;
660  ( void ) code;
661  ( void ) option;
662 
663  return PAPI_OK;
664 }
665 
666 
667 /*
668  * This function has to set the bits needed to count different domains
669  * In particular: PAPI_DOM_USER, PAPI_DOM_KERNEL PAPI_DOM_OTHER
670  * By default return PAPI_EINVAL if none of those are specified
671  * and PAPI_OK with success
672  * PAPI_DOM_USER is only user context is counted
673  * PAPI_DOM_KERNEL is only the Kernel/OS context is counted
674  * PAPI_DOM_OTHER is Exception/transient mode (like user TLB misses)
675  * PAPI_DOM_ALL is all of the domains
676  */
677 int
679 {
680  ( void ) cntrl;
681  int found = 0;
682  if ( PAPI_DOM_USER & domain ) {
683  found = 1;
684  }
685  if ( PAPI_DOM_KERNEL & domain ) {
686  found = 1;
687  }
688  if ( PAPI_DOM_OTHER & domain ) {
689  found = 1;
690  }
691  if ( !found )
692  return PAPI_EINVAL;
693 
694  return PAPI_OK;
695 }
696 
697 
698 /*
699  *
700  */
701 int
702 _lustre_ntv_code_to_name( unsigned int EventCode, char *name, int len )
703 {
704 
705  int event=EventCode;
706 
707  if (event >=0 && event < num_events) {
708  strncpy( name, lustre_native_table[event]->name, len );
709  return PAPI_OK;
710  }
711  return PAPI_ENOEVNT;
712 }
713 
714 
715 /*
716  *
717  */
718 int
719 _lustre_ntv_code_to_descr( unsigned int EventCode, char *name, int len )
720 {
721 
722  int event=EventCode;
723 
724  if (event >=0 && event < num_events) {
725  strncpy( name, lustre_native_table[event]->description, len );
726  return PAPI_OK;
727  }
728  return PAPI_ENOEVNT;
729 }
730 
731 
732 /*
733  *
734  */
735 int
736 _lustre_ntv_enum_events( unsigned int *EventCode, int modifier )
737 {
738 
739  if ( modifier == PAPI_ENUM_FIRST ) {
740  if (num_events==0) return PAPI_ENOEVNT;
741  *EventCode = 0;
742  return PAPI_OK;
743  }
744 
745  if ( modifier == PAPI_ENUM_EVENTS ) {
746  int index = *EventCode;
747 
748  if ( lustre_native_table[index + 1] ) {
749  *EventCode = *EventCode + 1;
750  return PAPI_OK;
751  } else {
752  return PAPI_ENOEVNT;
753  }
754  }
755 
756 
757  return PAPI_EINVAL;
758 }
759 
760 
761 /*
762  *
763  */
764 papi_vector_t _lustre_vector = {
765  .cmp_info = {
766  /* component information (unspecified values initialized to 0) */
767  .name = "lustre",
768  .short_name = "lustre",
769  .version = "1.9",
770  .description = "Lustre filesystem statistics",
771  .num_mpx_cntrs = LUSTRE_MAX_COUNTERS,
772  .num_cntrs = LUSTRE_MAX_COUNTERS,
773  .default_domain = PAPI_DOM_USER,
774  .default_granularity = PAPI_GRN_THR,
775  .available_granularities = PAPI_GRN_THR,
776  .hardware_intr_sig = PAPI_INT_SIGNAL,
777 
778  /* component specific cmp_info initializations */
779  .fast_real_timer = 0,
780  .fast_virtual_timer = 0,
781  .attach = 0,
782  .attach_must_ptrace = 0,
783  .available_domains = PAPI_DOM_USER | PAPI_DOM_KERNEL,
784  },
785 
786  /* sizes of framework-opaque component-private structures */
787  .size = {
788  .context = sizeof ( LUSTRE_context_t ),
789  .control_state = sizeof ( LUSTRE_control_state_t ),
790  .reg_value = sizeof ( LUSTRE_register_t ),
791  .reg_alloc = sizeof ( LUSTRE_reg_alloc_t ),
792  },
793 
794  /* function pointers in this component */
795  .init_thread = _lustre_init_thread,
796  .init_component = _lustre_init_component,
797  .init_control_state = _lustre_init_control_state,
798  .start = _lustre_start,
799  .stop = _lustre_stop,
800  .read = _lustre_read,
801  .shutdown_thread = _lustre_shutdown_thread,
802  .shutdown_component = _lustre_shutdown_component,
803  .ctl = _lustre_ctl,
804  .update_control_state = _lustre_update_control_state,
805  .set_domain = _lustre_set_domain,
806  .reset = _lustre_reset,
807 
808  .ntv_enum_events = _lustre_ntv_enum_events,
809  .ntv_code_to_name = _lustre_ntv_code_to_name,
810  .ntv_code_to_descr = _lustre_ntv_code_to_descr,
811 
812 };
813 
814 
815 
816 
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:625
struct lustre_fs_struct * next
Definition: linux-lustre.c:54
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
memset(eventId, 0, size)
static counter_info * addCounter(const char *name, const char *desc, const char *unit)
Definition: linux-lustre.c:121
int close(int fd)
Definition: appio.c:175
#define PAPI_ENOMEM
Definition: fpapi.h:107
papi_vector_t _lustre_vector
Definition: linux-lustre.c:94
long long flags
Definition: iozone.c:12330
#define papi_free(a)
Definition: papi_memory.h:35
long long difference[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:69
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
#define papi_malloc(a)
Definition: papi_memory.h:34
int _lustre_write(hwd_context_t *ctx, hwd_control_state_t *ctrl, long long *from)
Definition: linux-lustre.c:638
#define PAPI_ENOEVNT
Definition: fpapi.h:112
static int num_events
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
char * proc_file_readahead
Definition: linux-lustre.c:50
counter_info * read_cntr
Definition: linux-lustre.c:52
static int table_size
Definition: linux-lustre.c:89
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
static int detect_lustre()
Definition: linux-lustre.c:406
struct cache_ent * entry
Definition: libasync.c:1170
#define PAPI_DOM_OTHER
Definition: fpapi.h:23
fclose(thread_wqfd)
#define PAPI_DOM_KERNEL
Definition: fpapi.h:22
void
Definition: iozone.c:18627
return PAPI_EINVAL
Definition: linux-nvml.c:408
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
char * proc_file
Definition: linux-lustre.c:49
int _lustre_reset(hwd_context_t *ctx, hwd_control_state_t *ctrl)
Definition: linux-lustre.c:623
Return codes and api definitions.
FILE * fff[MAX_EVENTS]
long long ret
Definition: iozone.c:1346
char disabled_reason[PAPI_MAX_STR_LEN]
Definition: papi.h:632
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:184
int i
Definition: fileop.c:140
int which_counter[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:70
int _lustre_ntv_enum_events(unsigned int *EventCode, int modifier)
Definition: linux-lustre.c:736
long long found
Definition: libasync.c:735
free(dummyfile[xx])
static int cidx
Definition: event_info.c:40
#define LUSTRE_MAX_COUNTERS
Definition: linux-lustre.c:57
int _lustre_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-lustre.c:568
int _lustre_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-lustre.c:542
int _lustre_set_domain(hwd_control_state_t *cntrl, int domain)
Definition: linux-lustre.c:678
static int native
Definition: event_info.c:39
counter_info LUSTRE_reg_alloc_t
Definition: linux-lustre.c:62
counter_info LUSTRE_native_event_entry_t
Definition: linux-lustre.c:61
long long current_count[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:68
long long start_count[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:67
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
int _lustre_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
Definition: linux-lustre.c:592
counter_info * write_cntr
Definition: linux-lustre.c:51
char events[MAX_EVENTS][BUFSIZ]
static void host_finalize(void)
Definition: linux-lustre.c:371
static struct temp_event * last
const char proc_base_path[]
Definition: linux-lustre.c:84
#define PAPI_INT_SIGNAL
Definition: papi_internal.h:53
static int init_lustre_counters(void)
Definition: linux-lustre.c:239
counter_info LUSTRE_register_t
Definition: linux-lustre.c:60
int _lustre_init_control_state(hwd_control_state_t *ctl)
Definition: linux-lustre.c:502
#define PAPI_ESYS
Definition: fpapi.h:108
strcpy(filename, default_filename)
again struct sockaddr sizeof(struct sockaddr_in))
char * buffer
Definition: iozone.c:1366
int _lustre_init_component(int cidx)
Definition: linux-lustre.c:434
static lustre_fs * root_lustre_fs
Definition: linux-lustre.c:92
unsigned long long value
Definition: linux-lustre.c:36
sscanf(mnc->m_child_port,"%d",&mc.m_child_port)
#define PATH_MAX
Definition: fileop.c:68
char * name
Definition: iozone.c:23648
static counter_info ** lustre_native_table
Definition: linux-lustre.c:87
static void read_lustre_counter()
Definition: linux-lustre.c:322
LUSTRE_control_state_t state
Definition: linux-lustre.c:77
int _lustre_ntv_code_to_name(unsigned int EventCode, char *name, int len)
Definition: linux-lustre.c:702
int _lustre_shutdown_component(void)
Definition: linux-lustre.c:476
int _lustre_update_control_state(hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx)
Definition: linux-lustre.c:517
counter_info * readahead_cntr
Definition: linux-lustre.c:53
#define PAPI_DOM_USER
Definition: fpapi.h:21
int _lustre_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
Definition: linux-lustre.c:657
int _lustre_shutdown_thread(hwd_context_t *ctx)
Definition: linux-lustre.c:489
static int addLustreFS(const char *name, const char *procpath_general, const char *procpath_readahead)
Definition: linux-lustre.c:156
int _lustre_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
Definition: linux-lustre.c:719
#define PAPI_GRN_THR
Definition: fpapi.h:67
int _lustre_init_thread(hwd_context_t *ctx)
Definition: linux-lustre.c:464
static int resize_native_table()
Definition: linux-lustre.c:99
char * ptr
Definition: iozone.c:23586