output per-module summary statistics on '-d nan'
(cherry picked from commit fb693a9722d46081fa53de69b672cd8186ba1252)