MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / out_item

Function out_item

dbug/dbug_analyze.c:468–507  ·  view source on GitHub ↗
(outf, m,called,timed)

Source from the content-addressed store, hash-verified

466 */
467
468void out_item (outf, m,called,timed)
469FILE *outf;
470register struct module_t *m;
471unsigned long int *called, *timed;
472{
473 char *name = m -> name;
474 register unsigned int calls = m -> m_calls;
475 register unsigned long local_time = m -> m_time;
476 register unsigned long stkuse = m -> m_stkuse;
477 unsigned int import;
478 double per_time = 0.0;
479 double per_calls = 0.0;
480 double ms_per_call, local_ftime;
481
482 DBUG_ENTER ("out_item");
483
484 if (tot_time > 0) {
485 per_time = (double) (local_time * 100) / (double) tot_time;
486 }
487 if (tot_calls > 0) {
488 per_calls = (double) (calls * 100) / (double) tot_calls;
489 }
490 import = (unsigned int) (per_time * per_calls);
491
492 if (verbose) {
493 fprintf (outf, "%6d\t%10.2f\t%11ld\t%10.2f %10d\t%-15s\n",
494 calls, per_calls, local_time, per_time, import, name);
495 } else {
496 ms_per_call = local_time;
497 ms_per_call /= calls;
498 local_ftime = local_time;
499 local_ftime /= 1000;
500 fprintf(outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\n",
501 per_time, local_ftime, calls, ms_per_call, per_calls, import,
502 stkuse, name);
503 }
504 *called = calls;
505 *timed = local_time;
506 DBUG_VOID_RETURN;
507}
508
509/*
510 * out_body (outf, root,s_calls,s_time) -- Performs an inorder traversal

Callers 1

out_bodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected