(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dir) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(mktemp)} {(-d)})]) left_token: <Left_Backtick "`"> spids: [52 56] ) } spids: [51] ) ] spids: [51] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output_file) op: Equal rhs: {(DQ (cpufreq-bench.png))} spids: [58] ) ] spids: [58] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:global_title) op: Equal rhs: {(DQ ("cpufreq-bench plot"))} spids: [63] ) ] spids: [63] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:picture_type) op:Equal rhs:{(DQ (jpeg))} spids:[68])] spids: [68] ) (C {(file) (Lit_Other "[") (0) (Lit_Other "]") (Lit_Other "=") (DQ )}) (FuncDef name: usage body: (BraceGroup children: [ (C {(echo)} { (DQ ( "cpufreq-bench_plot.sh [OPTIONS] logfile [measure_title] [logfile [measure_title]] ...]" ) ) } ) (C {(echo)}) (C {(echo)} {(DQ (Options))}) (C {(echo)} {(DQ (" -o output_file"))}) (C {(echo)} {(DQ (" -t global_title"))}) (C {(echo)} {(DQ (" -p picture_type [jpeg|gif|png|postscript|...]"))}) (C {(exit)} {(1)}) ] spids: [88] ) spids: [82 87] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-eq)} {(0)} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [(C {(echo)} {(DQ ("No benchmark results file provided"))}) (C {(echo)}) (C {(usage)})] spids: [-1 148] ) ] spids: [-1 163] ) (While cond: [ (Sentence child: (C {(getopts)} {(o) (Lit_Other ":") (t) (Lit_Other ":") (p) (Lit_Other ":")} {(name)}) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (Case to_match: {($ VSub_Name "$name")} arms: [ (case_arm pat_list: [{(o)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:output_file) op: Equal rhs: {(DQ ($ VSub_Name "$OPTARG")) (.) ($ VSub_Name "$picture_type")} spids: [195] ) ] spids: [195] ) ] spids: [191 192 203 -1] ) (case_arm pat_list: [{(t)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:global_title) op: Equal rhs: {(DQ ($ VSub_Name "$OPTARG"))} spids: [210] ) ] spids: [210] ) ] spids: [206 207 216 -1] ) (case_arm pat_list: [{(p)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:picture_type) op: Equal rhs: {(DQ ($ VSub_Name "$OPTARG"))} spids: [223] ) ] spids: [223] ) ] spids: [219 220 229 -1] ) (case_arm pat_list: [{(Lit_Other "?")}] action: [(C {(usage)})] spids: [232 233 239 -1] ) ] spids: [184 188 242] ) ] spids: [181 244] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name "$OPTIND")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [248 254] ) } ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:plots) op:Equal rhs:{(0)} spids:[257])] spids: [257] ) (While cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("File ") ($ VSub_Number "$1") (" does not exist"))}) (C {(usage)}) ] spids: [-1 287] ) ] spids: [-1 302] ) (C {(file) (Lit_Other "[") ($ VSub_Name "$plots") (Lit_Other "]") (Lit_Other "=") (DQ ($ VSub_Number "$1")) } ) (C {(title) (Lit_Other "[") ($ VSub_Name "$plots") (Lit_Other "]") (Lit_Other "=") (DQ ($ VSub_Number "$2")) } ) (Sentence child:(C {(shift)}) terminator:<Op_Semi ";">) (C {(shift)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plots) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithVarRef name:plots) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [335 342] ) } spids: [334] ) ] spids: [334] ) ] spids: [270 344] ) ) (SimpleCommand words: [{(echo)} {(DQ ("set terminal ") ($ VSub_Name "$picture_type"))}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [354] ) ] ) (SimpleCommand words: [ {(echo)} { (DQ ("set output ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$output_file") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [368] ) ] ) (SimpleCommand words: [ {(echo)} { (DQ ("set title ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$global_title") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [382] ) ] ) (SimpleCommand words: [ {(echo)} { (DQ ("set xlabel ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ("sleep/load time") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [396] ) ] ) (SimpleCommand words: [ {(echo)} { (DQ ("set ylabel ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ("Performance (%)") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [410] ) ] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:plot) right: (ArithWord w:{(Lit_Digits 0)}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:plot) right: (ArithWord w:{($ VSub_Name "$plots")}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:plot)) body: (DoGroup children: [ (Pipeline children: [ (C {(cat)} { (BracedVarSub token: <VSub_Name file> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name "$plot")})) spids: [445 450] ) } ) (C {(grep)} {(-v)} {(DQ ("^#"))}) (C {(awk)} { (SQ < "{if ($2 != $3) printf(\"Error in measure %d:Load time %s does not equal sleep time %s, plot will not be correct\\n\", $1, $2, $3); ERR=1}" > ) } ) ] negated: False ) (Pipeline children: [ (C {(cat)} { (BracedVarSub token: <VSub_Name file> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name "$plot")})) spids: [484 489] ) } ) (C {(grep)} {(-v)} {(DQ ("^#"))}) (SimpleCommand words: [{(awk)} {(SQ <"{printf \"%lu %.1f\\n\",$2/1000, $6}">)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$dir") (/data_) ($ VSub_Name "$plot")} spids: [507] ) ] ) ] negated: False ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_Name "$plot")} {(-eq)} {(0)} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(-n)} {(DQ ("plot "))}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [537] ) ] ) ] spids: [-1 526] ) ] spids: [-1 543] ) (SimpleCommand words: [ {(echo)} {(-n)} { (DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ($ VSub_Name "$dir") (/data_) ($ VSub_Name "$plot") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" title ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (BracedVarSub token: <VSub_Name title> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name "$plot")})) spids: [558 563] ) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" with lines") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [568] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$plot")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [578 585] ) } {(-ne)} {($ VSub_Name "$plots")} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(-n)} {(DQ (", "))}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [604] ) ] ) ] spids: [-1 593] ) ] spids: [-1 610] ) ] spids: [431 612] ) ) (SimpleCommand words: [{(echo)}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$dir") (/plot_script.gpl)} spids: [616] ) ] ) (C {(gnuplot)} {($ VSub_Name "$dir") (/plot_script.gpl)}) (C {(rm)} {(-r)} {($ VSub_Name "$dir")}) ] )