From owner-p4-projects@FreeBSD.ORG Fri Dec 14 00:22:11 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 16C4E193; Fri, 14 Dec 2012 00:22:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA44B18F for ; Fri, 14 Dec 2012 00:22:10 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 946208FC12 for ; Fri, 14 Dec 2012 00:22:10 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE0MAn4069291 for ; Fri, 14 Dec 2012 00:22:10 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id qBE0MADn069288 for perforce@freebsd.org; Fri, 14 Dec 2012 00:22:10 GMT (envelope-from brooks@freebsd.org) Date: Fri, 14 Dec 2012 00:22:10 GMT Message-Id: <201212140022.qBE0MADn069288@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219907 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 00:22:11 -0000 http://p4web.freebsd.org/@@219907?ac=10 Change 219907 by brooks@brooks_zenith on 2012/12/14 00:21:24 Total up the time take to render a composite slide and print it out in the verbose case. Remove an extra variable name left from a previous code flow. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#20 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#20 (text+ko) ==== @@ -450,9 +450,11 @@ char sntext[8]; uint32_t *snimage; uint32_t r; - struct iboxstate *is, *hdris; + uint64_t decode, total; + struct iboxstate *is; error = 0; + decode = total = 0; busy(1); @@ -473,6 +475,8 @@ warnx("png_read_finish() failed for %s", slide); return (-1); } + decode += iboxstate_get_dtime(is); + total += iboxstate_get_ttime(is); fb_fill_region(white, 0, 0, fb_width, fb_height); busy(0); /* @@ -558,6 +562,8 @@ warnx("png_read_finish() failed for sri.png"); return (-1); } + decode += iboxstate_get_dtime(is); + total += iboxstate_get_ttime(is); fb_post_region(__DEVOLATILE(uint32_t *, is->buffer), slide_fcol, fb_height - is->height, is->width, is->height); if (sb_vis && sb != SB_NONE) @@ -578,6 +584,8 @@ warnx("png_read_finish() failed for ucam.png"); return (-1); } + decode += iboxstate_get_dtime(is); + total += iboxstate_get_ttime(is); fb_post_region(__DEVOLATILE(uint32_t *, is->buffer), slide_fcol + slide_width - is->width, fb_height - is->height, is->width, is->height); @@ -613,28 +621,33 @@ warn("Failed to open header.png"); return (-1); } - if ((hdris = png_read_start(pfd, slide_width, fb_height, sb)) == NULL) { + if ((is = png_read_start(pfd, slide_width, fb_height, sb)) == NULL) { warn("Failed to start PNG decode for header.png"); return (-1); } - if (png_read_finish(hdris) != 0) { + if (png_read_finish(is) != 0) { warnx("png_read_finish() failed for header.png"); return (-1); } + decode += iboxstate_get_dtime(is); + total += iboxstate_get_ttime(is); /* Fill in the header's background. */ - for (r = 0; r < hdris->height; r++) - fb_fill_region(hdris->buffer[r * hdris->width], 0, r, + for (r = 0; r < is->height; r++) + fb_fill_region(is->buffer[r * is->width], 0, r, fb_width, 1); - fb_post_region(__DEVOLATILE(uint32_t *, hdris->buffer), - slide_fcol + slide_width - hdris->width, 0, hdris->width, - hdris->height); + fb_post_region(__DEVOLATILE(uint32_t *, is->buffer), + slide_fcol + slide_width - is->width, 0, is->width, is->height); if (sb_vis && sb != SB_NONE) - fb_rectangle(red, 2, slide_fcol + slide_width - hdris->width, - 0, hdris->width, hdris->height); - iboxstate_free(hdris); + fb_rectangle(red, 2, slide_fcol + slide_width - is->width, + 0, is->width, is->height); + iboxstate_free(is); unbusy(); + if (verbose) + printf("total: %ju decode: %ju overhead: %.1f%%\n", total, + decode, 100.0 * (((float)total - decode) / total)); + return (error); }