PAPI  5.7.0.0
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  SUBDBG("ENTER:\n");
101  counter_info** new_table;
102  int new_size = table_size*2;
103  new_table = (counter_info**)papi_calloc(new_size, sizeof(counter_info*));
104  if (NULL==new_table) {
105  SUBDBG("EXIT: PAPI_ENOMEM\n");
106  return PAPI_ENOMEM;
107  }
108  if ( lustre_native_table) {
109  memcpy(new_table, lustre_native_table, sizeof(counter_info*) * table_size );
111  }
112  lustre_native_table = new_table;
113  table_size*=2;
114  SUBDBG("EXIT: PAPI_OK\n");
115  return PAPI_OK;
116 }
117 
124 static counter_info *
125 addCounter( const char *name, const char *desc, const char *unit )
126 {
127  SUBDBG("ENTER: name: %s, desc: %s, unit: %s\n", name, desc, unit);
128 
129  counter_info *cntr;
130 
131  if ( num_events >= table_size )
132  if (PAPI_OK != resize_native_table()) {
133  SUBDBG("EXIT: can not resize native table\n" );
134  return NULL;
135  }
136 
137  cntr = malloc( sizeof ( counter_info ) );
138 
139  if ( cntr == NULL ) {
140  SUBDBG("EXIT: can not allocate memory for new counter\n" );
141  return NULL;
142  }
143 
144  cntr->idx=num_events;
145  cntr->name = strdup( name );
146  cntr->description = strdup( desc );
147  cntr->unit = strdup( unit );
148  cntr->value = 0;
149 
151 
152  num_events++;
153 
154 SUBDBG("EXIT: cntr: %p\n", cntr);
155  return cntr;
156 }
157 
164 static int
165 addLustreFS( const char *name,
166  const char *procpath_general,
167  const char *procpath_readahead )
168 {
169  lustre_fs *fs, *last;
170  char counter_name[512];
171  FILE *fff;
172 
173  SUBDBG("Adding lustre fs\n");
174 
175  fs = malloc( sizeof ( lustre_fs ) );
176  if ( fs == NULL ) {
177  SUBDBG("can not allocate memory for new Lustre FS description\n" );
178  return PAPI_ENOMEM;
179  }
180 
181  fs->proc_file=strdup(procpath_general);
182  fff = fopen( procpath_general, "r" );
183  if ( fff == NULL ) {
184  SUBDBG("can not open '%s'\n", procpath_general );
185  free(fs->proc_file); // strdup.
186  free(fs); // malloc.
187  return PAPI_ESYS;
188  }
189  fclose(fff);
190 
191  fs->proc_file_readahead = strdup(procpath_readahead);
192  fff = fopen( procpath_readahead, "r" );
193  if ( fff == NULL ) {
194  SUBDBG("can not open '%s'\n", procpath_readahead );
195  free(fs->proc_file_readahead); // strdup.
196  free(fs->proc_file); // strdup.
197  free(fs); // malloc.
198  return PAPI_ESYS;
199  }
200  fclose(fff);
201 
202  sprintf( counter_name, "%s_llread", name );
203  if (NULL == (fs->read_cntr = addCounter( counter_name,
204  "bytes read on this lustre client",
205  "bytes" ))) {
206  free(fs->proc_file_readahead); // strdup.
207  free(fs->proc_file); // strdup.
208  free(fs); // malloc.
209  return PAPI_ENOMEM;
210  }
211 
212  sprintf( counter_name, "%s_llwrite", name );
213  if ( NULL == (fs->write_cntr = addCounter( counter_name,
214  "bytes written on this lustre client",
215  "bytes" ))) {
216  free(fs->read_cntr);
217  free(fs->proc_file_readahead); // strdup.
218  free(fs->proc_file); // strdup.
219  free(fs); // malloc.
220  return PAPI_ENOMEM;
221  }
222 
223  sprintf( counter_name, "%s_wrong_readahead", name );
224  if ( NULL == (fs->readahead_cntr = addCounter( counter_name,
225  "bytes read but discarded due to readahead",
226  "bytes" ))) {
227  free(fs->read_cntr);
228  free(fs->write_cntr);
229  free(fs->proc_file_readahead); // strdup.
230  free(fs->proc_file); // strdup.
231  free(fs); // malloc.
232  return PAPI_ENOMEM;
233  }
234 
235  fs->next = NULL;
236 
237  /* Insert into the linked list */
238  /* Does this need locking? */
239  if ( root_lustre_fs == NULL ) {
240  root_lustre_fs = fs;
241  } else {
243 
244  while ( last->next != NULL )
245  last = last->next;
246 
247  last->next = fs;
248  }
249  return PAPI_OK;
250 }
251 
252 
256 static int
258 {
259  SUBDBG("ENTER:\n");
260  char lustre_dir[PATH_MAX];
261  char path[PATH_MAX];
262  char path_readahead[PATH_MAX],path_stats[PATH_MAX];
263  char *ptr;
264  char fs_name[100];
265  int found_luster_fs = 0;
266  int idx = 0;
267  int tmp_fd;
268  DIR *proc_dir;
269  struct dirent *entry;
270 
271  sprintf(lustre_dir,"%s/llite",proc_base_path);
272 
273  proc_dir = opendir( lustre_dir );
274  if ( proc_dir == NULL ) {
275  SUBDBG("EXIT: PAPI_ESYS (Cannot open %s)\n",lustre_dir);
276  return PAPI_ESYS;
277  }
278 
279  while ( (entry = readdir( proc_dir )) != NULL ) {
280  memset( path, 0, PATH_MAX );
281  snprintf( path, PATH_MAX - 1, "%s/%s/stats", lustre_dir,
282  entry->d_name );
283  SUBDBG("checking for file %s\n", path);
284 
285  if ( ( tmp_fd = open( path, O_RDONLY ) ) == -1 ) {
286  SUBDBG("Path: %s, can not be opened.\n", path);
287  continue;
288  }
289 
290  close( tmp_fd );
291 
292  /* erase \r and \n at the end of path */
293  /* why is this necessary? */
294 
295  idx = strlen( path );
296  idx--;
297 
298  while ( path[idx] == '\r' || path[idx] == '\n' )
299  path[idx--] = 0;
300 
301  /* Lustre paths are of type server-UUID */
302 
303  idx = 0;
304 
305  ptr = strstr(path,"llite/") + 6;
306  if (ptr == NULL) {
307  SUBDBG("Path: %s, missing llite directory, performance event not created.\n", path);
308  continue;
309  }
310 
311  strncpy(fs_name, ptr, sizeof(fs_name)-1);
312  fs_name[sizeof(fs_name)-1] = '\0';
313 
314  SUBDBG("found Lustre FS: %s\n", fs_name);
315 
316  snprintf( path_stats, PATH_MAX - 1,
317  "%s/%s/stats",
318  lustre_dir,
319  entry->d_name );
320  SUBDBG("Found file %s\n", path_stats);
321 
322  snprintf( path_readahead, PATH_MAX - 1,
323  "%s/%s/read_ahead_stats",
324  lustre_dir,
325  entry->d_name );
326  SUBDBG("Now checking for file %s\n", path_readahead);
327 
328  strcpy( ptr, "read_ahead_stats" );
329  addLustreFS( fs_name, path_stats, path_readahead );
330  found_luster_fs++;
331  }
332  closedir( proc_dir );
333 
334  if (found_luster_fs == 0) {
335  SUBDBG("EXIT: PAPI_ESYS (No luster file systems found)\n");
336  return PAPI_ESYS;
337  }
338 
339  SUBDBG("EXIT: PAPI_OK\n");
340  return PAPI_OK;
341 }
342 
346 static void
348 {
350  FILE *fff;
351  char buffer[BUFSIZ];
352 
353  while ( fs != NULL ) {
354 
355  /* read values from stats file */
356  fff=fopen(fs->proc_file,"r" );
357  if (fff != NULL) {
358  while(1) {
359  if (fgets(buffer,BUFSIZ,fff)==NULL) break;
360 
361  if (strstr( buffer, "write_bytes" )) {
362  sscanf(buffer,"%*s %*d %*s %*s %*d %*d %llu",&fs->write_cntr->value);
363  SUBDBG("Read %llu write_bytes\n",fs->write_cntr->value);
364  }
365 
366  if (strstr( buffer, "read_bytes" )) {
367  sscanf(buffer,"%*s %*d %*s %*s %*d %*d %llu",&fs->read_cntr->value);
368  SUBDBG("Read %llu read_bytes\n",fs->read_cntr->value);
369  }
370  }
371  fclose(fff);
372  }
373 
374  fff=fopen(fs->proc_file_readahead,"r");
375  if (fff != NULL) {
376  while(1) {
377  if (fgets(buffer,BUFSIZ,fff)==NULL) break;
378 
379  if (strstr( buffer, "read but discarded")) {
380  sscanf(buffer,"%*s %*s %*s %llu",&fs->readahead_cntr->value);
381  SUBDBG("Read %llu discared\n",fs->readahead_cntr->value);
382  break;
383  }
384  }
385  fclose(fff);
386  }
387  fs = fs->next;
388  }
389 }
390 
391 
395 static void
397 {
398  int i;
399  lustre_fs *fs, *next_fs;
400  counter_info *cntr;
401 
402  for(i=0;i<num_events;i++) {
403  cntr=lustre_native_table[i];
404  if ( cntr != NULL ) {
405  free( cntr->name );
406  free( cntr->description );
407  free( cntr->unit );
408  free( cntr );
409  }
410  lustre_native_table[i]=NULL;
411  }
412 
413  papi_free(lustre_native_table); // Free the table itself.
414  lustre_native_table = NULL; // clear the pointer.
415  num_events = 0;
416  table_size = 32;
417 
418  fs = root_lustre_fs;
419 
420  while ( fs != NULL ) {
421  next_fs = fs->next;
422  free(fs->read_cntr);
423  free(fs->write_cntr);
424  free(fs->proc_file_readahead); // strdup.
425  free(fs->proc_file); // strdup.
426  free(fs); // malloc.
427  fs = next_fs;
428  }
429 
430  root_lustre_fs = NULL;
431 }
432 
433 
434 /*****************************************************************************
435  ******************* BEGIN PAPI's COMPONENT REQUIRED FUNCTIONS *************
436  *****************************************************************************/
437 
438 /*
439  * Component setup and shutdown
440  */
441 
442 static int
444 {
445  SUBDBG("ENTER:\n");
446  int ret = PAPI_OK;
447 
450  if (ret!=PAPI_OK) {
452  "No lustre filesystems found",PAPI_MAX_STR_LEN);
453  host_finalize(); // cleanup.
454  SUBDBG("EXIT: ret: %d\n", ret);
455  return ret;
456  }
457 
460 
461  SUBDBG("EXIT: ret: %d\n", ret);
462  return ret;
463 }
464 
465 
466 
467 
468 
469 /*
470  * This is called whenever a thread is initialized
471  */
472 static int
474 {
475  (void) ctx;
476 
477  return PAPI_OK;
478 }
479 
480 
481 /*
482  *
483  */
484 static int
486 {
487  SUBDBG("ENTER:\n");
488  host_finalize( );
489  SUBDBG("EXIT:\n");
490  return PAPI_OK;
491 }
492 
493 /*
494  *
495  */
496 static int
498 {
499  ( void ) ctx;
500 
501  return PAPI_OK;
502 }
503 
504 
505 
506 /*
507  * Control of counters (Reading/Writing/Starting/Stopping/Setup) functions
508  */
509 static int
511 {
512  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
513 
514  memset(lustre_ctl->start_count,0,sizeof(long long)*LUSTRE_MAX_COUNTERS);
515  memset(lustre_ctl->current_count,0,sizeof(long long)*LUSTRE_MAX_COUNTERS);
516 
517  return PAPI_OK;
518 }
519 
520 
521 /*
522  *
523  */
524 static int
527  int count,
528  hwd_context_t *ctx )
529 {
530  SUBDBG("ENTER: ctl: %p, native: %p, count: %d, ctx: %p\n", ctl, native, count, ctx);
531  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
532  ( void ) ctx;
533  int i, index;
534 
535  for ( i = 0; i < count; i++ ) {
536  index = native[i].ni_event;
537  lustre_ctl->which_counter[i]=index;
538  native[i].ni_position = i;
539  }
540 
541  lustre_ctl->num_events=count;
542  SUBDBG("EXIT: PAPI_OK\n");
543  return PAPI_OK;
544 }
545 
546 
547 /*
548  *
549  */
550 static int
552 {
553  ( void ) ctx;
554 
555  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
556  int i;
557 
559 
560  for(i=0;i<lustre_ctl->num_events;i++) {
561  lustre_ctl->current_count[i]=
562  lustre_native_table[lustre_ctl->which_counter[i]]->value;
563  }
564 
565  memcpy( lustre_ctl->start_count,
566  lustre_ctl->current_count,
567  LUSTRE_MAX_COUNTERS * sizeof ( long long ) );
568 
569  return PAPI_OK;
570 }
571 
572 
573 /*
574  *
575  */
576 static int
578 {
579 
580  (void) ctx;
581  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
582  int i;
583 
585 
586  for(i=0;i<lustre_ctl->num_events;i++) {
587  lustre_ctl->current_count[i]=
588  lustre_native_table[lustre_ctl->which_counter[i]]->value;
589  }
590 
591  return PAPI_OK;
592 
593 }
594 
595 
596 
597 /*
598  *
599  */
600 static int
602  long long **events, int flags )
603 {
604  (void) ctx;
605  ( void ) flags;
606 
607  LUSTRE_control_state_t *lustre_ctl = (LUSTRE_control_state_t *)ctl;
608  int i;
609 
611 
612  for(i=0;i<lustre_ctl->num_events;i++) {
613  lustre_ctl->current_count[i]=
614  lustre_native_table[lustre_ctl->which_counter[i]]->value;
615  lustre_ctl->difference[i]=lustre_ctl->current_count[i]-
616  lustre_ctl->start_count[i];
617  }
618 
619  *events = lustre_ctl->difference;
620 
621  return PAPI_OK;
622 
623 }
624 
625 
626 
627 
628 /*
629  *
630  */
631 static int
633 {
634 
635  /* re-initializes counter_start values to current */
636 
637  _lustre_start(ctx,ctrl);
638 
639  return PAPI_OK;
640 }
641 
642 
643 /*
644  * Unused lustre write function
645  */
646 /* static int */
647 /* _lustre_write( hwd_context_t * ctx, hwd_control_state_t * ctrl, long long *from ) */
648 /* { */
649 /* ( void ) ctx; */
650 /* ( void ) ctrl; */
651 /* ( void ) from; */
652 
653 /* return PAPI_OK; */
654 /* } */
655 
656 
657 /*
658  * Functions for setting up various options
659  */
660 
661 /* This function sets various options in the component
662  * The valid codes being passed in are PAPI_SET_DEFDOM,
663  * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT
664  */
665 static int
666 _lustre_ctl( hwd_context_t * ctx, int code, _papi_int_option_t * option )
667 {
668  ( void ) ctx;
669  ( void ) code;
670  ( void ) option;
671 
672  return PAPI_OK;
673 }
674 
675 
676 /*
677  * This function can be used to set the event set level domains
678  * where the events should be counted. In particular: PAPI_DOM_USER,
679  * PAPI_DOM_KERNEL PAPI_DOM_OTHER. But the lustre component does not
680  * provide a field in its control_state (LUSTRE_control_state_t) to
681  * save this information. It would also need some way to control when
682  * the counts get updated in order to support domain filters for
683  * event counting.
684  *
685  * So we just ignore this call.
686  */
687 static int
689 {
690  ( void ) cntrl;
691  ( void ) domain;
692  SUBDBG("ENTER: \n");
693 
694  // this component does not allow limiting which domains will increment event counts
695 
696  SUBDBG("EXIT: PAPI_OK\n");
697  return PAPI_OK;
698 }
699 
700 
701 /*
702  *
703  */
704 static int
705 _lustre_ntv_code_to_name( unsigned int EventCode, char *name, int len )
706 {
707  SUBDBG("ENTER: EventCode: %#x, name: %p, len: %d\n", EventCode, name, len);
708  int event=EventCode;
709 
710  if (event >=0 && event < num_events) {
711  strncpy( name, lustre_native_table[event]->name, len-1 );
712  name[len-1] = '\0';
713  SUBDBG("EXIT: event name: %s\n", name);
714  return PAPI_OK;
715  }
716  SUBDBG("EXIT: PAPI_ENOEVNT\n");
717  return PAPI_ENOEVNT;
718 }
719 
720 
721 /*
722  *
723  */
724 static int
725 _lustre_ntv_code_to_descr( unsigned int EventCode, char *name, int len )
726 {
727  SUBDBG("ENTER: EventCode: %#x, name: %p, len: %d\n", EventCode, name, len);
728  int event=EventCode;
729 
730  if (event >=0 && event < num_events) {
731  strncpy( name, lustre_native_table[event]->description, len-1 );
732  name[len-1] = '\0';
733  SUBDBG("EXIT: description: %s\n", name);
734  return PAPI_OK;
735  }
736  SUBDBG("EXIT: PAPI_ENOEVNT\n");
737  return PAPI_ENOEVNT;
738 }
739 
740 
741 /*
742  *
743  */
744 static int
745 _lustre_ntv_enum_events( unsigned int *EventCode, int modifier )
746 {
747  SUBDBG("ENTER: EventCode: %p, modifier: %d\n", EventCode, modifier);
748 
749  if ( modifier == PAPI_ENUM_FIRST ) {
750  if (num_events==0) return PAPI_ENOEVNT;
751  *EventCode = 0;
752  SUBDBG("EXIT: *EventCode: %#x\n", *EventCode);
753  return PAPI_OK;
754  }
755 
756  if ( modifier == PAPI_ENUM_EVENTS ) {
757  int index = *EventCode;
758 
759  if ((index+1 < num_events) && lustre_native_table[index + 1]) {
760  *EventCode = *EventCode + 1;
761  SUBDBG("EXIT: *EventCode: %#x\n", *EventCode);
762  return PAPI_OK;
763  } else {
764  SUBDBG("EXIT: PAPI_ENOEVNT\n");
765  return PAPI_ENOEVNT;
766  }
767  }
768 
769 
770  SUBDBG("EXIT: PAPI_EINVAL\n");
771  return PAPI_EINVAL;
772 }
773 
774 
775 /*
776  *
777  */
779  .cmp_info = {
780  /* component information (unspecified values initialized to 0) */
781  .name = "lustre",
782  .short_name = "lustre",
783  .version = "1.9",
784  .description = "Lustre filesystem statistics",
785  .num_mpx_cntrs = LUSTRE_MAX_COUNTERS,
786  .num_cntrs = LUSTRE_MAX_COUNTERS,
787  .default_domain = PAPI_DOM_ALL,
788  .default_granularity = PAPI_GRN_SYS,
789  .available_granularities = PAPI_GRN_SYS,
790  .hardware_intr_sig = PAPI_INT_SIGNAL,
791 
792  /* component specific cmp_info initializations */
793  .fast_real_timer = 0,
794  .fast_virtual_timer = 0,
795  .attach = 0,
796  .attach_must_ptrace = 0,
797  .available_domains = PAPI_DOM_ALL,
798  },
799 
800  /* sizes of framework-opaque component-private structures */
801  .size = {
802  .context = sizeof ( LUSTRE_context_t ),
803  .control_state = sizeof ( LUSTRE_control_state_t ),
804  .reg_value = sizeof ( LUSTRE_register_t ),
805  .reg_alloc = sizeof ( LUSTRE_reg_alloc_t ),
806  },
807 
808  /* function pointers in this component */
809  .init_thread = _lustre_init_thread,
810  .init_component = _lustre_init_component,
811  .init_control_state = _lustre_init_control_state,
812  .start = _lustre_start,
813  .stop = _lustre_stop,
814  .read = _lustre_read,
815  .shutdown_thread = _lustre_shutdown_thread,
816  .shutdown_component = _lustre_shutdown_component,
817  .ctl = _lustre_ctl,
818  .update_control_state = _lustre_update_control_state,
819  .set_domain = _lustre_set_domain,
820  .reset = _lustre_reset,
821 
822  .ntv_enum_events = _lustre_ntv_enum_events,
823  .ntv_code_to_name = _lustre_ntv_code_to_name,
824  .ntv_code_to_descr = _lustre_ntv_code_to_descr,
825 
826 };
827 
828 
829 
830 
static int _lustre_ntv_enum_events(unsigned int *EventCode, int modifier)
Definition: linux-lustre.c:745
#define PAPI_OK
Definition: fpapi.h:105
struct lustre_fs_struct * next
Definition: linux-lustre.c:54
static counter_info * addCounter(const char *name, const char *desc, const char *unit)
Definition: linux-lustre.c:125
char disabled_reason[PAPI_MAX_STR_LEN]
Definition: papi.h:637
static int _lustre_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
Definition: linux-lustre.c:601
int close(int fd)
Definition: appio.c:175
#define PAPI_ENOMEM
Definition: fpapi.h:107
static const char * name
Definition: fork_overflow.c:31
#define PAPI_EINVAL
Definition: fpapi.h:106
papi_vector_t _lustre_vector
Definition: linux-lustre.c:94
static int _lustre_init_component(int cidx)
Definition: linux-lustre.c:443
#define papi_free(a)
Definition: papi_memory.h:35
long long difference[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:69
static int _lustre_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-lustre.c:551
static int _lustre_update_control_state(hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx)
Definition: linux-lustre.c:525
static int _lustre_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-lustre.c:577
#define PAPI_GRN_SYS
Definition: fpapi.h:71
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
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
char * proc_file
Definition: linux-lustre.c:49
Return codes and api definitions.
FILE * fff[MAX_EVENTS]
struct temp_event * next
char events[MAX_EVENTS][BUFSIZ]
#define PAPI_ESYS
Definition: fpapi.h:108
static int cidx
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:184
int which_counter[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:70
static int _lustre_ntv_code_to_name(unsigned int EventCode, char *name, int len)
Definition: linux-lustre.c:705
#define LUSTRE_MAX_COUNTERS
Definition: linux-lustre.c:57
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
static int native
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
counter_info * write_cntr
Definition: linux-lustre.c:51
static int num_events
Definition: linux-lustre.c:88
long long ret
Definition: iozone.c:1346
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:630
static void host_finalize(void)
Definition: linux-lustre.c:396
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 _lustre_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
Definition: linux-lustre.c:666
static int init_lustre_counters(void)
Definition: linux-lustre.c:257
counter_info LUSTRE_register_t
Definition: linux-lustre.c:60
char * buffer
Definition: iozone.c:1366
static int _lustre_shutdown_component(void)
Definition: linux-lustre.c:485
static int _lustre_shutdown_thread(hwd_context_t *ctx)
Definition: linux-lustre.c:497
static lustre_fs * root_lustre_fs
Definition: linux-lustre.c:92
unsigned long long value
Definition: linux-lustre.c:36
#define PATH_MAX
Definition: fileop.c:68
static counter_info ** lustre_native_table
Definition: linux-lustre.c:87
static void read_lustre_counter()
Definition: linux-lustre.c:347
static int _lustre_init_thread(hwd_context_t *ctx)
Definition: linux-lustre.c:473
#define PAPI_ENOEVNT
Definition: fpapi.h:112
LUSTRE_control_state_t state
Definition: linux-lustre.c:77
static int _lustre_set_domain(hwd_control_state_t *cntrl, int domain)
Definition: linux-lustre.c:688
counter_info * readahead_cntr
Definition: linux-lustre.c:53
static int _lustre_init_control_state(hwd_control_state_t *ctl)
Definition: linux-lustre.c:510
static int _lustre_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
Definition: linux-lustre.c:725
static int _lustre_reset(hwd_context_t *ctx, hwd_control_state_t *ctrl)
Definition: linux-lustre.c:632
static int addLustreFS(const char *name, const char *procpath_general, const char *procpath_readahead)
Definition: linux-lustre.c:165
#define PAPI_DOM_ALL
Definition: fpapi.h:25
static int resize_native_table()
Definition: linux-lustre.c:99
static long count
#define papi_calloc(a, b)
Definition: papi_memory.h:37
int i
Definition: fileop.c:140
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43