[PATCH] D25766: [ELF] - Implemented --section-ordering-file option.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 05:11:54 PDT 2016


     1,963      page-faults               #    0.073 M/sec
>>   ....
>
>
> I may be missing something, but you probably cannot draw any conclusion from
> a program that completes in 30 milliseconds with 2k page faults. I think it
> is way too small. All positive/negative signals might have been buried in
> noise.

On time you cannot, but page faults should be pretty much deterministic.

I had suggested using perf trace to find where the page faults were
happening and order the sections accordingly. The problems is that
this then finds new page faults and we have to run multiple times to
find all the sections that are used at startup and still don't have
the complete order.

Something like icegrind looks like the most reliable way to do it, but
forward porting a prototype seems too much.

What I now think might be a reasonable way to find the sections is to
run perf record with a very hight frequency and then perf report -D to
show the samples.

Doing that with the attached script I was able to find a list of
symbols used during startup. The problem then is that many of them are
from libc and all have a section with the name .text, so a file with
section names cannot be used to order them.

George, given that there doesn't seem to be that many uses of this
format right now, how about just converting this patch to implement
--symbol-ordering-file? That way we would be able to say that, for
example, _int_malloc should be at the start of the file.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: run.sh
Type: application/x-sh
Size: 343 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161028/91738384/attachment.sh>


More information about the llvm-commits mailing list