summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-09-01 14:54:56 +0000
committerrodri <rgl@antares-labs.eu>2024-09-01 14:54:56 +0000
commit3b4794b3730d33bedb08f2105b40e7ce23fb3aa7 (patch)
treecfe3a6961d4e506b99205252ff90fa026488dd6d
parent209af11a2e6ad830a1645da31d9e668c02e57240 (diff)
download3dee-3b4794b3730d33bedb08f2105b40e7ce23fb3aa7.tar.gz
3dee-3b4794b3730d33bedb08f2105b40e7ce23fb3aa7.tar.bz2
3dee-3b4794b3730d33bedb08f2105b40e7ce23fb3aa7.zip
debug/plmon: fix a parsing error. take file as an argument.
-rw-r--r--debug/plmon.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/debug/plmon.c b/debug/plmon.c
index b017820..354ddb6 100644
--- a/debug/plmon.c
+++ b/debug/plmon.c
@@ -289,7 +289,7 @@ redraw(void)
dy = (Dy(screen->r) - font->height)/sched.ntask;
for(i = 0; i < sched.ntask; i++){
yoff = i*dy+dy;
- string(screen, addpt(screen->r.min, Pt(0,yoff)), pal[CMain], ZP, font, sched.tasks[i].name);
+ string(screen, addpt(screen->r.min, Pt(Graphoff/2,yoff)), pal[CMain], ZP, font, sched.tasks[i].name);
line(screen, addpt(screen->r.min, Pt(Graphoff/2,yoff+font->height)), addpt(screen->r.min, Pt(Graphoff,yoff+font->height)), 0, 0, 0, pal[CMain], ZP);
graphrf.p.y = yoff;
@@ -316,7 +316,7 @@ redraw(void)
void
usage(void)
{
- fprint(2, "usage: %s\n", argv0);
+ fprint(2, "usage: %s [file]\n", argv0);
exits("usage");
}
@@ -335,10 +335,10 @@ threadmain(int argc, char *argv[])
ARGBEGIN{
default: usage();
}ARGEND
- if(argc != 0)
+ if(argc > 1)
usage();
- bin = Bfdopen(0, OREAD);
+ bin = argc? Bopen(argv[0], OREAD): Bfdopen(0, OREAD);
if(bin == nil)
sysfatal("Bfdopen: %r");
while((line = Brdline(bin, '\n')) != nil){
@@ -346,8 +346,8 @@ threadmain(int argc, char *argv[])
nf = tokenize(line, f, 3);
if(nf != 3)
continue;
- s.t0 = strtoul(f[1], nil, 10);
- s.t1 = strtoul(f[2], nil, 10);
+ s.t0 = strtoull(f[1], nil, 10);
+ s.t1 = strtoull(f[2], nil, 10);
if(s.t0 >= s.t1)
continue;
addt(f[0], s);