(CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(DQ ($ VSub_Number "$1"))} spids:[79])] spids: [79] ) (C {(.)} {(tools/testing/selftests/rcutorture/bin/functions.sh)}) (If arms: [ (if_arm cond: [ (C {(test)} { (DQ (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(grep)} {(-c)} {(SQ <"rcu_exp_grace_period.*start">)}] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {($ VSub_Name "$i") (/console.log)} spids: [103] ) ] ) ] ) left_token: <Left_Backtick "`"> spids: [94 107] ) ) } {(-lt)} {(100)} ) ] action: [(C {(exit)} {(10)})] spids: [-1 114] ) ] spids: [-1 121] ) (Pipeline children: [ (SimpleCommand words: [{(sed)} {(-e)} {(SQ <"s/^\\[[^]]*]//">)}] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {($ VSub_Name "$i") (/console.log)} spids: [132] ) ] ) (C {(grep)} {(SQ <"us : rcu_exp_grace_period">)}) (C {(sed)} {(-e)} {(SQ <"s/us : / : /">)}) (C {(tr)} {(-d)} {(SQ <"\\015">)}) (C {(awk)} { (SQ <"\n"> <"$8 == \"start\" {\n"> <"\tif (starttask != \"\")\n"> <"\t\tnlost++;\n"> <"\tstarttask = $1;\n"> <"\tstarttime = $3;\n"> <"\tstartseq = $7;\n"> <"}\n"> <"\n"> <"$8 == \"end\" {\n"> <"\tif (starttask == $1 && startseq == $7) {\n"> <"\t\tcurgpdur = $3 - starttime;\n"> <"\t\tgptimes[++n] = curgpdur;\n"> <"\t\tgptaskcnt[starttask]++;\n"> <"\t\tsum += curgpdur;\n"> <"\t\tif (curgpdur > 1000)\n"> <"\t\t\tprint \"Long GP \" starttime \"us to \" $3 \"us (\" curgpdur \"us)\";\n"> <"\t\tstarttask = \"\";\n"> <"\t} else {\n"> <"\t\t# Lost a message or some such, reset.\n"> <"\t\tstarttask = \"\";\n"> <"\t\tnlost++;\n"> <"\t}\n"> <"}\n"> <"\n"> <"$8 == \"done\" {\n"> <"\tpiggybackcnt[$1]++;\n"> <"}\n"> <"\n"> <"END {\n"> <"\tnewNR = asort(gptimes);\n"> <"\tif (newNR <= 0) {\n"> <"\t\tprint \"No ftrace records found???\"\n"> <"\t\texit 10;\n"> <"\t}\n"> <"\tpct50 = int(newNR * 50 / 100);\n"> <"\tif (pct50 < 1)\n"> <"\t\tpct50 = 1;\n"> <"\tpct90 = int(newNR * 90 / 100);\n"> <"\tif (pct90 < 1)\n"> <"\t\tpct90 = 1;\n"> <"\tpct99 = int(newNR * 99 / 100);\n"> <"\tif (pct99 < 1)\n"> <"\t\tpct99 = 1;\n"> <"\tdiv = 10 ** int(log(gptimes[pct90]) / log(10) + .5) / 100;\n"> <"\tprint \"Histogram bucket size: \" div;\n"> <"\tlast = gptimes[1] - 10;\n"> <"\tcount = 0;\n"> <"\tfor (i = 1; i <= newNR; i++) {\n"> <"\t\tcurrent = div * int(gptimes[i] / div);\n"> <"\t\tif (last == current) {\n"> <"\t\t\tcount++;\n"> <"\t\t} else {\n"> <"\t\t\tif (count > 0)\n"> <"\t\t\t\tprint last, count;\n"> <"\t\t\tcount = 1;\n"> <"\t\t\tlast = current;\n"> <"\t\t}\n"> <"\t}\n"> <"\tif (count > 0)\n"> <"\t\tprint last, count;\n"> <"\tprint \"Distribution of grace periods across tasks:\";\n"> <"\tfor (i in gptaskcnt) {\n"> <"\t\tprint \"\\t\" i, gptaskcnt[i];\n"> <"\t\tnbatches += gptaskcnt[i];\n"> <"\t}\n"> <"\tngps = nbatches;\n"> <"\tprint \"Distribution of piggybacking across tasks:\";\n"> <"\tfor (i in piggybackcnt) {\n"> <"\t\tprint \"\\t\" i, piggybackcnt[i];\n"> <"\t\tngps += piggybackcnt[i];\n"> <"\t}\n"> <"\tprint \"Average grace-period duration: \" sum / newNR \" microseconds\";\n"> <"\tprint \"Minimum grace-period duration: \" gptimes[1];\n"> <"\tprint \"50th percentile grace-period duration: \" gptimes[pct50];\n"> <"\tprint \"90th percentile grace-period duration: \" gptimes[pct90];\n"> <"\tprint \"99th percentile grace-period duration: \" gptimes[pct99];\n"> <"\tprint \"Maximum grace-period duration: \" gptimes[newNR];\n"> < "\tprint \"Grace periods: \" ngps + 0 \" Batches: \" nbatches + 0 \" Ratio: \" ngps / nbatches \" Lost: \" nlost + 0;\n" > <"\tprint \"Computed from ftrace data.\";\n"> <"}"> ) } ) ] negated: False ) (C {(exit)} {(0)}) ] )