summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/lhash
diff options
context:
space:
mode:
authormarkus <>2003-05-12 02:18:40 +0000
committermarkus <>2003-05-12 02:18:40 +0000
commitd4fcd82bb7f6d603bd61e19a81ba97337b89dfca (patch)
treed52e3a0f1f08f65ad283027e560e17ed0d720462 /src/lib/libcrypto/lhash
parent582bbd139cd2afd58d10dc051c5b0b989b441074 (diff)
downloadopenbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.tar.gz
openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.tar.bz2
openbsd-d4fcd82bb7f6d603bd61e19a81ba97337b89dfca.zip
merge 0.9.7b with local changes; crank majors for libssl/libcrypto
Diffstat (limited to 'src/lib/libcrypto/lhash')
-rw-r--r--src/lib/libcrypto/lhash/Makefile.ssl2
-rw-r--r--src/lib/libcrypto/lhash/lh_stats.c101
2 files changed, 31 insertions, 72 deletions
diff --git a/src/lib/libcrypto/lhash/Makefile.ssl b/src/lib/libcrypto/lhash/Makefile.ssl
index b3ad272cf7..60e7ee3393 100644
--- a/src/lib/libcrypto/lhash/Makefile.ssl
+++ b/src/lib/libcrypto/lhash/Makefile.ssl
@@ -68,7 +68,7 @@ lint:
68 lint -DLINT $(INCLUDES) $(SRC)>fluff 68 lint -DLINT $(INCLUDES) $(SRC)>fluff
69 69
70depend: 70depend:
71 $(MAKEDEPEND) $(CFLAG) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) 71 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
72 72
73dclean: 73dclean:
74 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 74 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/src/lib/libcrypto/lhash/lh_stats.c b/src/lib/libcrypto/lhash/lh_stats.c
index 8e6f57c741..5aa7766aa6 100644
--- a/src/lib/libcrypto/lhash/lh_stats.c
+++ b/src/lib/libcrypto/lhash/lh_stats.c
@@ -179,63 +179,29 @@ end:;
179 179
180void lh_stats_bio(const LHASH *lh, BIO *out) 180void lh_stats_bio(const LHASH *lh, BIO *out)
181 { 181 {
182 char buf[128]; 182 BIO_printf(out,"num_items = %lu\n",lh->num_items);
183 183 BIO_printf(out,"num_nodes = %u\n",lh->num_nodes);
184 snprintf(buf,sizeof buf,"num_items = %lu\n",lh->num_items); 184 BIO_printf(out,"num_alloc_nodes = %u\n",lh->num_alloc_nodes);
185 BIO_puts(out,buf); 185 BIO_printf(out,"num_expands = %lu\n",lh->num_expands);
186 snprintf(buf,sizeof buf,"num_nodes = %u\n",lh->num_nodes); 186 BIO_printf(out,"num_expand_reallocs = %lu\n",
187 BIO_puts(out,buf); 187 lh->num_expand_reallocs);
188 snprintf(buf,sizeof buf,"num_alloc_nodes = %u\n", 188 BIO_printf(out,"num_contracts = %lu\n",lh->num_contracts);
189 lh->num_alloc_nodes); 189 BIO_printf(out,"num_contract_reallocs = %lu\n",
190 BIO_puts(out,buf); 190 lh->num_contract_reallocs);
191 snprintf(buf,sizeof buf,"num_expands = %lu\n", 191 BIO_printf(out,"num_hash_calls = %lu\n",lh->num_hash_calls);
192 lh->num_expands); 192 BIO_printf(out,"num_comp_calls = %lu\n",lh->num_comp_calls);
193 BIO_puts(out,buf); 193 BIO_printf(out,"num_insert = %lu\n",lh->num_insert);
194 snprintf(buf,sizeof buf,"num_expand_reallocs = %lu\n", 194 BIO_printf(out,"num_replace = %lu\n",lh->num_replace);
195 lh->num_expand_reallocs); 195 BIO_printf(out,"num_delete = %lu\n",lh->num_delete);
196 BIO_puts(out,buf); 196 BIO_printf(out,"num_no_delete = %lu\n",lh->num_no_delete);
197 snprintf(buf,sizeof buf,"num_contracts = %lu\n", 197 BIO_printf(out,"num_retrieve = %lu\n",lh->num_retrieve);
198 lh->num_contracts); 198 BIO_printf(out,"num_retrieve_miss = %lu\n",lh->num_retrieve_miss);
199 BIO_puts(out,buf); 199 BIO_printf(out,"num_hash_comps = %lu\n",lh->num_hash_comps);
200 snprintf(buf,sizeof buf,"num_contract_reallocs = %lu\n",
201 lh->num_contract_reallocs);
202 BIO_puts(out,buf);
203 snprintf(buf,sizeof buf,"num_hash_calls = %lu\n",
204 lh->num_hash_calls);
205 BIO_puts(out,buf);
206 snprintf(buf,sizeof buf,"num_comp_calls = %lu\n",
207 lh->num_comp_calls);
208 BIO_puts(out,buf);
209 snprintf(buf,sizeof buf,"num_insert = %lu\n",
210 lh->num_insert);
211 BIO_puts(out,buf);
212 snprintf(buf,sizeof buf,"num_replace = %lu\n",
213 lh->num_replace);
214 BIO_puts(out,buf);
215 snprintf(buf,sizeof buf,"num_delete = %lu\n",
216 lh->num_delete);
217 BIO_puts(out,buf);
218 snprintf(buf,sizeof buf,"num_no_delete = %lu\n",
219 lh->num_no_delete);
220 BIO_puts(out,buf);
221 snprintf(buf,sizeof buf,"num_retrieve = %lu\n",
222 lh->num_retrieve);
223 BIO_puts(out,buf);
224 snprintf(buf,sizeof buf,"num_retrieve_miss = %lu\n",
225 lh->num_retrieve_miss);
226 BIO_puts(out,buf);
227 snprintf(buf,sizeof buf,"num_hash_comps = %lu\n",
228 lh->num_hash_comps);
229 BIO_puts(out,buf);
230#if 0 200#if 0
231 snprintf(buf,sizeof buf,"p = %u\n",lh->p); 201 BIO_printf(out,"p = %u\n",lh->p);
232 BIO_puts(out,buf); 202 BIO_printf(out,"pmax = %u\n",lh->pmax);
233 snprintf(buf,sizeof buf,"pmax = %u\n",lh->pmax); 203 BIO_printf(out,"up_load = %lu\n",lh->up_load);
234 BIO_puts(out,buf); 204 BIO_printf(out,"down_load = %lu\n",lh->down_load);
235 snprintf(buf,sizeof buf,"up_load = %lu\n",lh->up_load);
236 BIO_puts(out,buf);
237 snprintf(buf,sizeof buf,"down_load = %lu\n",lh->down_load);
238 BIO_puts(out,buf);
239#endif 205#endif
240 } 206 }
241 207
@@ -243,14 +209,12 @@ void lh_node_stats_bio(const LHASH *lh, BIO *out)
243 { 209 {
244 LHASH_NODE *n; 210 LHASH_NODE *n;
245 unsigned int i,num; 211 unsigned int i,num;
246 char buf[128];
247 212
248 for (i=0; i<lh->num_nodes; i++) 213 for (i=0; i<lh->num_nodes; i++)
249 { 214 {
250 for (n=lh->b[i],num=0; n != NULL; n=n->next) 215 for (n=lh->b[i],num=0; n != NULL; n=n->next)
251 num++; 216 num++;
252 snprintf(buf,sizeof buf,"node %6u -> %3u\n",i,num); 217 BIO_printf(out,"node %6u -> %3u\n",i,num);
253 BIO_puts(out,buf);
254 } 218 }
255 } 219 }
256 220
@@ -260,7 +224,6 @@ void lh_node_usage_stats_bio(const LHASH *lh, BIO *out)
260 unsigned long num; 224 unsigned long num;
261 unsigned int i; 225 unsigned int i;
262 unsigned long total=0,n_used=0; 226 unsigned long total=0,n_used=0;
263 char buf[128];
264 227
265 for (i=0; i<lh->num_nodes; i++) 228 for (i=0; i<lh->num_nodes; i++)
266 { 229 {
@@ -272,18 +235,14 @@ void lh_node_usage_stats_bio(const LHASH *lh, BIO *out)
272 total+=num; 235 total+=num;
273 } 236 }
274 } 237 }
275 snprintf(buf,sizeof buf,"%lu nodes used out of %u\n",n_used, 238 BIO_printf(out,"%lu nodes used out of %u\n",n_used,lh->num_nodes);
276 lh->num_nodes); 239 BIO_printf(out,"%lu items\n",total);
277 BIO_puts(out,buf);
278 snprintf(buf,sizeof buf,"%lu items\n",total);
279 BIO_puts(out,buf);
280 if (n_used == 0) return; 240 if (n_used == 0) return;
281 snprintf(buf,sizeof buf,"load %d.%02d actual load %d.%02d\n", 241 BIO_printf(out,"load %d.%02d actual load %d.%02d\n",
282 (int)(total/lh->num_nodes), 242 (int)(total/lh->num_nodes),
283 (int)((total%lh->num_nodes)*100/lh->num_nodes), 243 (int)((total%lh->num_nodes)*100/lh->num_nodes),
284 (int)(total/n_used), 244 (int)(total/n_used),
285 (int)((total%n_used)*100/n_used)); 245 (int)((total%n_used)*100/n_used));
286 BIO_puts(out,buf);
287 } 246 }
288 247
289#endif 248#endif