Home | History | Annotate | Download | only in misc

Lines Matching refs:fp

149 void load_raw_table(FILE *fp)
155 while (fgets(buf, sizeof(buf), fp) != NULL) {
212 void dump_raw_db(FILE *fp, int to_hist)
216 fprintf(fp, "#%s\n", info_source);
235 fprintf(fp, "%d %s ", n->ifindex, n->name);
237 fprintf(fp, "%llu %u ", vals[i], (unsigned)rates[i]);
238 fprintf(fp, "\n");
247 void format_rate(FILE *fp, unsigned long long *vals, double *rates, int i)
251 fprintf(fp, "%7lluM ", vals[i]/mega);
253 fprintf(fp, "%7lluK ", vals[i]/kilo);
255 fprintf(fp, "%8llu ", vals[i]);
259 fprintf(fp, "%-6s ", temp);
262 fprintf(fp, "%-6s ", temp);
264 fprintf(fp, "%-6u ", (unsigned)rates[i]);
267 void format_pair(FILE *fp, unsigned long long *vals, int i, int k)
271 fprintf(fp, "%7lluM ", vals[i]/mega);
273 fprintf(fp, "%7lluK ", vals[i]/kilo);
275 fprintf(fp, "%8llu ", vals[i]);
279 fprintf(fp, "%-6s ", temp);
282 fprintf(fp, "%-6s ", temp);
284 fprintf(fp, "%-6u ", (unsigned)vals[k]);
287 void print_head(FILE *fp)
289 fprintf(fp, "#%s\n", info_source);
290 fprintf(fp, "%-15s ", "Interface");
292 fprintf(fp, "%8s/%-6s ", "RX Pkts", "Rate");
293 fprintf(fp, "%8s/%-6s ", "TX Pkts", "Rate");
294 fprintf(fp, "%8s/%-6s ", "RX Data", "Rate");
295 fprintf(fp, "%8s/%-6s\n","TX Data", "Rate");
298 fprintf(fp, "%-15s ", "");
299 fprintf(fp, "%8s/%-6s ", "RX Errs", "Drop");
300 fprintf(fp, "%8s/%-6s ", "TX Errs", "Drop");
301 fprintf(fp, "%8s/%-6s ", "RX Over", "Rate");
302 fprintf(fp, "%8s/%-6s\n","TX Coll", "Rate");
304 fprintf(fp, "%-15s ", "");
305 fprintf(fp, "%8s/%-6s ", "RX Errs", "Rate");
306 fprintf(fp, "%8s/%-6s ", "RX Drop", "Rate");
307 fprintf(fp, "%8s/%-6s ", "RX Over", "Rate");
308 fprintf(fp, "%8s/%-6s\n","RX Leng", "Rate");
310 fprintf(fp, "%-15s ", "");
311 fprintf(fp, "%8s/%-6s ", "RX Crc", "Rate");
312 fprintf(fp, "%8s/%-6s ", "RX Frm", "Rate");
313 fprintf(fp, "%8s/%-6s ", "RX Fifo", "Rate");
314 fprintf(fp, "%8s/%-6s\n","RX Miss", "Rate");
316 fprintf(fp, "%-15s ", "");
317 fprintf(fp, "%8s/%-6s ", "TX Errs", "Rate");
318 fprintf(fp, "%8s/%-6s ", "TX Drop", "Rate");
319 fprintf(fp, "%8s/%-6s ", "TX Coll", "Rate");
320 fprintf(fp, "%8s/%-6s\n","TX Carr", "Rate");
322 fprintf(fp, "%-15s ", "");
323 fprintf(fp, "%8s/%-6s ", "TX Abrt", "Rate");
324 fprintf(fp, "%8s/%-6s ", "TX Fifo", "Rate");
325 fprintf(fp, "%8s/%-6s ", "TX Hear", "Rate");
326 fprintf(fp, "%8s/%-6s\n","TX Wind", "Rate");
330 void print_one_if(FILE *fp, struct ifstat_ent *n, unsigned long long *vals)
333 fprintf(fp, "%-15s ", n->name);
335 format_rate(fp, vals, n->rate, i);
336 fprintf(fp, "\n");
339 fprintf(fp, "%-15s ", "");
340 format_pair(fp, vals, 4, 6);
341 format_pair(fp, vals, 5, 7);
342 format_rate(fp, vals, n->rate, 11);
343 format_rate(fp, vals, n->rate, 9);
344 fprintf(fp, "\n");
346 fprintf(fp, "%-15s ", "");
347 format_rate(fp, vals, n->rate, 4);
348 format_rate(fp, vals, n->rate, 6);
349 format_rate(fp, vals, n->rate, 11);
350 format_rate(fp, vals, n->rate, 10);
351 fprintf(fp, "\n");
353 fprintf(fp, "%-15s ", "");
354 format_rate(fp, vals, n->rate, 12);
355 format_rate(fp, vals, n->rate, 13);
356 format_rate(fp, vals, n->rate, 14);
357 format_rate(fp, vals, n->rate, 15);
358 fprintf(fp, "\n");
360 fprintf(fp, "%-15s ", "");
361 format_rate(fp, vals, n->rate, 5);
362 format_rate(fp, vals, n->rate, 7);
363 format_rate(fp, vals, n->rate, 9);
364 format_rate(fp, vals, n->rate, 17);
365 fprintf(fp, "\n");
367 fprintf(fp, "%-15s ", "");
368 format_rate(fp, vals, n->rate, 16);
369 format_rate(fp, vals, n->rate, 18);
370 format_rate(fp, vals, n->rate, 19);
371 format_rate(fp, vals, n->rate, 20);
372 fprintf(fp, "\n");
377 void dump_kern_db(FILE *fp)
381 print_head(fp);
386 print_one_if(fp, n, n->val);
391 void dump_incr_db(FILE *fp)
396 print_head(fp);
415 print_one_if(fp, n, vals);
522 FILE *fp = fdopen(clnt, "w");
523 if (fp) {
526 dump_raw_db(fp, 0);