DescriptionIgnore NaCl st_blksize of 0 and buffer writes to raw_fd_ostream.
The default LLVM raw_fd_ostream buffer size is based on stat'ing the
FD and then checking st_blksize. Unfortunately, in the NaCl sandboxed
build of pnacl-sz, NaCl's syscall returns st_blksize of 0 which makes
the writes unbuffered. There is a comment in "src/trusted/service_runtime/include/bits/stat.h":
nacl_abi_blksize_t nacl_abi_st_blksize; /* not implemented */
And the " src/trusted/desc/" implementation sets this to 0.
This results in half a million write syscalls to translate the GCC pexe,
which roughly doubles the translation time in sandboxed mode vs
unsandboxed mode.
Manually set a buffer size (Linux st_blksize seems to be about
4KB for comparison). This drops the number of write syscalls
to about 200 for translating the GCC pexe.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091
R=stichnot@chromium.org
Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=437ceff23f529d87a6dac702dd4bfbaec021321f
Patch Set 1 #
Messages
Total messages: 4 (1 generated)
|