File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,28 @@ If you want to get/set the affinity directly you can do
123123
124124 long currentAffinity = AffinitySupport.getAffinity();
125125 AffinitySupport.setAffinity(1L << 5); // lock to CPU 5.
126+
127+ ## Debugging affinity state
128+
129+ For a detailed of view of the current affinity state (as seen by the library),
130+ execute the following script on Linux systems:
131+
132+ ```
133+ # change to the affinity lock-file directory (defaults to system property java.io.tmpdir)
134+ $ cd /tmp
135+
136+ # dump affinity state
137+ $ for i in "$(ls cpu-*)";
138+ do PID="$(cat $i | head -n1)"; TIMESTAMP="$(cat $i | tail -n1)";
139+ echo "pid $PID locked at $TIMESTAMP in $i"; taskset -cp $PID;
140+ cat "/proc/$PID/cmdline"; echo; echo
141+ done
142+
143+ pid 14584 locked at 2017.10.30 at 10:33:24 GMT in cpu-3.lock
144+ pid 14584's current affinity list: 3
145+ /opt/jdk1.8.0_141/bin/java ...
146+
147+ ```
126148
127149# Support Material
128150
You can’t perform that action at this time.
0 commit comments