summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-04-15 22:27:03 +0000
committerrodri <rgl@antares-labs.eu>2024-04-15 22:27:03 +0000
commitdf92f606034a287ef2cbd3ca3d5ac7a2622ddb9e (patch)
treecf2e2fac2d79c5f411b20b7245b03ae547508c2e
parent53dcc34e34cca4453017bae72c0944f2fe1c93fb (diff)
downloadrenderfs-df92f606034a287ef2cbd3ca3d5ac7a2622ddb9e.tar.gz
renderfs-df92f606034a287ef2cbd3ca3d5ac7a2622ddb9e.tar.bz2
renderfs-df92f606034a287ef2cbd3ca3d5ac7a2622ddb9e.zip
show pipeline stage times in the stats file.
-rw-r--r--fs.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/fs.c b/fs.c
index 011baf2..32828f6 100644
--- a/fs.c
+++ b/fs.c
@@ -167,6 +167,7 @@ resetcamera(Camera *c)
placecamera(c, Pt3(0,0,100,1), Pt3(0,0,0,1), Vec3(0,1,0));
reloadcamera(c);
memset(&c->stats, 0, sizeof c->stats);
+ memset(&c->times, 0, sizeof c->times);
}
static ulong
@@ -392,11 +393,11 @@ fsread(Req *r)
{
Client *c;
Framebuf *fb;
- Memimage *i;
+ Memimage *img;
char buf[1024], cbuf[30], *t;
uvlong path;
ulong off, cnt;
- int n;
+ int n, i;
path = r->fid->qid.path;
off = r->ifcall.offset;
@@ -426,17 +427,24 @@ fsread(Req *r)
!c->cam->stats.avg? 0: 1e9/c->cam->stats.avg,
!c->cam->stats.min? 0: 1e9/c->cam->stats.min,
!c->cam->stats.v? 0: 1e9/c->cam->stats.v);
+ n += snprint(buf+n, sizeof(buf)-n, "times\n");
+ for(i = 0; i < c->cam->times.cur; i++)
+ n += snprint(buf+n, sizeof(buf)-n, "%d\tR\t[%llud %llud] (%.0f µs)\n\tE\t[%llud %llud] (%.0f µs)\n\tTn\t[%llud %llud] (%.0f µs)\n\tRn\t[%llud %llud] (%.0f µs)\n",
+ i, c->cam->times.R[i].t0, c->cam->times.R[i].t1, (c->cam->times.R[i].t1-c->cam->times.R[i].t0)/1e3,
+ c->cam->times.E[i].t0, c->cam->times.E[i].t1, (c->cam->times.E[i].t1-c->cam->times.E[i].t0)/1e3,
+ c->cam->times.Tn[i].t0, c->cam->times.Tn[i].t1, (c->cam->times.Tn[i].t1-c->cam->times.Tn[i].t0)/1e3,
+ c->cam->times.Rn[i].t0, c->cam->times.Rn[i].t1, (c->cam->times.Rn[i].t1-c->cam->times.Rn[i].t0)/1e3);
snprint(buf+n, sizeof(buf)-n, "frame #%llud\n", c->cam->stats.nframes);
readstr(r, buf);
respond(r, nil);
break;
case Qframe:
fb = c->cam->vp->getfb(c->cam->vp);
- i = fb->cb;
+ img = fb->cb;
if(off < 5*12){
n = snprint(buf, sizeof buf, "%11s %11d %11d %11d %11d ",
- chantostr(cbuf, i->chan),
- i->r.min.x, i->r.min.y, i->r.max.x, i->r.max.y);
+ chantostr(cbuf, img->chan),
+ img->r.min.x, img->r.min.y, img->r.max.x, img->r.max.y);
t = estrdup9p(buf);
if(off > n){
@@ -459,7 +467,7 @@ fsread(Req *r)
t = malloc(cnt);
if(t != nil){
r->ofcall.data = t;
- n = readimg(i, t, i->r, off, cnt);
+ n = readimg(img, t, img->r, off, cnt);
}
if(n < 0){