| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/lhash/lh_stats.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | - | |||||||
| 7 | - | |||||||
| 8 | - | |||||||
| 9 | - | |||||||
| 10 | void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp) | - | ||||||
| 11 | { | - | ||||||
| 12 | BIO *bp; | - | ||||||
| 13 | - | |||||||
| 14 | bp = BIO_new(BIO_s_file()); | - | ||||||
| 15 | if (bp ==
| 0 | ||||||
| 16 | ((void *)0)
| 0 | ||||||
| 17 | ) | - | ||||||
| 18 | return; never executed: return; | 0 | ||||||
| 19 | BIO_ctrl(bp,106,0x00,(char *)(fp)); | - | ||||||
| 20 | OPENSSL_LH_stats_bio(lh, bp); | - | ||||||
| 21 | BIO_free(bp); | - | ||||||
| 22 | } never executed: end of block | 0 | ||||||
| 23 | - | |||||||
| 24 | void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp) | - | ||||||
| 25 | { | - | ||||||
| 26 | BIO *bp; | - | ||||||
| 27 | - | |||||||
| 28 | bp = BIO_new(BIO_s_file()); | - | ||||||
| 29 | if (bp ==
| 0 | ||||||
| 30 | ((void *)0)
| 0 | ||||||
| 31 | ) | - | ||||||
| 32 | return; never executed: return; | 0 | ||||||
| 33 | BIO_ctrl(bp,106,0x00,(char *)(fp)); | - | ||||||
| 34 | OPENSSL_LH_node_stats_bio(lh, bp); | - | ||||||
| 35 | BIO_free(bp); | - | ||||||
| 36 | } never executed: end of block | 0 | ||||||
| 37 | - | |||||||
| 38 | void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp) | - | ||||||
| 39 | { | - | ||||||
| 40 | BIO *bp; | - | ||||||
| 41 | - | |||||||
| 42 | bp = BIO_new(BIO_s_file()); | - | ||||||
| 43 | if (bp ==
| 0 | ||||||
| 44 | ((void *)0)
| 0 | ||||||
| 45 | ) | - | ||||||
| 46 | return; never executed: return; | 0 | ||||||
| 47 | BIO_ctrl(bp,106,0x00,(char *)(fp)); | - | ||||||
| 48 | OPENSSL_LH_node_usage_stats_bio(lh, bp); | - | ||||||
| 49 | BIO_free(bp); | - | ||||||
| 50 | } never executed: end of block | 0 | ||||||
| 51 | - | |||||||
| 52 | - | |||||||
| 53 | - | |||||||
| 54 | void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out) | - | ||||||
| 55 | { | - | ||||||
| 56 | BIO_printf(out, "num_items = %lu\n", lh->num_items); | - | ||||||
| 57 | BIO_printf(out, "num_nodes = %u\n", lh->num_nodes); | - | ||||||
| 58 | BIO_printf(out, "num_alloc_nodes = %u\n", lh->num_alloc_nodes); | - | ||||||
| 59 | BIO_printf(out, "num_expands = %lu\n", lh->num_expands); | - | ||||||
| 60 | BIO_printf(out, "num_expand_reallocs = %lu\n", lh->num_expand_reallocs); | - | ||||||
| 61 | BIO_printf(out, "num_contracts = %lu\n", lh->num_contracts); | - | ||||||
| 62 | BIO_printf(out, "num_contract_reallocs = %lu\n", lh->num_contract_reallocs); | - | ||||||
| 63 | BIO_printf(out, "num_hash_calls = %lu\n", lh->num_hash_calls); | - | ||||||
| 64 | BIO_printf(out, "num_comp_calls = %lu\n", lh->num_comp_calls); | - | ||||||
| 65 | BIO_printf(out, "num_insert = %lu\n", lh->num_insert); | - | ||||||
| 66 | BIO_printf(out, "num_replace = %lu\n", lh->num_replace); | - | ||||||
| 67 | BIO_printf(out, "num_delete = %lu\n", lh->num_delete); | - | ||||||
| 68 | BIO_printf(out, "num_no_delete = %lu\n", lh->num_no_delete); | - | ||||||
| 69 | BIO_printf(out, "num_retrieve = %lu\n", lh->num_retrieve); | - | ||||||
| 70 | BIO_printf(out, "num_retrieve_miss = %lu\n", lh->num_retrieve_miss); | - | ||||||
| 71 | BIO_printf(out, "num_hash_comps = %lu\n", lh->num_hash_comps); | - | ||||||
| 72 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| 73 | - | |||||||
| 74 | void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out) | - | ||||||
| 75 | { | - | ||||||
| 76 | OPENSSL_LH_NODE *n; | - | ||||||
| 77 | unsigned int i, num; | - | ||||||
| 78 | - | |||||||
| 79 | for (i = 0; i < lh->num_nodes
| 0 | ||||||
| 80 | for (n = lh->b[i], num = 0; n !=
| 0 | ||||||
| 81 | ((void *)0)
| 0 | ||||||
| 82 | ; n = n->next) | - | ||||||
| 83 | num++; never executed: num++; | 0 | ||||||
| 84 | BIO_printf(out, "node %6u -> %3u\n", i, num); | - | ||||||
| 85 | } never executed: end of block | 0 | ||||||
| 86 | } never executed: end of block | 0 | ||||||
| 87 | - | |||||||
| 88 | void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out) | - | ||||||
| 89 | { | - | ||||||
| 90 | OPENSSL_LH_NODE *n; | - | ||||||
| 91 | unsigned long num; | - | ||||||
| 92 | unsigned int i; | - | ||||||
| 93 | unsigned long total = 0, n_used = 0; | - | ||||||
| 94 | - | |||||||
| 95 | for (i = 0; i < lh->num_nodes
| 2-1250016 | ||||||
| 96 | for (n = lh->b[i], num = 0; n !=
| 1250016-2500000 | ||||||
| 97 | ((void *)0)
| 1250016-2500000 | ||||||
| 98 | ; n = n->next) | - | ||||||
| 99 | num++; executed 2500000 times by 1 test: num++;Executed by:
| 2500000 | ||||||
| 100 | if (num != 0
| 16-1250000 | ||||||
| 101 | n_used++; | - | ||||||
| 102 | total += num; | - | ||||||
| 103 | } executed 1250000 times by 1 test: end of blockExecuted by:
| 1250000 | ||||||
| 104 | } executed 1250016 times by 1 test: end of blockExecuted by:
| 1250016 | ||||||
| 105 | BIO_printf(out, "%lu nodes used out of %u\n", n_used, lh->num_nodes); | - | ||||||
| 106 | BIO_printf(out, "%lu items\n", total); | - | ||||||
| 107 | if (n_used == 0
| 1 | ||||||
| 108 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||
| 109 | BIO_printf(out, "load %d.%02d actual load %d.%02d\n", | - | ||||||
| 110 | (int)(total / lh->num_nodes), | - | ||||||
| 111 | (int)((total % lh->num_nodes) * 100 / lh->num_nodes), | - | ||||||
| 112 | (int)(total / n_used), (int)((total % n_used) * 100 / n_used)); | - | ||||||
| 113 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||
| Switch to Source code | Preprocessed file |