PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-net.c File Reference

net component This file contains the source code for a component that enables PAPI-C to access network statistics through the /proc file system. This component will dynamically create a native events table for all the interfaces listed in /proc/net/dev (16 entries for each interface). More...

Include dependency graph for linux-net.c:

Go to the source code of this file.

Data Structures

struct  temp_event
 
struct  net_counters
 

Macros

#define NET_REFRESH_LATENCY   1000000
 
#define NET_PROC_FILE   "/proc/net/dev"
 
#define NET_PROC_MAX_LINE   (IFNAMSIZ + 16 * (20 + 1) + 16)
 
#define NET_INVALID_RESULT   -1
 
#define NET_INTERFACE_COUNTERS   16
 

Functions

static int generateNetEventList (void)
 
static int getInterfaceBaseIndex (const char *ifname)
 
static int read_net_counters (long long *values)
 
int _net_init_thread (hwd_context_t *ctx)
 
int _net_init_component (int cidx)
 
int _net_init_control_state (hwd_control_state_t *ctl)
 
int _net_start (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
int _net_read (hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
 
int _net_stop (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
int _net_shutdown_thread (hwd_context_t *ctx)
 
int _net_shutdown_component (void)
 
int _net_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option)
 
int _net_update_control_state (hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx)
 
int _net_set_domain (hwd_control_state_t *ctl, int domain)
 
int _net_reset (hwd_context_t *ctx, hwd_control_state_t *ctl)
 
int _net_ntv_enum_events (unsigned int *EventCode, int modifier)
 
int _net_ntv_name_to_code (char *name, unsigned int *EventCode)
 
int _net_ntv_code_to_name (unsigned int EventCode, char *name, int len)
 
int _net_ntv_code_to_descr (unsigned int EventCode, char *name, int len)
 
int _net_ntv_code_to_bits (unsigned int EventCode, hwd_register_t *bits)
 

Variables

papi_vector_t _net_vector
 
static NET_native_event_entry_t_net_native_events =NULL
 
static int num_events = 0
 
static int is_initialized = 0
 
static long long _net_register_start [NET_MAX_COUNTERS]
 
static long long _net_register_current [NET_MAX_COUNTERS]
 
static struct temp_eventroot = NULL
 
static struct net_counters _net_counter_info [NET_INTERFACE_COUNTERS]
 

Detailed Description

Author
Haihang You you@c.nosp@m.s.ut.nosp@m.k.edu
Jose Pedro Oliveira jpo@d.nosp@m.i.um.nosp@m.inho..nosp@m.pt

Definition in file linux-net.c.

Macro Definition Documentation

#define NET_INTERFACE_COUNTERS   16

Definition at line 71 of file linux-net.c.

#define NET_INVALID_RESULT   -1

Definition at line 51 of file linux-net.c.

#define NET_PROC_FILE   "/proc/net/dev"

Definition at line 44 of file linux-net.c.

#define NET_PROC_MAX_LINE   (IFNAMSIZ + 16 * (20 + 1) + 16)

Definition at line 49 of file linux-net.c.

#define NET_REFRESH_LATENCY   1000000

Definition at line 42 of file linux-net.c.

Function Documentation

int _net_ctl ( hwd_context_t ctx,
int  code,
_papi_int_option_t option 
)

Definition at line 469 of file linux-net.c.

470 {
471  ( void ) ctx;
472  ( void ) code;
473  ( void ) option;
474 
475  return PAPI_OK;
476 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
int _net_init_component ( int  cidx)

Definition at line 299 of file linux-net.c.

300 {
301  int i = 0;
302  struct temp_event *t, *last;
303 
304  if ( is_initialized )
305  return PAPI_OK;
306 
311 
312  is_initialized = 1;
313 
314  /* The network interfaces are listed in /proc/net/dev */
316 
317  if ( num_events < 0 ) /* PAPI errors */
318  return num_events;
319 
320  if ( num_events == 0 ) /* No network interfaces found */
321  return PAPI_OK;
322 
323  t = root;
326  do {
327  strncpy(_net_native_events[i].name, t->name, PAPI_MAX_STR_LEN-1);
332  last = t;
333  t = t->next;
334  papi_free(last);
335  i++;
336  } while (t != NULL);
337  root = NULL;
338 
339  /* Export the total number of events available */
341 
342  /* Export the component id */
344 
345  return PAPI_OK;
346 }
memset(eventId, 0, size)
#define papi_free(a)
Definition: papi_memory.h:35
static long long _net_register_start[NET_MAX_COUNTERS]
Definition: linux-net.c:59
#define papi_malloc(a)
Definition: papi_memory.h:34
static int num_events
char name[PAPI_MAX_STR_LEN]
Definition: linux-net.h:55
papi_vector_t _net_vector
Definition: linux-net.c:35
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
static int is_initialized
Definition: linux-net.c:57
struct temp_event * next
char name[PAPI_MAX_STR_LEN]
t
Definition: iozone.c:23562
Definition: linux-net.h:52
int i
Definition: fileop.c:140
#define NET_MAX_COUNTERS
Definition: linux-net.h:34
static int cidx
Definition: event_info.c:40
unsigned int selector
Definition: linux-net.h:40
char description[PAPI_MAX_STR_LEN]
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
static struct temp_event * last
static int generateNetEventList(void)
Definition: linux-net.c:106
NET_register_t resources
Definition: linux-net.h:54
static struct temp_event * root
Definition: linux-net.c:68
char * name
Definition: iozone.c:23648
#define PAPI_MAX_STR_LEN
Definition: papi.h:463
char description[PAPI_MAX_STR_LEN]
Definition: linux-net.h:56
static long long _net_register_current[NET_MAX_COUNTERS]
Definition: linux-net.c:60

Here is the call graph for this function:

int _net_init_control_state ( hwd_control_state_t ctl)

Definition at line 354 of file linux-net.c.

355 {
356  ( void ) ctl;
357 
358  return PAPI_OK;
359 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
int _net_init_thread ( hwd_context_t ctx)

Definition at line 286 of file linux-net.c.

287 {
288  ( void ) ctx;
289 
290  return PAPI_OK;
291 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
int _net_ntv_code_to_bits ( unsigned int  EventCode,
hwd_register_t bits 
)

Definition at line 621 of file linux-net.c.

622 {
623  int index = EventCode;
624 
625  if ( index >= 0 && index < num_events ) {
626  memcpy( ( NET_register_t * ) bits,
627  &( _net_native_events[index].resources ),
628  sizeof ( NET_register_t ) );
629  return PAPI_OK;
630  }
631 
632  return PAPI_ENOEVNT;
633 }
#define PAPI_ENOEVNT
Definition: papi.h:258
static int num_events
return PAPI_OK
Definition: linux-nvml.c:458
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
int _net_ntv_code_to_descr ( unsigned int  EventCode,
char *  name,
int  len 
)

Definition at line 604 of file linux-net.c.

605 {
606  int index = EventCode;
607 
608  if ( index >= 0 && index < num_events ) {
609  strncpy( name, _net_native_events[index].description, len );
610  return PAPI_OK;
611  }
612 
613  return PAPI_ENOEVNT;
614 }
#define PAPI_ENOEVNT
Definition: papi.h:258
static int num_events
return PAPI_OK
Definition: linux-nvml.c:458
char description[PAPI_MAX_STR_LEN]
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
char * name
Definition: iozone.c:23648
int _net_ntv_code_to_name ( unsigned int  EventCode,
char *  name,
int  len 
)

Definition at line 587 of file linux-net.c.

588 {
589  int index = EventCode;
590 
591  if ( index >= 0 && index < num_events ) {
592  strncpy( name, _net_native_events[index].name, len );
593  return PAPI_OK;
594  }
595 
596  return PAPI_ENOEVNT;
597 }
#define PAPI_ENOEVNT
Definition: papi.h:258
static int num_events
return PAPI_OK
Definition: linux-nvml.c:458
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
char * name
Definition: iozone.c:23648
int _net_ntv_enum_events ( unsigned int EventCode,
int  modifier 
)

Definition at line 532 of file linux-net.c.

533 {
534  int index;
535 
536  switch ( modifier ) {
537  case PAPI_ENUM_FIRST:
538  if (num_events==0) {
539  return PAPI_ENOEVNT;
540  }
541  *EventCode = 0;
542  return PAPI_OK;
543  break;
544 
545  case PAPI_ENUM_EVENTS:
546  index = *EventCode;
547  if ( index < num_events - 1 ) {
548  *EventCode = *EventCode + 1;
549  return PAPI_OK;
550  } else {
551  return PAPI_ENOEVNT;
552  }
553  break;
554 
555  default:
556  return PAPI_EINVAL;
557  break;
558  }
559  return PAPI_EINVAL;
560 }
#define PAPI_ENOEVNT
Definition: papi.h:258
static int num_events
return PAPI_OK
Definition: linux-nvml.c:458
return PAPI_EINVAL
Definition: linux-nvml.c:408
int _net_ntv_name_to_code ( char *  name,
unsigned int EventCode 
)

Definition at line 567 of file linux-net.c.

568 {
569  int i;
570 
571  for ( i=0; i<num_events; i++) {
572  if (strcmp(name, _net_native_events[i].name) == 0) {
573  *EventCode = i;
574 
575  return PAPI_OK;
576  }
577  }
578 
579  return PAPI_ENOEVNT;
580 }
#define PAPI_ENOEVNT
Definition: papi.h:258
static int num_events
return PAPI_OK
Definition: linux-nvml.c:458
int i
Definition: fileop.c:140
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
char * name
Definition: iozone.c:23648
int _net_read ( hwd_context_t ctx,
hwd_control_state_t ctl,
long long **  events,
int  flags 
)

Definition at line 385 of file linux-net.c.

387 {
388  (void) flags;
389  (void) ctx;
390 
391  NET_control_state_t *net_ctl = (NET_control_state_t *) ctl;
392  long long now = PAPI_get_real_usec();
393  int i;
394 
395  /* Caching
396  * Only read new values from /proc if enough time has passed
397  * since the last read.
398  */
399  if ( now - net_ctl->lastupdate > NET_REFRESH_LATENCY ) {
401  for ( i=0; i<NET_MAX_COUNTERS; i++ ) {
403  }
404  net_ctl->lastupdate = now;
405  }
406  *events = net_ctl->values;
407 
408  return PAPI_OK;
409 }
long long flags
Definition: iozone.c:12330
long long values[NET_MAX_COUNTERS]
Definition: linux-net.h:68
static long long _net_register_start[NET_MAX_COUNTERS]
Definition: linux-net.c:59
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
char events[MAX_EVENTS][BUFSIZ]
int i
Definition: fileop.c:140
#define NET_MAX_COUNTERS
Definition: linux-net.h:34
long long lastupdate
Definition: linux-net.h:69
long long PAPI_get_real_usec(void)
Definition: papi.c:6190
#define NET_REFRESH_LATENCY
Definition: linux-net.c:42
static int read_net_counters(long long *values)
Definition: linux-net.c:200
static long long _net_register_current[NET_MAX_COUNTERS]
Definition: linux-net.c:60

Here is the call graph for this function:

int _net_reset ( hwd_context_t ctx,
hwd_control_state_t ctl 
)

Definition at line 519 of file linux-net.c.

520 {
521  ( void ) ctx;
522  ( void ) ctl;
523 
524  return PAPI_OK;
525 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
int _net_set_domain ( hwd_control_state_t ctl,
int  domain 
)

Definition at line 508 of file linux-net.c.

509 {
510  ( void ) ctl;
511  if ( PAPI_DOM_ALL != domain )
512  return PAPI_EINVAL;
513 
514  return PAPI_OK;
515 }
#define PAPI_DOM_ALL
Definition: papi.h:301
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
return PAPI_EINVAL
Definition: linux-nvml.c:408
int _net_shutdown_component ( void  )

Definition at line 447 of file linux-net.c.

448 {
449  if ( is_initialized )
450  {
451  is_initialized = 0;
452  if (_net_native_events != NULL)
453  {
455  _net_native_events = NULL;
456  }
457  }
458 
459  return PAPI_OK;
460 }
#define papi_free(a)
Definition: papi_memory.h:35
return PAPI_OK
Definition: linux-nvml.c:458
static int is_initialized
Definition: linux-net.c:57
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
int _net_shutdown_thread ( hwd_context_t ctx)

Definition at line 435 of file linux-net.c.

436 {
437  ( void ) ctx;
438 
439  return PAPI_OK;
440 }
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
int _net_start ( hwd_context_t ctx,
hwd_control_state_t ctl 
)

Definition at line 363 of file linux-net.c.

364 {
365  ( void ) ctx;
366 
367  NET_control_state_t *net_ctl = (NET_control_state_t *) ctl;
368  long long now = PAPI_get_real_usec();
369 
373 
374  /* set initial values to 0 */
375  memset(net_ctl->values, 0, NET_MAX_COUNTERS*sizeof(net_ctl->values[0]));
376 
377  /* Set last access time for caching purposes */
378  net_ctl->lastupdate = now;
379 
380  return PAPI_OK;
381 }
memset(eventId, 0, size)
long long values[NET_MAX_COUNTERS]
Definition: linux-net.h:68
static long long _net_register_start[NET_MAX_COUNTERS]
Definition: linux-net.c:59
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
#define NET_MAX_COUNTERS
Definition: linux-net.h:34
long long lastupdate
Definition: linux-net.h:69
long long PAPI_get_real_usec(void)
Definition: papi.c:6190
static int read_net_counters(long long *values)
Definition: linux-net.c:200
static long long _net_register_current[NET_MAX_COUNTERS]
Definition: linux-net.c:60

Here is the call graph for this function:

int _net_stop ( hwd_context_t ctx,
hwd_control_state_t ctl 
)

Definition at line 413 of file linux-net.c.

414 {
415  (void) ctx;
416 
417  NET_control_state_t *net_ctl = (NET_control_state_t *) ctl;
418  long long now = PAPI_get_real_usec();
419  int i;
420 
422  for ( i=0; i<NET_MAX_COUNTERS; i++ ) {
424  }
425  net_ctl->lastupdate = now;
426 
427  return PAPI_OK;
428 }
long long values[NET_MAX_COUNTERS]
Definition: linux-net.h:68
static long long _net_register_start[NET_MAX_COUNTERS]
Definition: linux-net.c:59
return PAPI_OK
Definition: linux-nvml.c:458
void
Definition: iozone.c:18627
int i
Definition: fileop.c:140
#define NET_MAX_COUNTERS
Definition: linux-net.h:34
long long lastupdate
Definition: linux-net.h:69
long long PAPI_get_real_usec(void)
Definition: papi.c:6190
static int read_net_counters(long long *values)
Definition: linux-net.c:200
static long long _net_register_current[NET_MAX_COUNTERS]
Definition: linux-net.c:60

Here is the call graph for this function:

int _net_update_control_state ( hwd_control_state_t ctl,
NativeInfo_t native,
int  count,
hwd_context_t ctx 
)

Definition at line 480 of file linux-net.c.

482 {
483  ( void ) ctx;
484  ( void ) ctl;
485 
486  int i, index;
487 
488  for ( i = 0; i < count; i++ ) {
489  index = native[i].ni_event;
490  native[i].ni_position = _net_native_events[index].resources.selector - 1;
491  }
492 
493  return PAPI_OK;
494 }
return PAPI_OK
Definition: linux-nvml.c:458
int count
Definition: iozone.c:22422
void
Definition: iozone.c:18627
int i
Definition: fileop.c:140
unsigned int selector
Definition: linux-net.h:40
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
NET_register_t resources
Definition: linux-net.h:54
static int generateNetEventList ( void  )
static

Definition at line 106 of file linux-net.c.

107 {
108  FILE *fin;
109  char line[NET_PROC_MAX_LINE];
110  char *retval, *ifname;
111  int count = 0;
112  struct temp_event *temp;
113  struct temp_event *last = NULL;
114  int i, j;
115 
116  fin = fopen(NET_PROC_FILE, "r");
117  if (fin == NULL) {
118  SUBDBG("Can't find %s, are you sure the /proc file-system is mounted?\n",
119  NET_PROC_FILE);
120  return 0;
121  }
122 
123  /* skip the 2 header lines */
124  for (i=0; i<2; i++) {
125  retval = fgets (line, NET_PROC_MAX_LINE, fin);
126  if (retval == NULL) {
127  fclose(fin);
128  SUBDBG("Not enough lines in %s\n", NET_PROC_FILE);
129  return 0;
130  }
131  }
132 
133  while ((fgets (line, NET_PROC_MAX_LINE, fin)) == line) {
134 
135  /* split the interface name from the 16 counters */
136  retval = strstr(line, ":");
137  if (retval == NULL) {
138  SUBDBG("Wrong line format <%s>\n", line);
139  continue;
140  }
141 
142  *retval = '\0';
143  ifname = line;
144  while (isspace(*ifname)) { ifname++; }
145 
146  for (j=0; j<NET_INTERFACE_COUNTERS; j++) {
147 
148  /* keep the interface name around */
149  temp = (struct temp_event *)papi_malloc(sizeof(struct temp_event));
150  if (!temp) {
151  PAPIERROR("out of memory!");
152  fclose(fin);
153  return PAPI_ENOMEM;
154  }
155  temp->next = NULL;
156 
157  if (root == NULL) {
158  root = temp;
159  } else if (last) {
160  last->next = temp;
161  } else {
162  free(temp);
163  fclose(fin);
164  PAPIERROR("This shouldn't be possible\n");
165  return PAPI_ECMP;
166  }
167  last = temp;
168 
169  snprintf(temp->name, PAPI_MAX_STR_LEN, "%s:%s",
170  ifname, _net_counter_info[j].name);
171  snprintf(temp->description, PAPI_MAX_STR_LEN, "%s %s",
172  ifname, _net_counter_info[j].description);
173 
174  count++;
175  }
176  }
177 
178  fclose(fin);
179 
180  return count;
181 }
#define papi_malloc(a)
Definition: papi_memory.h:34
static struct net_counters _net_counter_info[NET_INTERFACE_COUNTERS]
int count
Definition: iozone.c:22422
fclose(thread_wqfd)
struct temp_event * next
char * name
Definition: linux-net.c:74
char name[PAPI_MAX_STR_LEN]
int i
Definition: fileop.c:140
free(dummyfile[xx])
char description[PAPI_MAX_STR_LEN]
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
#define PAPI_ECMP
Definition: papi.h:254
static struct temp_event * last
#define PAPI_ENOMEM
Definition: papi.h:252
#define NET_PROC_FILE
Definition: linux-net.c:44
#define NET_PROC_MAX_LINE
Definition: linux-net.c:49
#define NET_INTERFACE_COUNTERS
Definition: linux-net.c:71
static struct temp_event * root
Definition: linux-net.c:68
int temp
Definition: iozone.c:22158
#define PAPI_MAX_STR_LEN
Definition: papi.h:463
char * description
Definition: linux-net.c:75
long j
Definition: iozone.c:19135
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

Here is the caller graph for this function:

static int getInterfaceBaseIndex ( const char *  ifname)
static

Definition at line 185 of file linux-net.c.

186 {
187  int i;
188 
189  for ( i=0; i<num_events; i+=NET_INTERFACE_COUNTERS ) {
190  if (strncmp(_net_native_events[i].name, ifname, strlen(ifname)) == 0) {
191  return i;
192  }
193  }
194 
195  return -1; /* Not found */
196 }
static int num_events
int i
Definition: fileop.c:140
static NET_native_event_entry_t * _net_native_events
Definition: linux-net.c:54
#define NET_INTERFACE_COUNTERS
Definition: linux-net.c:71
char * name
Definition: iozone.c:23648

Here is the caller graph for this function:

static int read_net_counters ( long long values)
static

Definition at line 200 of file linux-net.c.

201 {
202  FILE *fin;
203  char line[NET_PROC_MAX_LINE];
204  char *retval, *ifname, *data;
205  int i, nf, if_bidx;
206 
207  fin = fopen(NET_PROC_FILE, "r");
208  if (fin == NULL) {
209  SUBDBG("Can't find %s, are you sure the /proc file-system is mounted?\n",
210  NET_PROC_FILE);
211  return NET_INVALID_RESULT;
212  }
213 
214  /* skip the 2 header lines */
215  for (i=0; i<2; i++) {
216  retval = fgets (line, NET_PROC_MAX_LINE, fin);
217  if (retval == NULL) {
218  SUBDBG("Not enough lines in %s\n", NET_PROC_FILE);
219  fclose(fin);
220  return 0;
221  }
222  }
223 
224  while ((fgets (line, NET_PROC_MAX_LINE, fin)) == line) {
225 
226  /* split the interface name from its 16 counters */
227  retval = strstr(line, ":");
228  if (retval == NULL) {
229  SUBDBG("Wrong line format <%s>\n", line);
230  continue;
231  }
232 
233  *retval = '\0';
234  data = retval + 1;
235  ifname = line;
236  while (isspace(*ifname)) { ifname++; }
237 
238  if_bidx = getInterfaceBaseIndex(ifname);
239  if (if_bidx < 0) {
240  SUBDBG("Interface <%s> not found\n", ifname);
241  } else {
242  nf = sscanf( data,
243  "%lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n",
244  &values[if_bidx + 0], &values[if_bidx + 1],
245  &values[if_bidx + 2], &values[if_bidx + 3],
246  &values[if_bidx + 4], &values[if_bidx + 5],
247  &values[if_bidx + 6], &values[if_bidx + 7],
248  &values[if_bidx + 8], &values[if_bidx + 9],
249  &values[if_bidx + 10], &values[if_bidx + 11],
250  &values[if_bidx + 12], &values[if_bidx + 13],
251  &values[if_bidx + 14], &values[if_bidx + 15]);
252 
253  SUBDBG("\nRead "
254  "%lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld %lld\n",
255  values[if_bidx + 0], values[if_bidx + 1],
256  values[if_bidx + 2], values[if_bidx + 3],
257  values[if_bidx + 4], values[if_bidx + 5],
258  values[if_bidx + 6], values[if_bidx + 7],
259  values[if_bidx + 8], values[if_bidx + 9],
260  values[if_bidx + 10], values[if_bidx + 11],
261  values[if_bidx + 12], values[if_bidx + 13],
262  values[if_bidx + 14], values[if_bidx + 15]);
263 
264  if ( nf != NET_INTERFACE_COUNTERS ) {
265  /* This shouldn't happen */
266  SUBDBG("/proc line with wrong number of fields\n");
267  }
268  }
269 
270  }
271 
272  fclose(fin);
273 
274  return 0;
275 }
fclose(thread_wqfd)
#define NET_INVALID_RESULT
Definition: linux-net.c:51
int i
Definition: fileop.c:140
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define NET_PROC_FILE
Definition: linux-net.c:44
#define NET_PROC_MAX_LINE
Definition: linux-net.c:49
#define NET_INTERFACE_COUNTERS
Definition: linux-net.c:71
sscanf(mnc->m_child_port,"%d",&mc.m_child_port)
static int getInterfaceBaseIndex(const char *ifname)
Definition: linux-net.c:185
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

struct net_counters _net_counter_info[NET_INTERFACE_COUNTERS]
static
Initial value:
= {
{ "rx:bytes", "receive bytes"},
{ "rx:packets", "receive packets"},
{ "rx:errors", "receive errors"},
{ "rx:dropped", "receive dropped"},
{ "rx:fifo", "receive fifo"},
{ "rx:frame", "receive frame"},
{ "rx:compressed", "receive compressed"},
{ "rx:multicast", "receive multicast"},
{ "tx:bytes", "transmit bytes"},
{ "tx:packets", "transmit packets"},
{ "tx:errors", "transmit errors"},
{ "tx:dropped", "transmit dropped"},
{ "tx:fifo", "transmit fifo"},
{ "tx:colls", "transmit colls"},
{ "tx:carrier", "transmit carrier"},
{ "tx:compressed", "transmit compressed"},
}
NET_native_event_entry_t* _net_native_events =NULL
static

Definition at line 54 of file linux-net.c.

long long _net_register_current[NET_MAX_COUNTERS]
static

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

long long _net_register_start[NET_MAX_COUNTERS]
static

Definition at line 59 of file linux-net.c.

papi_vector_t _net_vector

Definition at line 35 of file linux-net.c.

int is_initialized = 0
static

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

int num_events = 0
static

Definition at line 56 of file linux-net.c.

struct temp_event* root = NULL
static

Definition at line 68 of file linux-net.c.