PAPI 7.1.0.0
Loading...
Searching...
No Matches
linux-lustre.c File Reference

A component for the lustre filesystem. More...

Include dependency graph for linux-lustre.c:

Go to the source code of this file.

Data Structures

struct  STEALTIME_reg_alloc_t
 
struct  string_list
 
struct  lustre_fs
 
struct  LUSTRE_control_state_t
 
struct  LUSTRE_context_t
 

Macros

#define LUSTRE_MAX_COUNTERS   100
 
#define LUSTRE_MAX_COUNTER_TERMS   LUSTRE_MAX_COUNTERS
 

Typedefs

typedef counter_info LUSTRE_register_t
 
typedef counter_info LUSTRE_native_event_entry_t
 
typedef counter_info LUSTRE_reg_alloc_t
 

Functions

static int resize_native_table ()
 
static counter_infoaddCounter (const char *name, const char *desc, const char *unit)
 
static int addLustreFS (const char *name, const char *procpath_general, const char *procpath_readahead)
 
static int init_lustre_counters (void)
 
static void read_lustre_counter ()
 
static void host_finalize (void)
 
static int _lustre_init_component (int cidx)
 
static int _lustre_init_thread (hwd_context_t *ctx)
 
static int _lustre_shutdown_component (void)
 
static int _lustre_shutdown_thread (hwd_context_t *ctx)
 
static int _lustre_init_control_state (hwd_control_state_t *ctl)
 
static int _lustre_update_control_state (hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx)
 
static int _lustre_start (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
static int _lustre_stop (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
static int _lustre_read (hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
 
static int _lustre_reset (hwd_context_t *ctx, hwd_control_state_t *ctrl)
 
static int _lustre_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option)
 
static int _lustre_set_domain (hwd_control_state_t *cntrl, int domain)
 
static int _lustre_ntv_code_to_name (unsigned int EventCode, char *name, int len)
 
static int _lustre_ntv_code_to_descr (unsigned int EventCode, char *name, int len)
 
static int _lustre_ntv_enum_events (unsigned int *EventCode, int modifier)
 

Variables

const char proc_base_path [] = "/proc/fs/lustre/"
 
static counter_info ** lustre_native_table = NULL
 
static int num_events = 0
 
static int table_size = 32
 
static lustre_fsroot_lustre_fs = NULL
 
papi_vector_t _lustre_vector
 

Detailed Description

Author
Haihang You (in collaboration with Michael Kluge, TU Dresden) you@e.nosp@m.ecs..nosp@m.utk.e.nosp@m.du
Heike Jagode jagod.nosp@m.e@ee.nosp@m.cs.ut.nosp@m.k.ed.nosp@m.u
Vince Weaver vweav.nosp@m.er1@.nosp@m.eecs..nosp@m.utk..nosp@m.edu

Definition in file linux-lustre.c.

Macro Definition Documentation

◆ LUSTRE_MAX_COUNTER_TERMS

#define LUSTRE_MAX_COUNTER_TERMS   LUSTRE_MAX_COUNTERS

Definition at line 58 of file linux-lustre.c.

◆ LUSTRE_MAX_COUNTERS

#define LUSTRE_MAX_COUNTERS   100

Definition at line 57 of file linux-lustre.c.

Typedef Documentation

◆ LUSTRE_native_event_entry_t

Definition at line 61 of file linux-lustre.c.

◆ LUSTRE_reg_alloc_t

Definition at line 62 of file linux-lustre.c.

◆ LUSTRE_register_t

Definition at line 60 of file linux-lustre.c.

Function Documentation

◆ _lustre_ctl()

static int _lustre_ctl ( hwd_context_t ctx,
int  code,
_papi_int_option_t option 
)
static

Definition at line 668 of file linux-lustre.c.

669{
670 ( void ) ctx;
671 ( void ) code;
672 ( void ) option;
673
674 return PAPI_OK;
675}
#define PAPI_OK
Definition: f90papi.h:73

◆ _lustre_init_component()

static int _lustre_init_component ( int  cidx)
static

Definition at line 441 of file linux-lustre.c.

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}
struct papi_vectors * _papi_hwd[]
#define PAPI_MAX_STR_LEN
Definition: f90papi.h:77
static void host_finalize(void)
Definition: linux-lustre.c:394
static int num_events
Definition: linux-lustre.c:88
static int init_lustre_counters(void)
Definition: linux-lustre.c:257
papi_vector_t _lustre_vector
Definition: linux-lustre.c:94
static int resize_native_table()
Definition: linux-lustre.c:99
#define SUBDBG(format, args...)
Definition: papi_debug.h:64
static int cidx
char disabled_reason[PAPI_HUGE_STR_LEN]
Definition: papi.h:634
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
Here is the call graph for this function:

◆ _lustre_init_control_state()

static int _lustre_init_control_state ( hwd_control_state_t ctl)
static

Definition at line 512 of file linux-lustre.c.

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}
#define LUSTRE_MAX_COUNTERS
Definition: linux-lustre.c:57
long long current_count[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:68
long long start_count[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:67

◆ _lustre_init_thread()

static int _lustre_init_thread ( hwd_context_t ctx)
static

Definition at line 475 of file linux-lustre.c.

476{
477 (void) ctx;
478
479 return PAPI_OK;
480}

◆ _lustre_ntv_code_to_descr()

static int _lustre_ntv_code_to_descr ( unsigned int  EventCode,
char *  name,
int  len 
)
static

Definition at line 727 of file linux-lustre.c.

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}
#define PAPI_ENOEVNT
Definition: f90papi.h:139
static counter_info ** lustre_native_table
Definition: linux-lustre.c:87
const char * name
Definition: rocs.c:225

◆ _lustre_ntv_code_to_name()

static int _lustre_ntv_code_to_name ( unsigned int  EventCode,
char *  name,
int  len 
)
static

Definition at line 707 of file linux-lustre.c.

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}

◆ _lustre_ntv_enum_events()

static int _lustre_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)
static

Definition at line 747 of file linux-lustre.c.

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}
#define PAPI_ENUM_EVENTS
Definition: f90papi.h:224
#define PAPI_ENUM_FIRST
Definition: f90papi.h:85
#define PAPI_EINVAL
Definition: f90papi.h:115

◆ _lustre_read()

static int _lustre_read ( hwd_context_t ctx,
hwd_control_state_t ctl,
long long **  events,
int  flags 
)
static

Definition at line 603 of file linux-lustre.c.

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}
int i
char events[MAX_EVENTS][BUFSIZ]
static void read_lustre_counter()
Definition: linux-lustre.c:345
long long difference[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:69
int which_counter[LUSTRE_MAX_COUNTERS]
Definition: linux-lustre.c:70
unsigned long long value
Definition: linux-lustre.c:36
Here is the call graph for this function:

◆ _lustre_reset()

static int _lustre_reset ( hwd_context_t ctx,
hwd_control_state_t ctrl 
)
static

Definition at line 634 of file linux-lustre.c.

635{
636
637 /* re-initializes counter_start values to current */
638
639 _lustre_start(ctx,ctrl);
640
641 return PAPI_OK;
642}
static int _lustre_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: linux-lustre.c:553
Here is the call graph for this function:

◆ _lustre_set_domain()

static int _lustre_set_domain ( hwd_control_state_t cntrl,
int  domain 
)
static

Definition at line 690 of file linux-lustre.c.

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}

◆ _lustre_shutdown_component()

static int _lustre_shutdown_component ( void  )
static

Definition at line 487 of file linux-lustre.c.

488{
489 SUBDBG("ENTER:\n");
490 host_finalize( );
491 SUBDBG("EXIT:\n");
492 return PAPI_OK;
493}
Here is the call graph for this function:

◆ _lustre_shutdown_thread()

static int _lustre_shutdown_thread ( hwd_context_t ctx)
static

Definition at line 499 of file linux-lustre.c.

500{
501 ( void ) ctx;
502
503 return PAPI_OK;
504}

◆ _lustre_start()

static int _lustre_start ( hwd_context_t ctx,
hwd_control_state_t ctl 
)
static

Definition at line 553 of file linux-lustre.c.

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}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _lustre_stop()

static int _lustre_stop ( hwd_context_t ctx,
hwd_control_state_t ctl 
)
static

Definition at line 579 of file linux-lustre.c.

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}
Here is the call graph for this function:

◆ _lustre_update_control_state()

static int _lustre_update_control_state ( hwd_control_state_t ctl,
NativeInfo_t native,
int  count,
hwd_context_t ctx 
)
static

Definition at line 527 of file linux-lustre.c.

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}
static long count
static int native

◆ addCounter()

static counter_info * addCounter ( const char *  name,
const char *  desc,
const char *  unit 
)
static

add a counter to the list of available counters

Parameters
namethe short name of the counter
desca longer description
unitthe unit for this counter

Definition at line 125 of file linux-lustre.c.

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}
static int table_size
Definition: linux-lustre.c:89
char * description
Definition: linux-lustre.c:34
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addLustreFS()

static int addLustreFS ( const char *  name,
const char *  procpath_general,
const char *  procpath_readahead 
)
static

adds a Lustre fs to the fs list and creates the counters for it

Parameters
namefs name
procpath_generalpath to the 'stats' file in /proc/fs/lustre/... for this fs
procpath_readaheadpath to the 'readahead' file in /proc/fs/lustre/... for this fs

Definition at line 165 of file linux-lustre.c.

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}
#define PAPI_ESYS
Definition: f90papi.h:136
#define PAPI_ENOMEM
Definition: f90papi.h:16
FILE * fff[MAX_EVENTS]
static struct temp_event * last
static counter_info * addCounter(const char *name, const char *desc, const char *unit)
Definition: linux-lustre.c:125
static lustre_fs * root_lustre_fs
Definition: linux-lustre.c:92
int fclose(FILE *__stream)
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
struct temp_event * next
Here is the call graph for this function:
Here is the caller graph for this function:

◆ host_finalize()

static void host_finalize ( void  )
static

frees all allocated resources

Definition at line 394 of file linux-lustre.c.

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}
#define papi_free(a)
Definition: papi_memory.h:35
Here is the caller graph for this function:

◆ init_lustre_counters()

static int init_lustre_counters ( void  )
static

goes through proc and tries to discover all mounted Lustre fs

Definition at line 257 of file linux-lustre.c.

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}
int open(const char *pathname, int flags, mode_t mode)
Definition: appio.c:188
int close(int fd)
Definition: appio.c:179
const char proc_base_path[]
Definition: linux-lustre.c:84
static int addLustreFS(const char *name, const char *procpath_general, const char *procpath_readahead)
Definition: linux-lustre.c:165
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_lustre_counter()

static void read_lustre_counter ( )
static

updates all Lustre related counters

Definition at line 345 of file linux-lustre.c.

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}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize_native_table()

static int resize_native_table ( )
static

Definition at line 99 of file linux-lustre.c.

99 {
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}
#define papi_calloc(a, b)
Definition: papi_memory.h:37
Here is the caller graph for this function:

Variable Documentation

◆ _lustre_vector

papi_vector_t _lustre_vector

Definition at line 94 of file linux-lustre.c.

◆ lustre_native_table

counter_info** lustre_native_table = NULL
static

Definition at line 87 of file linux-lustre.c.

◆ num_events

int num_events = 0
static

Definition at line 88 of file linux-lustre.c.

◆ proc_base_path

const char proc_base_path[] = "/proc/fs/lustre/"

Definition at line 84 of file linux-lustre.c.

◆ root_lustre_fs

lustre_fs* root_lustre_fs = NULL
static

Definition at line 92 of file linux-lustre.c.

◆ table_size

int table_size = 32
static

Definition at line 89 of file linux-lustre.c.