Created
October 8, 2019 23:28
-
-
Save enolan/e95bb5ff85b1718dcbd90eb5ce1bdf12 to your computer and use it in GitHub Desktop.
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
#/usr/bin/env bash | |
# Convert the XML output of malloc_info() into CSV for putting into a spreadsheet | |
echo -n "$(date -u '+%F %T' --date=$(basename $1))," | |
XMLCMD="xmlstarlet sel -I -t -v" | |
echo -n "$($XMLCMD 'count(//malloc/heap)' $1)," | |
echo -n "$($XMLCMD '//malloc/system[@type="current"]/@size' $1)," | |
echo -n "$($XMLCMD '//malloc/total[@type="fast"]/@size' $1)," | |
echo -n "$($XMLCMD '//malloc/total[@type="rest"]/@size' $1)," | |
echo -n "$($XMLCMD '//malloc/total[@type="mmap"]/@size' $1)" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment