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