PAPI 7.1.0.0
Loading...
Searching...
No Matches
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
30typedef struct counter_info_struct
31{
32 int idx;
33 char *name;
35 char *unit;
36 unsigned long long value;
38
39typedef struct
40{
41 int count;
42 char **data;
44
45
47typedef 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
65typedef 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
75typedef struct LUSTRE_context
76{
79
80/* Default path to lustre stats */
81#ifdef FAKE_LUSTRE
82const char proc_base_path[] = "./components/lustre/fake_proc/fs/lustre/";
83#else
84const char proc_base_path[] = "/proc/fs/lustre/";
85#endif
86
88static int num_events = 0;
89static int table_size = 32;
90
91/* mount Lustre fs are kept in a list */
93
95
96/******************************************************************************
97 ******** BEGIN FUNCTIONS USED INTERNALLY SPECIFIC TO THIS COMPONENT ********
98 *****************************************************************************/
99static 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
124static counter_info *
125addCounter( 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
154SUBDBG("EXIT: cntr: %p\n", cntr);
155 return cntr;
156}
157
164static int
165addLustreFS( 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
256static 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 ptr = strstr(path,"llite/") + 6;
304 if (ptr == NULL) {
305 SUBDBG("Path: %s, missing llite directory, performance event not created.\n", path);
306 continue;
307 }
308
309 strncpy(fs_name, ptr, sizeof(fs_name)-1);
310 fs_name[sizeof(fs_name)-1] = '\0';
311
312 SUBDBG("found Lustre FS: %s\n", fs_name);
313
314 snprintf( path_stats, PATH_MAX - 1,
315 "%s/%s/stats",
316 lustre_dir,
317 entry->d_name );
318 SUBDBG("Found file %s\n", path_stats);
319
320 snprintf( path_readahead, PATH_MAX - 1,
321 "%s/%s/read_ahead_stats",
322 lustre_dir,
323 entry->d_name );
324 SUBDBG("Now checking for file %s\n", path_readahead);
325
326 strcpy( ptr, "read_ahead_stats" );
327 addLustreFS( fs_name, path_stats, path_readahead );
328 found_luster_fs++;
329 }
330 closedir( proc_dir );
331
332 if (found_luster_fs == 0) {
333 SUBDBG("EXIT: PAPI_ESYS (No luster file systems found)\n");
334 return PAPI_ESYS;
335 }
336
337 SUBDBG("EXIT: PAPI_OK\n");
338 return PAPI_OK;
339}
340
344static void
346{
348 FILE *fff;
349 char buffer[BUFSIZ];
350
351 while ( fs != NULL ) {
352
353 /* read values from stats file */
354 fff=fopen(fs->proc_file,"r" );
355 if (fff != NULL) {
356 while(1) {
357 if (fgets(buffer,BUFSIZ,fff)==NULL) break;
358
359 if (strstr( buffer, "write_bytes" )) {
360 sscanf(buffer,"%*s %*d %*s %*s %*d %*d %llu",&fs->write_cntr->value);
361 SUBDBG("Read %llu write_bytes\n",fs->write_cntr->value);
362 }
363
364 if (strstr( buffer, "read_bytes" )) {
365 sscanf(buffer,"%*s %*d %*s %*s %*d %*d %llu",&fs->read_cntr->value);
366 SUBDBG("Read %llu read_bytes\n",fs->read_cntr->value);
367 }
368 }
369 fclose(fff);
370 }
371
372 fff=fopen(fs->proc_file_readahead,"r");
373 if (fff != NULL) {
374 while(1) {
375 if (fgets(buffer,BUFSIZ,fff)==NULL) break;
376
377 if (strstr( buffer, "read but discarded")) {
378 sscanf(buffer,"%*s %*s %*s %llu",&fs->readahead_cntr->value);
379 SUBDBG("Read %llu discared\n",fs->readahead_cntr->value);
380 break;
381 }
382 }
383 fclose(fff);
384 }
385 fs = fs->next;
386 }
387}
388
389
393static void
395{
396 int i;
397 lustre_fs *fs, *next_fs;
398 counter_info *cntr;
399
400 for(i=0;i<num_events;i++) {
402 if ( cntr != NULL ) {
403 free( cntr->name );
404 free( cntr->description );
405 free( cntr->unit );
406 free( cntr );
407 }
409 }
410
411 papi_free(lustre_native_table); // Free the table itself.
412 lustre_native_table = NULL; // clear the pointer.
413 num_events = 0;
414 table_size = 32;
415
416 fs = root_lustre_fs;
417
418 while ( fs != NULL ) {
419 next_fs = fs->next;
420 free(fs->read_cntr);
421 free(fs->write_cntr);
422 free(fs->proc_file_readahead); // strdup.
423 free(fs->proc_file); // strdup.
424 free(fs); // malloc.
425 fs = next_fs;
426 }
427
428 root_lustre_fs = NULL;
429}
430
431
432/*****************************************************************************
433 ******************* BEGIN PAPI's COMPONENT REQUIRED FUNCTIONS *************
434 *****************************************************************************/
435
436/*
437 * Component setup and shutdown
438 */
439
440static int
442{
443 SUBDBG("ENTER:\n");
444 int ret = PAPI_OK;
445
448 if (ret!=PAPI_OK) {
450 "No lustre filesystems found",PAPI_MAX_STR_LEN);
451 host_finalize(); // cleanup.
452 SUBDBG("EXIT: ret: %d\n", ret);
453 goto fn_fail;
454 }
455
458
459 fn_exit:
460 _papi_hwd[cidx]->cmp_info.disabled = ret;
461 SUBDBG("EXIT: ret: %d\n", ret);
462 return ret;
463 fn_fail:
464 goto fn_exit;
465}
466
467
468
469
470
471/*
472 * This is called whenever a thread is initialized
473 */
474static int
476{
477 (void) ctx;
478
479 return PAPI_OK;
480}
481
482
483/*
484 *
485 */
486static int
488{
489 SUBDBG("ENTER:\n");
490 host_finalize( );
491 SUBDBG("EXIT:\n");
492 return PAPI_OK;
493}
494
495/*
496 *
497 */
498static int
500{
501 ( void ) ctx;
502
503 return PAPI_OK;
504}
505
506
507
508/*
509 * Control of counters (Reading/Writing/Starting/Stopping/Setup) functions
510 */
511static int
513{
515
516 memset(lustre_ctl->start_count,0,sizeof(long long)*LUSTRE_MAX_COUNTERS);
517 memset(lustre_ctl->current_count,0,sizeof(long long)*LUSTRE_MAX_COUNTERS);
518
519 return PAPI_OK;
520}
521
522
523/*
524 *
525 */
526static int
529 int count,
530 hwd_context_t *ctx )
531{
532 SUBDBG("ENTER: ctl: %p, native: %p, count: %d, ctx: %p\n", ctl, native, count, ctx);
534 ( void ) ctx;
535 int i, index;
536
537 for ( i = 0; i < count; i++ ) {
538 index = native[i].ni_event;
539 lustre_ctl->which_counter[i]=index;
540 native[i].ni_position = i;
541 }
542
543 lustre_ctl->num_events=count;
544 SUBDBG("EXIT: PAPI_OK\n");
545 return PAPI_OK;
546}
547
548
549/*
550 *
551 */
552static int
554{
555 ( void ) ctx;
556
558 int i;
559
561
562 for(i=0;i<lustre_ctl->num_events;i++) {
563 lustre_ctl->current_count[i]=
565 }
566
567 memcpy( lustre_ctl->start_count,
568 lustre_ctl->current_count,
569 LUSTRE_MAX_COUNTERS * sizeof ( long long ) );
570
571 return PAPI_OK;
572}
573
574
575/*
576 *
577 */
578static int
580{
581
582 (void) ctx;
584 int i;
585
587
588 for(i=0;i<lustre_ctl->num_events;i++) {
589 lustre_ctl->current_count[i]=
591 }
592
593 return PAPI_OK;
594
595}
596
597
598
599/*
600 *
601 */
602static int
604 long long **events, int flags )
605{
606 (void) ctx;
607 ( void ) flags;
608
610 int i;
611
613
614 for(i=0;i<lustre_ctl->num_events;i++) {
615 lustre_ctl->current_count[i]=
617 lustre_ctl->difference[i]=lustre_ctl->current_count[i]-
618 lustre_ctl->start_count[i];
619 }
620
621 *events = lustre_ctl->difference;
622
623 return PAPI_OK;
624
625}
626
627
628
629
630/*
631 *
632 */
633static int
635{
636
637 /* re-initializes counter_start values to current */
638
639 _lustre_start(ctx,ctrl);
640
641 return PAPI_OK;
642}
643
644
645/*
646 * Unused lustre write function
647 */
648/* static int */
649/* _lustre_write( hwd_context_t * ctx, hwd_control_state_t * ctrl, long long *from ) */
650/* { */
651/* ( void ) ctx; */
652/* ( void ) ctrl; */
653/* ( void ) from; */
654
655/* return PAPI_OK; */
656/* } */
657
658
659/*
660 * Functions for setting up various options
661 */
662
663/* This function sets various options in the component
664 * The valid codes being passed in are PAPI_SET_DEFDOM,
665 * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT
666 */
667static int
668_lustre_ctl( hwd_context_t * ctx, int code, _papi_int_option_t * option )
669{
670 ( void ) ctx;
671 ( void ) code;
672 ( void ) option;
673
674 return PAPI_OK;
675}
676
677
678/*
679 * This function can be used to set the event set level domains
680 * where the events should be counted. In particular: PAPI_DOM_USER,
681 * PAPI_DOM_KERNEL PAPI_DOM_OTHER. But the lustre component does not
682 * provide a field in its control_state (LUSTRE_control_state_t) to
683 * save this information. It would also need some way to control when
684 * the counts get updated in order to support domain filters for
685 * event counting.
686 *
687 * So we just ignore this call.
688 */
689static int
691{
692 ( void ) cntrl;
693 ( void ) domain;
694 SUBDBG("ENTER: \n");
695
696 // this component does not allow limiting which domains will increment event counts
697
698 SUBDBG("EXIT: PAPI_OK\n");
699 return PAPI_OK;
700}
701
702
703/*
704 *
705 */
706static int
707_lustre_ntv_code_to_name( unsigned int EventCode, char *name, int len )
708{
709 SUBDBG("ENTER: EventCode: %#x, name: %p, len: %d\n", EventCode, name, len);
710 int event=EventCode;
711
712 if (event >=0 && event < num_events) {
713 strncpy( name, lustre_native_table[event]->name, len-1 );
714 name[len-1] = '\0';
715 SUBDBG("EXIT: event name: %s\n", name);
716 return PAPI_OK;
717 }
718 SUBDBG("EXIT: PAPI_ENOEVNT\n");
719 return PAPI_ENOEVNT;
720}
721
722
723/*
724 *
725 */
726static int
727_lustre_ntv_code_to_descr( unsigned int EventCode, char *name, int len )
728{
729 SUBDBG("ENTER: EventCode: %#x, name: %p, len: %d\n", EventCode, name, len);
730 int event=EventCode;
731
732 if (event >=0 && event < num_events) {
733 strncpy( name, lustre_native_table[event]->description, len-1 );
734 name[len-1] = '\0';
735 SUBDBG("EXIT: description: %s\n", name);
736 return PAPI_OK;
737 }
738 SUBDBG("EXIT: PAPI_ENOEVNT\n");
739 return PAPI_ENOEVNT;
740}
741
742
743/*
744 *
745 */
746static int
747_lustre_ntv_enum_events( unsigned int *EventCode, int modifier )
748{
749 SUBDBG("ENTER: EventCode: %p, modifier: %d\n", EventCode, modifier);
750
751 if ( modifier == PAPI_ENUM_FIRST ) {
752 if (num_events==0) return PAPI_ENOEVNT;
753 *EventCode = 0;
754 SUBDBG("EXIT: *EventCode: %#x\n", *EventCode);
755 return PAPI_OK;
756 }
757
758 if ( modifier == PAPI_ENUM_EVENTS ) {
759 int index = *EventCode;
760
761 if ((index+1 < num_events) && lustre_native_table[index + 1]) {
762 *EventCode = *EventCode + 1;
763 SUBDBG("EXIT: *EventCode: %#x\n", *EventCode);
764 return PAPI_OK;
765 } else {
766 SUBDBG("EXIT: PAPI_ENOEVNT\n");
767 return PAPI_ENOEVNT;
768 }
769 }
770
771
772 SUBDBG("EXIT: PAPI_EINVAL\n");
773 return PAPI_EINVAL;
774}
775
776
777/*
778 *
779 */
781 .cmp_info = {
782 /* component information (unspecified values initialized to 0) */
783 .name = "lustre",
784 .short_name = "lustre",
785 .version = "1.9",
786 .description = "Lustre filesystem statistics",
787 .num_mpx_cntrs = LUSTRE_MAX_COUNTERS,
788 .num_cntrs = LUSTRE_MAX_COUNTERS,
789 .default_domain = PAPI_DOM_ALL,
790 .default_granularity = PAPI_GRN_SYS,
791 .available_granularities = PAPI_GRN_SYS,
792 .hardware_intr_sig = PAPI_INT_SIGNAL,
793
794 /* component specific cmp_info initializations */
795 .fast_real_timer = 0,
796 .fast_virtual_timer = 0,
797 .attach = 0,
798 .attach_must_ptrace = 0,
799 .available_domains = PAPI_DOM_ALL,
800 },
801
802 /* sizes of framework-opaque component-private structures */
803 .size = {
804 .context = sizeof ( LUSTRE_context_t ),
805 .control_state = sizeof ( LUSTRE_control_state_t ),
806 .reg_value = sizeof ( LUSTRE_register_t ),
807 .reg_alloc = sizeof ( LUSTRE_reg_alloc_t ),
808 },
809
810 /* function pointers in this component */
811 .init_thread = _lustre_init_thread,
812 .init_component = _lustre_init_component,
813 .init_control_state = _lustre_init_control_state,
814 .start = _lustre_start,
815 .stop = _lustre_stop,
816 .read = _lustre_read,
817 .shutdown_thread = _lustre_shutdown_thread,
818 .shutdown_component = _lustre_shutdown_component,
819 .ctl = _lustre_ctl,
820 .update_control_state = _lustre_update_control_state,
821 .set_domain = _lustre_set_domain,
822 .reset = _lustre_reset,
823
824 .ntv_enum_events = _lustre_ntv_enum_events,
825 .ntv_code_to_name = _lustre_ntv_code_to_name,
826 .ntv_code_to_descr = _lustre_ntv_code_to_descr,
827
828};
829
830
831
832
int i
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:188
int close(int fd)
Definition: appio.c:179
static long count
struct papi_vectors * _papi_hwd[]
#define PAPI_ENUM_EVENTS
Definition: f90papi.h:224
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_ENUM_FIRST
Definition: f90papi.h:85
#define PAPI_ENOEVNT
Definition: f90papi.h:139
#define PAPI_EINVAL
Definition: f90papi.h:115
#define PAPI_MAX_STR_LEN
Definition: f90papi.h:77
#define PAPI_ESYS
Definition: f90papi.h:136
#define PAPI_GRN_SYS
Definition: f90papi.h:43
#define PAPI_ENOMEM
Definition: f90papi.h:16
#define PAPI_DOM_ALL
Definition: f90papi.h:261
FILE * fff[MAX_EVENTS]
char events[MAX_EVENTS][BUFSIZ]
static struct temp_event * last
static int _lustre_shutdown_component(void)
Definition: linux-lustre.c:487
static void host_finalize(void)
Definition: linux-lustre.c:394
static void read_lustre_counter()
Definition: linux-lustre.c:345
static int num_events
Definition: linux-lustre.c:88
static counter_info * addCounter(const char *name, const char *desc, const char *unit)
Definition: linux-lustre.c:125
static int _lustre_init_component(int cidx)
Definition: linux-lustre.c:441
static int _lustre_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
Definition: linux-lustre.c:668
static int _lustre_reset(hwd_context_t *ctx, hwd_control_state_t *ctrl)
Definition: linux-lustre.c:634
static int init_lustre_counters(void)
Definition: linux-lustre.c:257
static int _lustre_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-lustre.c:579
static int _lustre_init_control_state(hwd_control_state_t *ctl)
Definition: linux-lustre.c:512
papi_vector_t _lustre_vector
Definition: linux-lustre.c:94
static lustre_fs * root_lustre_fs
Definition: linux-lustre.c:92
const char proc_base_path[]
Definition: linux-lustre.c:84
static int _lustre_set_domain(hwd_control_state_t *cntrl, int domain)
Definition: linux-lustre.c:690
static int addLustreFS(const char *name, const char *procpath_general, const char *procpath_readahead)
Definition: linux-lustre.c:165
static int _lustre_ntv_enum_events(unsigned int *EventCode, int modifier)
Definition: linux-lustre.c:747
static int resize_native_table()
Definition: linux-lustre.c:99
#define LUSTRE_MAX_COUNTERS
Definition: linux-lustre.c:57
static int _lustre_shutdown_thread(hwd_context_t *ctx)
Definition: linux-lustre.c:499
static int _lustre_ntv_code_to_descr(unsigned int EventCode, char *name, int len)
Definition: linux-lustre.c:727
static int _lustre_update_control_state(hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx)
Definition: linux-lustre.c:527
static int _lustre_init_thread(hwd_context_t *ctx)
Definition: linux-lustre.c:475
static int table_size
Definition: linux-lustre.c:89
static int _lustre_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-lustre.c:553
static int _lustre_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
Definition: linux-lustre.c:603
counter_info LUSTRE_native_event_entry_t
Definition: linux-lustre.c:61
counter_info LUSTRE_register_t
Definition: linux-lustre.c:60
counter_info LUSTRE_reg_alloc_t
Definition: linux-lustre.c:62
static int _lustre_ntv_code_to_name(unsigned int EventCode, char *name, int len)
Definition: linux-lustre.c:707
static counter_info ** lustre_native_table
Definition: linux-lustre.c:87
Return codes and api definitions.
#define SUBDBG(format, args...)
Definition: papi_debug.h:64
int fclose(FILE *__stream)
#define PAPI_INT_SIGNAL
Definition: papi_internal.h:52
#define papi_calloc(a, b)
Definition: papi_memory.h:37
#define papi_free(a)
Definition: papi_memory.h:35
static int native
static int cidx
const char * name
Definition: rocs.c:225
LUSTRE_control_state_t state
Definition: linux-lustre.c:77
long long current_count[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:68
long long start_count[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:67
long long difference[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:69
int which_counter[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:70
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:627
char disabled_reason[PAPI_HUGE_STR_LEN]
Definition: papi.h:634
char * description
Definition: linux-lustre.c:34
unsigned long long value
Definition: linux-lustre.c:36
char * proc_file
Definition: linux-lustre.c:49
char * proc_file_readahead
Definition: linux-lustre.c:50
struct lustre_fs_struct * next
Definition: linux-lustre.c:54
counter_info * readahead_cntr
Definition: linux-lustre.c:53
counter_info * read_cntr
Definition: linux-lustre.c:52
counter_info * write_cntr
Definition: linux-lustre.c:51
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
char ** data
Definition: linux-lustre.c:42
struct temp_event * next