Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/lhash/lh_stats.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | void | - | ||||||
6 | lh_stats(const _LHASH *lh, FILE *fp) | - | ||||||
7 | { | - | ||||||
8 | BIO *bp; | - | ||||||
9 | - | |||||||
10 | bp = BIO_new(BIO_s_file()); | - | ||||||
11 | if (bp ==
| 0 | ||||||
12 | ((void *)0)
| 0 | ||||||
13 | ) | - | ||||||
14 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||
15 | BIO_ctrl(bp,106,0x00,(char *)fp); | - | ||||||
16 | lh_stats_bio(lh, bp); | - | ||||||
17 | BIO_free(bp); | - | ||||||
18 | end: code before this statement never executed: ;end: | 0 | ||||||
19 | } never executed: end of block | 0 | ||||||
20 | - | |||||||
21 | void | - | ||||||
22 | lh_node_stats(const _LHASH *lh, FILE *fp) | - | ||||||
23 | { | - | ||||||
24 | BIO *bp; | - | ||||||
25 | - | |||||||
26 | bp = BIO_new(BIO_s_file()); | - | ||||||
27 | if (bp ==
| 0 | ||||||
28 | ((void *)0)
| 0 | ||||||
29 | ) | - | ||||||
30 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||
31 | BIO_ctrl(bp,106,0x00,(char *)fp); | - | ||||||
32 | lh_node_stats_bio(lh, bp); | - | ||||||
33 | BIO_free(bp); | - | ||||||
34 | end: code before this statement never executed: ;end: | 0 | ||||||
35 | } never executed: end of block | 0 | ||||||
36 | - | |||||||
37 | void | - | ||||||
38 | lh_node_usage_stats(const _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 | goto never executed: end;goto end; never executed: goto end; | 0 | ||||||
47 | BIO_ctrl(bp,106,0x00,(char *)fp); | - | ||||||
48 | lh_node_usage_stats_bio(lh, bp); | - | ||||||
49 | BIO_free(bp); | - | ||||||
50 | end: code before this statement never executed: ;end: | 0 | ||||||
51 | } never executed: end of block | 0 | ||||||
52 | - | |||||||
53 | - | |||||||
54 | void | - | ||||||
55 | lh_stats_bio(const _LHASH *lh, BIO *out) | - | ||||||
56 | { | - | ||||||
57 | BIO_printf(out, "num_items = %lu\n", lh->num_items); | - | ||||||
58 | BIO_printf(out, "num_nodes = %u\n", lh->num_nodes); | - | ||||||
59 | BIO_printf(out, "num_alloc_nodes = %u\n", lh->num_alloc_nodes); | - | ||||||
60 | BIO_printf(out, "num_expands = %lu\n", lh->num_expands); | - | ||||||
61 | BIO_printf(out, "num_expand_reallocs = %lu\n", | - | ||||||
62 | lh->num_expand_reallocs); | - | ||||||
63 | BIO_printf(out, "num_contracts = %lu\n", lh->num_contracts); | - | ||||||
64 | BIO_printf(out, "num_contract_reallocs = %lu\n", | - | ||||||
65 | lh->num_contract_reallocs); | - | ||||||
66 | BIO_printf(out, "num_hash_calls = %lu\n", lh->num_hash_calls); | - | ||||||
67 | BIO_printf(out, "num_comp_calls = %lu\n", lh->num_comp_calls); | - | ||||||
68 | BIO_printf(out, "num_insert = %lu\n", lh->num_insert); | - | ||||||
69 | BIO_printf(out, "num_replace = %lu\n", lh->num_replace); | - | ||||||
70 | BIO_printf(out, "num_delete = %lu\n", lh->num_delete); | - | ||||||
71 | BIO_printf(out, "num_no_delete = %lu\n", lh->num_no_delete); | - | ||||||
72 | BIO_printf(out, "num_retrieve = %lu\n", lh->num_retrieve); | - | ||||||
73 | BIO_printf(out, "num_retrieve_miss = %lu\n", lh->num_retrieve_miss); | - | ||||||
74 | BIO_printf(out, "num_hash_comps = %lu\n", lh->num_hash_comps); | - | ||||||
75 | - | |||||||
76 | - | |||||||
77 | - | |||||||
78 | - | |||||||
79 | - | |||||||
80 | - | |||||||
81 | } never executed: end of block | 0 | ||||||
82 | - | |||||||
83 | void | - | ||||||
84 | lh_node_stats_bio(const _LHASH *lh, BIO *out) | - | ||||||
85 | { | - | ||||||
86 | LHASH_NODE *n; | - | ||||||
87 | unsigned int i, num; | - | ||||||
88 | - | |||||||
89 | for (i = 0; i < lh->num_nodes
| 0 | ||||||
90 | for (n = lh->b[i], num = 0; n !=
| 0 | ||||||
91 | ((void *)0)
| 0 | ||||||
92 | ; n = n->next) | - | ||||||
93 | num++; never executed: num++; | 0 | ||||||
94 | BIO_printf(out, "node %6u -> %3u\n", i, num); | - | ||||||
95 | } never executed: end of block | 0 | ||||||
96 | } never executed: end of block | 0 | ||||||
97 | - | |||||||
98 | void | - | ||||||
99 | lh_node_usage_stats_bio(const _LHASH *lh, BIO *out) | - | ||||||
100 | { | - | ||||||
101 | LHASH_NODE *n; | - | ||||||
102 | unsigned long num; | - | ||||||
103 | unsigned int i; | - | ||||||
104 | unsigned long total = 0, n_used = 0; | - | ||||||
105 | - | |||||||
106 | for (i = 0; i < lh->num_nodes
| 0 | ||||||
107 | for (n = lh->b[i], num = 0; n !=
| 0 | ||||||
108 | ((void *)0)
| 0 | ||||||
109 | ; n = n->next) | - | ||||||
110 | num++; never executed: num++; | 0 | ||||||
111 | if (num != 0
| 0 | ||||||
112 | n_used++; | - | ||||||
113 | total += num; | - | ||||||
114 | } never executed: end of block | 0 | ||||||
115 | } never executed: end of block | 0 | ||||||
116 | BIO_printf(out, "%lu nodes used out of %u\n", n_used, lh->num_nodes); | - | ||||||
117 | BIO_printf(out, "%lu items\n", total); | - | ||||||
118 | if (n_used == 0
| 0 | ||||||
119 | return; never executed: return; | 0 | ||||||
120 | BIO_printf(out, "load %d.%02d actual load %d.%02d\n", | - | ||||||
121 | (int)(total / lh->num_nodes), | - | ||||||
122 | (int)((total % lh->num_nodes) * 100 / lh->num_nodes), | - | ||||||
123 | (int)(total / n_used), | - | ||||||
124 | (int)((total % n_used) * 100 / n_used)); | - | ||||||
125 | } never executed: end of block | 0 | ||||||
Switch to Source code | Preprocessed file |