170 POWER7 and POWER7+ Optimization and Tuning Guide
Examples of alignment issues that cause an alignment interrupt include execution of a lmw or
lwarx instruction on a non-word-aligned boundary. These issues can be detected by running
alstat. This command can be invoked with an interval, which is the number of seconds
between each report. An example is presented in Example B-9.
Example B-9 Alignment issues can be addressed with the alstat command
> alstat 5
Alignment Alignment
SinceBoot Delta
2016 0
2016 0
2016 0
2016 0
2016 0
2016 0
The key metric in the alstat report is the Alignment Delta. This metric is the number of
alignment interrupts that occurred during the interval. Non-zero counts in this column merit
further investigation with tprof. Invoking tprof with the -E ALIGNMENT flag generates a profile
that shows where the unaligned references are occurring.
For more information, see alstat Command, available at:
http://publib.boulder.ibm.com/infocenter/aix/v7r1/index.jsp?topic=/com.ibm.aix.cmd
s/doc/aixcmds1/alstat.htm
Finding emulation issues
Over the 20+ year evolution of the Power instruction set, a few instructions were removed.
Instead of trapping programs that run these instructions, AIX emulates them in the kernel,
although with a significant processing impact. Generally, programs that are written in a
third-generation language (for example, C and C++) and compiled with an up-to-date
compiler do not contain these emulated instructions. However, older binary files or older
hand-written assembly language might contain such instructions, and because they are
silently emulated by AIX, the performance penalty might not be readily apparent.
The emstat command detects the presence of these instructions. Like alstat, it is invoked
with an interval, which is the number of seconds between reports. An example is shown in
Example B-10.
Example B-10 The emstat command detects the presence of emulated instructions
> emstat 5
Emulation Emulation
SinceBoot Delta
0 0
0 0
0 0
0 0
0 0
The key metric is the Emulation Delta (the number of instructions that are emulated during
each interval). Non-zero values merit further investigation. Invoking tprof with the -E
EMULATION flag generates a profile that shows where the emulated instructions are.