MCPcopy Create free account
hub / github.com/F-Stack/f-stack / krping_read

Function krping_read

freebsd/contrib/rdma/krping/krping_dev.c:128–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128static int
129krping_read(struct cdev *dev, struct uio *uio, int ioflag)
130{
131 int num = 1;
132 struct stats_list list;
133 struct stats_list_entry *e;
134
135 STAILQ_INIT(&list);
136 krping_walk_cb_list(krping_copy_stats, &list);
137
138 if (STAILQ_EMPTY(&list))
139 return (0);
140
141 uprintf("krping: %4s %10s %10s %10s %10s %10s %10s %10s %10s %10s\n",
142 "num", "device", "snd bytes", "snd msgs", "rcv bytes", "rcv msgs",
143 "wr bytes", "wr msgs", "rd bytes", "rd msgs");
144
145 while (!STAILQ_EMPTY(&list)) {
146 e = STAILQ_FIRST(&list);
147 STAILQ_REMOVE_HEAD(&list, link);
148 if (e->stats == NULL)
149 uprintf("krping: %d listen\n", num);
150 else {
151 struct krping_stats *stats = e->stats;
152
153 uprintf("krping: %4d %10s %10llu %10llu %10llu %10llu "
154 "%10llu %10llu %10llu %10llu\n", num, stats->name,
155 stats->send_bytes, stats->send_msgs,
156 stats->recv_bytes, stats->recv_msgs,
157 stats->write_bytes, stats->write_msgs,
158 stats->read_bytes, stats->read_msgs);
159 free(stats, M_DEVBUF);
160 }
161 num++;
162 free(e, M_DEVBUF);
163 }
164
165 return (0);
166}
167
168static int
169krping_write(struct cdev *dev, struct uio *uio, int ioflag)

Callers

nothing calls this directly

Calls 3

krping_walk_cb_listFunction · 0.85
uprintfFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected