[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/15295] gas rebuffer_line() routine (listing.c) issues excessive
From: |
jtison at us dot ibm.com |
Subject: |
[Bug gas/15295] gas rebuffer_line() routine (listing.c) issues excessive read syscalls |
Date: |
Mon, 25 Mar 2013 16:07:13 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=15295
--- Comment #2 from Jim Tison <jtison at us dot ibm.com> 2013-03-25 16:07:13
UTC ---
Looks like a good fread() at line 626 is going to return 1, not 99, at least
according to the manual page. When I put the patch under gdb, I see '1'
consistently. I get 6,473 assembler warnings stating "Warning: unable to
rebuffer file".
I tried making that change to fread(), and now 'as' returns these for times and
strace summary:
time as-2.23-1 -o offldr.o -alshdg=offldr.lst offldr.s
real 1m6.492s
user 0m55.526s
sys 0m10.656s
strace -c as-2.23-1 -o offldr.o -alshdg=offldr.lst offldr.s
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
88.57 113.230591 3 43456033 lseek
10.91 13.946411 4 3160831 read
0.15 0.190372 14 13462 208 open
0.14 0.184666 14 13248 munmap
0.08 0.096489 7 13254 close
0.06 0.082295 55 1501 write
0.05 0.061030 5 13272 mmap
0.03 0.040859 3 13255 fstat
0.00 0.001632 4 401 brk
0.00 0.001362 7 192 189 stat
0.00 0.000863 863 1 unlink
0.00 0.000238 238 1 execve
0.00 0.000053 13 4 fadvise64
0.00 0.000039 7 6 mprotect
0.00 0.000007 7 1 1 access
0.00 0.000006 3 2 fcntl
0.00 0.000003 3 1 getrusage
0.00 0.000003 3 1 lstat
------ ----------- ----------- --------- --------- ----------------
100.00 127.836919 46685466 398 total
Improved, but still a bit inefficient (? what say you ?) with respect to
lseek() syscalls, I'd think. I have this nagging feeling I've missed something
else. There are a lot of read() calls, too, but in this case, something has
sped up the wall clock execution by a factor of 4, which I'll take if that's
the best we can do. The quality of the listing also seems perfect: the source
code matches up with the .loc counters from start to finish.
Re "no listings", I've been arguing that case for at least 10 years and losing
every time. We have a shop full of people who can read & write assembler but
don't trust themselves in C. Someday I (or my successor) will win this
argument.
Thank you, Nick. I look forward to your next patch (at least that fread() needs
to be fixed). Appreciate the effort & attention.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.