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