]> git.ipfire.org Git - thirdparty/glibc.git/commit
Print cache size and geometry auxv types on LD_SHOW_AUXV=1
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Wed, 19 Dec 2018 21:03:12 +0000 (19:03 -0200)
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Wed, 19 Dec 2018 21:08:02 +0000 (19:08 -0200)
commit1616d034b61622836d3a36af53dcfca7624c844e
tree726bc44d1290e06f31f2ee84d813403176cc9fe3
parent61595e3d36ded374f97961503e843a314b0203c2
Print cache size and geometry auxv types on LD_SHOW_AUXV=1

Add support for AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE,
AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY when
LD_SHOW_AUXV=1.

AT_L*_CACHESIZE is printed as decimal and represent the number of
bytes of the cache.

AT_L*_CACHEGEOMETRY is treated in order to specify the cache line size
and its associativity.

Example output from a POWER8:

AT_L1I_CACHESIZE:     32768
AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L1D_CACHESIZE:     65536
AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L2_CACHESIZE:      524288
AT_L2_CACHEGEOMETRY:  128B line size, 8-way set associative
AT_L3_CACHESIZE:      8388608
AT_L3_CACHEGEOMETRY:  128B line size, 8-way set associative

Some of the new types are longer than the previous ones, requiring to
increase the indentation in order to keep the values aligned.

* elf/dl-sysdep.c (auxvars): Add AT_L1I_CACHESIZE,
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY,
AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and
AT_L3_CACHEGEOMETRY.  Fix indentation when printing the other
fields.
(_dl_show_auxv): Give a special treatment to
AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY
and AT_L3_CACHEGEOMETRY.
* sysdeps/powerpc/dl-procinfo.h (cache_geometry): New function.
(_dl_procinfo): Fix indentation when printing AT_HWCAP and
AT_HWCAP2.  Add support for AT_L1I_CACHEGEOMETRY,
AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
ChangeLog
elf/dl-sysdep.c
sysdeps/powerpc/dl-procinfo.h