Created
February 6, 2017 10:45
-
-
Save eguiraud/a268425664d0272962afac3577a6cf19 to your computer and use it in GitHub Desktop.
use templight to compile a root source and produce parsed profile info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # N.B. requires gawk, recode, templight++ and templigt-convert to be in PATH | |
| SRC="$1" | |
| if [[ -z "${SRC}" ]]; then | |
| exit 1 | |
| fi | |
| FNAME=${SRC%.C} | |
| FNAME=${FNAME%.cpp} | |
| FNAME=${FNAME%.cxx} | |
| # profile compilation executable | |
| templight++ -Xtemplight -profiler -Xtemplight -ignore-system -c "$SRC" `root-config --cflags` | |
| # convert trace to xml | |
| templight-convert -f graphml "${FNAME}.o.trace.pbf" > "${FNAME}.xml" | |
| # parse xml, output file contains two colums "TIME CONTEXT" | |
| awk -F '[<>]' '/key="d1"/ { context=$3 } /key="d3"/ { if($3 != "0.000000000") { print $3, context } }' "${FNAME}.xml" | \ | |
| sort -k1 -r | recode html..ascii |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment