svn commit: r272339 - user/marcel/mkimg
Marcel Moolenaar
marcel at FreeBSD.org
Wed Oct 1 01:50:24 UTC 2014
Author: marcel
Date: Wed Oct 1 01:50:23 2014
New Revision: 272339
URL: http://svnweb.freebsd.org/changeset/base/272339
Log:
Remove image_chunk_dump() and its call-site. I used it for debugging
in the beginning, but not at the end. So, its value is marginal.
Below a performance comparison while running the unit test:
x old
+ new
N Min Max Median Avg Stddev
x 5 57.48 58.28 57.58 57.736 0.33886576
+ 5 46.82 47.61 46.93 47.034 0.32791767
Difference at 95.0% confidence
-10.702 +/- 0.486298
-18.5361% +/- 0.842279%
(Student's t, pooled s = 0.333437)
Modified:
user/marcel/mkimg/image.c
Modified: user/marcel/mkimg/image.c
==============================================================================
--- user/marcel/mkimg/image.c Wed Oct 1 01:18:25 2014 (r272338)
+++ user/marcel/mkimg/image.c Wed Oct 1 01:50:23 2014 (r272339)
@@ -117,32 +117,6 @@ image_swap_alloc(size_t size)
* Image chunk handling.
*/
-static void
-image_chunk_dump(int count)
-{
- struct chunk *ch;
-
- fprintf(stderr, "Dump %d: %u chunks:\n", count, image_nchunks);
- STAILQ_FOREACH(ch, &image_chunks, ch_list) {
- fprintf(stderr, "\tblk=%jd, sz=%zu, type=%u",
- (intmax_t)ch->ch_block, ch->ch_size, ch->ch_type);
- switch (ch->ch_type) {
- case CH_TYPE_ZEROES:
- fputc('\n', stderr);
- break;
- case CH_TYPE_FILE:
- fprintf(stderr, "; ofs=%jd, fd=%d\n",
- (intmax_t)ch->ch_u.file.ofs, ch->ch_u.file.fd);
- break;
- case CH_TYPE_MEMORY:
- fprintf(stderr, "; ptr=%p\n", ch->ch_u.mem.ptr);
- break;
- default:
- abort();
- }
- }
-}
-
static struct chunk *
image_chunk_find(lba_t blk)
{
@@ -650,9 +624,7 @@ image_data(lba_t blk, lba_t size)
lba_t
image_get_size(void)
{
- static int count = 0;
- image_chunk_dump(count++);
return (image_size);
}
More information about the svn-src-user
mailing list