PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fake_mx_counters.c
Go to the documentation of this file.
1 #include <stdio.h>
2 
3 /* This program fakes the output of the mx_counters util */
4 /* for testing purposes */
5 
6 #define MAX_LABELS 101
7 
8 char labels[MAX_LABELS][100]={
9 " Lanai uptime (seconds)",
10 " Counters uptime (seconds)",
11 " Bad CRC8 (Port 0)",
12 " Bad CRC32 (Port 0)",
13 " Unstripped route (Port 0)",
14 " pkt_desc_invalid (Port 0)",
15 " recv_pkt_errors (Port 0)",
16 " pkt_misrouted (Port 0)",
17 " data_src_unknown",
18 " data_bad_endpt",
19 " data_endpt_closed",
20 " data_bad_session",
21 " push_bad_window",
22 " push_duplicate",
23 " push_obsolete",
24 " push_race_driver",
25 " push_bad_send_handle_magic",
26 " push_bad_src_magic",
27 " pull_obsolete",
28 " pull_notify_obsolete",
29 " pull_race_driver",
30 " pull_notify_race",
31 " ack_bad_type",
32 " ack_bad_magic",
33 " ack_resend_race",
34 " Late ack",
35 " ack_nack_frames_in_pipe",
36 " nack_bad_endpt",
37 " nack_endpt_closed",
38 " nack_bad_session",
39 " nack_bad_rdmawin",
40 " nack_eventq_full",
41 " send_bad_rdmawin",
42 " connect_timeout",
43 " connect_src_unknown",
44 " query_bad_magic",
45 " query_timed_out",
46 " query_src_unknown",
47 " Raw sends (Port 0)",
48 " Raw receives (Port 0)",
49 " Raw oversized packets (Port 0)",
50 " raw_recv_overrun",
51 " raw_disabled",
52 " connect_send",
53 " connect_recv",
54 " ack_send (Port 0)",
55 " ack_recv (Port 0)",
56 " push_send (Port 0)",
57 " push_recv (Port 0)",
58 " query_send (Port 0)",
59 " query_recv (Port 0)",
60 " reply_send (Port 0)",
61 " reply_recv (Port 0)",
62 " query_unknown (Port 0)",
63 " query_unknown (Port 0)",
64 " data_send_null (Port 0)",
65 " data_send_small (Port 0)",
66 " data_send_medium (Port 0)",
67 " data_send_rndv (Port 0)",
68 " data_send_pull (Port 0)",
69 " data_recv_null (Port 0)",
70 " data_recv_small_inline (Port 0)",
71 " data_recv_small_copy (Port 0)",
72 " data_recv_medium (Port 0)",
73 " data_recv_rndv (Port 0)",
74 " data_recv_pull (Port 0)",
75 " ether_send_unicast_cnt (Port 0)",
76 " ether_send_multicast_cnt (Port 0)",
77 " ether_recv_small_cnt (Port 0)",
78 " ether_recv_big_cnt (Port 0)",
79 " ether_overrun",
80 " ether_oversized",
81 " data_recv_no_credits",
82 " Packets resent",
83 " Packets dropped (data send side)",
84 " Mapper routes update",
85 " Route dispersion (Port 0)",
86 " out_of_send_handles",
87 " out_of_pull_handles",
88 " out_of_push_handles",
89 " medium_cont_race",
90 " cmd_type_unknown",
91 " ureq_type_unknown",
92 " Interrupts overrun",
93 " Waiting for interrupt DMA",
94 " Waiting for interrupt Ack",
95 " Waiting for interrupt Timer",
96 " Slabs recycling",
97 " Slabs pressure",
98 " Slabs starvation",
99 " out_of_rdma handles",
100 " eventq_full",
101 " buffer_drop (Port 0)",
102 " memory_drop (Port 0)",
103 " Hardware flow control (Port 0)",
104 "(Devel) Simulated packets lost (Port 0)",
105 " (Logging) Logging frames dumped",
106 " Wake interrupts",
107 " Averted wakeup race",
108 " Dma metadata race",
109 " foo",
110 };
111 
112 int main(int argc, char **argv) {
113 
114  int i,multiplier=1;
115 
116  FILE *fff;
117 
118  fff=fopen("state","r");
119  if (fff!=NULL) {
120  fscanf(fff,"%d",&multiplier);
121  fclose(fff);
122  }
123 
124  fff=fopen("state","w");
125  if (fff!=NULL) {
126  fprintf(fff,"%d\n",multiplier+1);
127  fclose(fff);
128  }
129 
130  printf("1 ports\n");
131  for(i=0;i<MAX_LABELS;i++) {
132  printf("%s:%12d (%#x)\n",labels[i],i*multiplier,i*multiplier);
133  }
134  return 0;
135 }
136 
int multiplier
Definition: iozone.c:1539
fclose(thread_wqfd)
#define printf
Definition: papi_test.h:125
int int argc
Definition: iozone.c:1609
FILE * fff[MAX_EVENTS]
char ** argv
Definition: iozone.c:1610
int i
Definition: fileop.c:140
#define MAX_LABELS
char labels[MAX_LABELS][100]
int main(int argc, char **argv)
List all appio events codes and names.