(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:scriptname) op: Equal rhs: {($ VSub_Number "$0")} spids: [85] ) ] spids: [85] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:args) op:Equal rhs:{(DQ ($ VSub_Star "$*"))} spids:[88])] spids: [88] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:T) op: Equal rhs: {(/tmp/kvm.sh.) ($ VSub_Dollar "$$")} spids: [94] ) ] spids: [94] ) (C {(trap)} {(SQ <"rm -rf $T">)} {(0)}) (C {(mkdir)} {($ VSub_Name "$T")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dur) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{(Lit_Digits 30)}) right: (ArithWord w:{(Lit_Digits 60)}) ) spids: [112 117] ) } spids: [111] ) ] spids: [111] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:dryrun) op:Equal rhs:{(DQ )} spids:[119])] spids: [119] ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KVM) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: <Left_Backtick "`"> spids: [125 127] ) (/tools/testing/selftests/rcutorture) ) } spids: [123] ) ] spids: [123] ) terminator: <Op_Semi ";"> ) (C {(export)} {(KVM)}) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH) op: Equal rhs: {(${ VSub_Name KVM) (/bin) (Lit_Other ":") ($ VSub_Name "$PATH")} spids: [136] ) ] spids: [136] ) terminator: <Op_Semi ";"> ) (C {(export)} {(PATH)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_DEFCONFIG) op: Equal rhs: {(defconfig)} spids: [149] ) ] spids: [149] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:TORTURE_BOOT_IMAGE) op:Equal rhs:{(DQ )} spids:[152])] spids: [152] ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_INITRD) op: Equal rhs: {(DQ ($ VSub_Name "$KVM") (/initrd))} spids: [156] ) ] spids: [156] ) terminator: <Op_Semi ";"> ) (C {(export)} {(TORTURE_INITRD)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:TORTURE_KMAKE_ARG) op:Equal rhs:{(DQ )} spids:[167])] spids: [167] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_SHUTDOWN_GRACE) op: Equal rhs: {(180)} spids: [171] ) ] spids: [171] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:TORTURE_SUITE) op:Equal rhs:{(rcu)} spids:[174])] spids: [174] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:resdir) op:Equal rhs:{(DQ )} spids:[177])] spids: [177] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:configs) op:Equal rhs:{(DQ )} spids:[181])] spids: [181] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:cpus) op:Equal rhs:{(0)} spids:[185])] spids: [185] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ds) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(Lit_Other "+") (Lit_Other "%") (Y.) (Lit_Other "%") (m.) (Lit_Other "%") (d-) (Lit_Other "%") (H) (Lit_Other ":") (Lit_Other "%") (M) (Lit_Other ":") (Lit_Other "%") (S) } ) ] ) left_token: <Left_Backtick "`"> spids: [189 207] ) } spids: [188] ) ] spids: [188] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:jitter) op:Equal rhs:{(DQ (-1))} spids:[209])] spids: [209] ) (C {(.)} {(functions.sh)}) (FuncDef name: usage body: (BraceGroup children: [ (C {(echo)} {(DQ ("Usage: ") ($ VSub_Name "$scriptname") (" optional arguments:"))}) (C {(echo)} {(DQ (" --bootargs kernel-boot-arguments"))}) (C {(echo)} {(DQ (" --bootimage relative-path-to-kernel-boot-image"))}) (C {(echo)} {(DQ (" --buildonly"))}) (C {(echo)} { (DQ (" --configs ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ("config-file list w/ repeat factor (3*TINY01)") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ) } ) (C {(echo)} {(DQ (" --cpus N"))}) (C {(echo)} {(DQ (" --datestamp string"))}) (C {(echo)} {(DQ (" --defconfig string"))}) (C {(echo)} {(DQ (" --dryrun sched|script"))}) (C {(echo)} {(DQ (" --duration minutes"))}) (C {(echo)} {(DQ (" --interactive"))}) (C {(echo)} {(DQ (" --jitter N [ maxsleep (us) [ maxspin (us) ] ]"))}) (C {(echo)} {(DQ (" --kmake-arg kernel-make-arguments"))}) (C {(echo)} {(DQ (" --mac nn:nn:nn:nn:nn:nn"))}) (C {(echo)} {(DQ (" --no-initrd"))}) (C {(echo)} {(DQ (" --qemu-args qemu-system-..."))}) (C {(echo)} {(DQ (" --qemu-cmd qemu-system-..."))}) (C {(echo)} {(DQ (" --results absolute-pathname"))}) (C {(echo)} {(DQ (" --torture rcu"))}) (C {(exit)} {(1)}) ] spids: [225] ) spids: [220 224] ) (While cond: [(C {(test)} {($ VSub_Pound "$#")} {(-gt)} {(0)})] body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list: [{(--bootargs)} {(--bootarg)}] action: [ (C {(checkarg)} {(--bootargs)} {(DQ ("(list of kernel boot arguments)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <".*">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_BOOTARGS) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [426] ) ] spids: [426] ) (C {(shift)}) ] spids: [395 398 435 -1] ) (case_arm pat_list: [{(--bootimage)}] action: [ (C {(checkarg)} {(--bootimage)} {(DQ ("(relative path to kernel boot image)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"[a-zA-Z0-9][a-zA-Z0-9_]*">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_BOOT_IMAGE) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [467] ) ] spids: [467] ) (C {(shift)}) ] spids: [438 439 476 -1] ) (case_arm pat_list: [{(--buildonly)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_BUILDONLY) op: Equal rhs: {(1)} spids: [483] ) ] spids: [483] ) ] spids: [479 480 487 -1] ) (case_arm pat_list: [{(--configs)} {(--config)}] action: [ (C {(checkarg)} {(--configs)} {(DQ ("(list of config files)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"^[^/]*$">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configs) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [521] ) ] spids: [521] ) (C {(shift)}) ] spids: [490 493 530 -1] ) (case_arm pat_list: [{(--cpus)}] action: [ (C {(checkarg)} {(--cpus)} {(DQ ("(number)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"^[0-9]*$">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cpus) op: Equal rhs: {($ VSub_Number "$2")} spids: [562] ) ] spids: [562] ) (C {(shift)}) ] spids: [533 534 569 -1] ) (case_arm pat_list: [{(--datestamp)}] action: [ (C {(checkarg)} {(--datestamp)} {(DQ ("(relative pathname)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"^[^/]*$">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ds) op: Equal rhs: {($ VSub_Number "$2")} spids: [601] ) ] spids: [601] ) (C {(shift)}) ] spids: [572 573 608 -1] ) (case_arm pat_list: [{(--defconfig)}] action: [ (C {(checkarg)} {(--defconfig)} {(DQ (defconfigtype))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"^[^/][^/]*$">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_DEFCONFIG) op: Equal rhs: {($ VSub_Number "$2")} spids: [640] ) ] spids: [640] ) (C {(shift)}) ] spids: [611 612 647 -1] ) (case_arm pat_list: [{(--dryrun)}] action: [ (C {(checkarg)} {(--dryrun)} {(DQ ("sched|script"))} {($ VSub_Pound "$#")} {(DQ ($ VSub_Number "$2"))} {(SQ <"sched\\|script">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dryrun) op: Equal rhs: {($ VSub_Number "$2")} spids: [677] ) ] spids: [677] ) (C {(shift)}) ] spids: [650 651 684 -1] ) (case_arm pat_list: [{(--duration)}] action: [ (C {(checkarg)} {(--duration)} {(DQ ("(minutes)"))} {($ VSub_Pound "$#")} {(DQ ($ VSub_Number "$2"))} {(SQ <"^[0-9]*$">)} {(SQ <"^error">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dur) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Number "$2")}) right: (ArithWord w:{(Lit_Digits 60)}) ) spids: [715 720] ) } spids: [714] ) ] spids: [714] ) (C {(shift)}) ] spids: [687 688 726 -1] ) (case_arm pat_list: [{(--interactive)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_QEMU_INTERACTIVE) op: Equal rhs: {(1)} spids: [733] ) ] spids: [733] ) terminator: <Op_Semi ";"> ) (C {(export)} {(TORTURE_QEMU_INTERACTIVE)}) ] spids: [729 730 742 -1] ) (case_arm pat_list: [{(--jitter)}] action: [ (C {(checkarg)} {(--jitter)} {(DQ ("(# threads [ sleep [ spin ] ])"))} {($ VSub_Pound "$#")} {(DQ ($ VSub_Number "$2"))} {(SQ <"^-\\{,1\\}[0-9]\\+\\( \\+[0-9]\\+\\)\\{,2\\} *$">)} {(SQ <"^error$">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:jitter) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [772] ) ] spids: [772] ) (C {(shift)}) ] spids: [745 746 781 -1] ) (case_arm pat_list: [{(--kmake-arg)}] action: [ (C {(checkarg)} {(--kmake-arg)} {(DQ ("(kernel make arguments)"))} {($ VSub_Pound "$#")} {(DQ ($ VSub_Number "$2"))} {(SQ <".*">)} {(SQ <"^error$">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_KMAKE_ARG) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [811] ) ] spids: [811] ) (C {(shift)}) ] spids: [784 785 820 -1] ) (case_arm pat_list: [{(--mac)}] action: [ (C {(checkarg)} {(--mac)} {(DQ ("(MAC address)"))} {($ VSub_Pound "$#")} {(DQ ($ VSub_Number "$2"))} {(SQ <"^\\([0-9a-fA-F]\\{2\\}:\\)\\{5\\}[0-9a-fA-F]\\{2\\}$">)} {(error)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_QEMU_MAC) op: Equal rhs: {($ VSub_Number "$2")} spids: [848] ) ] spids: [848] ) (C {(shift)}) ] spids: [823 824 855 -1] ) (case_arm pat_list: [{(--no-initrd)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_INITRD) op: Equal rhs: {(DQ )} spids: [862] ) ] spids: [862] ) terminator: <Op_Semi ";"> ) (C {(export)} {(TORTURE_INITRD)}) ] spids: [858 859 872 -1] ) (case_arm pat_list: [{(--qemu-args)} {(--qemu-arg)}] action: [ (C {(checkarg)} {(--qemu-args)} {(DQ ("-qemu args"))} {($ VSub_Pound "$#")} {(DQ ($ VSub_Number "$2"))} {(SQ <"^-">)} {(SQ <"^error">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_QEMU_ARG) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [904] ) ] spids: [904] ) (C {(shift)}) ] spids: [875 878 913 -1] ) (case_arm pat_list: [{(--qemu-cmd)}] action: [ (C {(checkarg)} {(--qemu-cmd)} {(DQ ("(qemu-system-...)"))} {($ VSub_Pound "$#")} {(DQ ($ VSub_Number "$2"))} {(SQ <qemu-system->)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_QEMU_CMD) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [943] ) ] spids: [943] ) (C {(shift)}) ] spids: [916 917 952 -1] ) (case_arm pat_list: [{(--results)}] action: [ (C {(checkarg)} {(--results)} {(DQ ("(absolute pathname)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"^/">)} {(SQ <"^error">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:resdir) op: Equal rhs: {($ VSub_Number "$2")} spids: [984] ) ] spids: [984] ) (C {(shift)}) ] spids: [955 956 991 -1] ) (case_arm pat_list: [{(--shutdown-grace)}] action: [ (C {(checkarg)} {(--shutdown-grace)} {(DQ ("(seconds)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"^[0-9]*$">)} {(SQ <"^error">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_SHUTDOWN_GRACE) op: Equal rhs: {($ VSub_Number "$2")} spids: [1023] ) ] spids: [1023] ) (C {(shift)}) ] spids: [994 995 1030 -1] ) (case_arm pat_list: [{(--torture)}] action: [ (C {(checkarg)} {(--torture)} {(DQ ("(suite name)"))} {(DQ ($ VSub_Pound "$#"))} {(DQ ($ VSub_Number "$2"))} {(SQ <"^\\(lock\\|rcu\\|rcuperf\\)$">)} {(SQ <"^--">)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TORTURE_SUITE) op: Equal rhs: {($ VSub_Number "$2")} spids: [1062] ) ] spids: [1062] ) (C {(shift)}) ] spids: [1033 1034 1069 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(echo)} {(Unknown)} {(argument)} {($ VSub_Number "$1")}) (C {(usage)})] spids: [1072 1073 1088 -1] ) ] spids: [386 392 1091] ) (C {(shift)}) ] spids: [383 1096] ) ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CONFIGFRAG) op: Equal rhs: {(${ VSub_Name KVM) (/configs/) (${ VSub_Name TORTURE_SUITE)} spids: [1099] ) ] spids: [1099] ) terminator: <Op_Semi ";"> ) (C {(export)} {(CONFIGFRAG)}) (If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_Name "$configs"))})] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configs) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(cat)} {($ VSub_Name "$CONFIGFRAG") (/CFLIST)})] ) left_token: <Left_Backtick "`"> spids: [1129 1134] ) ) } spids: [1127] ) ] spids: [1127] ) ] spids: [-1 1124] ) ] spids: [-1 1137] ) (If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_Name "$resdir"))})] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:resdir) op: Equal rhs: {($ VSub_Name "$KVM") (/res)} spids: [1153] ) ] spids: [1153] ) ] spids: [-1 1150] ) ] spids: [-1 1157] ) (C {(touch)} {($ VSub_Name "$T") (/cfgcpu)}) (ForEach iter_name: CF iter_words: [{($ VSub_Name "$configs")}] do_arg_iter: False body: (DoGroup children: [ (Case to_match: {($ VSub_Name "$CF")} arms: [ (case_arm pat_list: [ {(Lit_Other "[") (0-9) (Lit_Other "]") (EscapedLiteralPart token:<Lit_EscapedChar "\\*">) (Lit_Other "*") } {(Lit_Other "[") (0-9) (Lit_Other "]") (Lit_Other "[") (0-9) (Lit_Other "]") (EscapedLiteralPart token:<Lit_EscapedChar "\\*">) (Lit_Other "*") } {(Lit_Other "[") (0-9) (Lit_Other "]") (Lit_Other "[") (0-9) (Lit_Other "]") (Lit_Other "[") (0-9) (Lit_Other "]") (EscapedLiteralPart token:<Lit_EscapedChar "\\*">) (Lit_Other "*") } ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:config_reps) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$CF")}) (C {(sed)} {(-e)} {(SQ <"s/\\*.*$//">)}) ] negated: False ) ] ) left_token: <Left_Backtick "`"> spids: [1216 1230] ) } spids: [1215] ) ] spids: [1215] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CF1) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$CF")}) (C {(sed)} {(-e)} {(SQ <"s/^[^*]*\\*//">)}) ] negated: False ) ] ) left_token: <Left_Backtick "`"> spids: [1234 1248] ) } spids: [1233] ) ] spids: [1233] ) ] spids: [1186 1212 1251 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:config_reps) op: Equal rhs: {(1)} spids: [1258] ) ] spids: [1258] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CF1) op: Equal rhs: {($ VSub_Name "$CF")} spids: [1262] ) ] spids: [1262] ) ] spids: [1254 1255 1266 -1] ) ] spids: [1179 1183 1269] ) (If arms: [ (if_arm cond: [(C {(test)} {(-f)} {(DQ ($ VSub_Name "$CONFIGFRAG") (/) ($ VSub_Name "$CF1"))})] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cpu_count) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(configNR_CPUS.sh)} {($ VSub_Name "$CONFIGFRAG") (/) ($ VSub_Name "$CF1")} ) ] ) left_token: <Left_Backtick "`"> spids: [1289 1295] ) } spids: [1288] ) ] spids: [1288] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cpu_count) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(configfrag_boot_cpus)} {(DQ ($ VSub_Name "$TORTURE_BOOTARGS"))} {(DQ ($ VSub_Name "$CONFIGFRAG") (/) ($ VSub_Name "$CF1"))} {(DQ ($ VSub_Name "$cpu_count"))} ) ] ) left_token: <Left_Backtick "`"> spids: [1299 1315] ) } spids: [1298] ) ] spids: [1298] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:cur_rep) right: (ArithWord w:{(Lit_Digits 0)}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:cur_rep) right: (ArithWord w:{($ VSub_Name "$config_reps")}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:cur_rep)) body: (DoGroup children: [ (SimpleCommand words: [{(echo)} {($ VSub_Name "$CF1")} {($ VSub_Name "$cpu_count")}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {($ VSub_Name "$T") (/cfgcpu)} spids: [1344] ) ] ) ] spids: [1335 1350] ) ) ] spids: [-1 1285] ) ] else_action: [ (C {(echo)} { (DQ ("The --configs file ") ($ VSub_Name "$CF1") (" does not exist, terminating.")) } ) (C {(exit)} {(1)}) ] spids: [1353 1370] ) ] spids: [1176 1372] ) spids: [1173 -1] ) (SimpleCommand words: [{(sort)} {(-k2nr)} {($ VSub_Name "$T") (/cfgcpu)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$T") (/cfgcpu.sort)} spids: [1381] ) ] ) (SimpleCommand words: [ {(awk)} {(-v)} {(Lit_VarLike "ncpus=") ($ VSub_Name "$cpus")} { (SQ <"\n"> <"BEGIN {\n"> <"\tnjobs = 0;\n"> <"}\n"> <"\n"> <"{\n"> <"\t# Read file of tests and corresponding required numbers of CPUs.\n"> <"\tcf[njobs] = $1;\n"> <"\tcpus[njobs] = $2;\n"> <"\tnjobs++;\n"> <"}\n"> <"\n"> <"END {\n"> <"\talldone = 0;\n"> <"\tbatch = 0;\n"> <"\tnc = -1;\n"> <"\n"> <"\t# Each pass through the following loop creates on test batch\n"> <"\t# that can be executed concurrently given ncpus. Note that a\n"> <"\t# given test that requires more than the available CPUs will run in\n"> <"\t# their own batch. Such tests just have to make do with what\n"> <"\t# is available.\n"> <"\twhile (nc != ncpus) {\n"> <"\t\tbatch++;\n"> <"\t\tnc = ncpus;\n"> <"\n"> <"\t\t# Each pass through the following loop considers one\n"> <"\t\t# test for inclusion in the current batch.\n"> <"\t\tfor (i = 0; i < njobs; i++) {\n"> <"\t\t\tif (done[i])\n"> <"\t\t\t\tcontinue; # Already part of a batch.\n"> <"\t\t\tif (nc >= cpus[i] || nc == ncpus) {\n"> <"\n"> <"\t\t\t\t# This test fits into the current batch.\n"> <"\t\t\t\tdone[i] = batch;\n"> <"\t\t\t\tnc -= cpus[i];\n"> <"\t\t\t\tif (nc <= 0)\n"> <"\t\t\t\t\tbreak; # Too-big test in its own batch.\n"> <"\t\t\t}\n"> <"\t\t}\n"> <"\t}\n"> <"\n"> <"\t# Dump out the tests in batch order.\n"> <"\tfor (b = 1; b <= batch; b++)\n"> <"\t\tfor (i = 0; i < njobs; i++)\n"> <"\t\t\tif (done[i] == b)\n"> <"\t\t\t\tprint cf[i], cpus[i];\n"> <"}"> ) } ] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {($ VSub_Name "$T") (/cfgcpu.sort)} spids: [1392] ) (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$T") (/cfgcpu.pack)} spids: [1397] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("CONFIGFRAG=") (Right_DoubleQuote "\"") ($ VSub_Name "$CONFIGFRAG") (Right_DoubleQuote "\"") ("; export CONFIGFRAG\n") ("KVM=") (Right_DoubleQuote "\"") ($ VSub_Name "$KVM") (Right_DoubleQuote "\"") ("; export KVM\n") ("PATH=") (Right_DoubleQuote "\"") ($ VSub_Name "$PATH") (Right_DoubleQuote "\"") ("; export PATH\n") ("TORTURE_BOOT_IMAGE=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_BOOT_IMAGE") (Right_DoubleQuote "\"") ("; export TORTURE_BOOT_IMAGE\n") ("TORTURE_BUILDONLY=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_BUILDONLY") (Right_DoubleQuote "\"") ("; export TORTURE_BUILDONLY\n") ("TORTURE_DEFCONFIG=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_DEFCONFIG") (Right_DoubleQuote "\"") ("; export TORTURE_DEFCONFIG\n") ("TORTURE_INITRD=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_INITRD") (Right_DoubleQuote "\"") ("; export TORTURE_INITRD\n") ("TORTURE_KMAKE_ARG=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_KMAKE_ARG") (Right_DoubleQuote "\"") ("; export TORTURE_KMAKE_ARG\n") ("TORTURE_QEMU_CMD=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_QEMU_CMD") (Right_DoubleQuote "\"") ("; export TORTURE_QEMU_CMD\n") ("TORTURE_QEMU_INTERACTIVE=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_QEMU_INTERACTIVE") (Right_DoubleQuote "\"") ("; export TORTURE_QEMU_INTERACTIVE\n") ("TORTURE_QEMU_MAC=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_QEMU_MAC") (Right_DoubleQuote "\"") ("; export TORTURE_QEMU_MAC\n") ("TORTURE_SHUTDOWN_GRACE=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_SHUTDOWN_GRACE") (Right_DoubleQuote "\"") ("; export TORTURE_SHUTDOWN_GRACE\n") ("TORTURE_SUITE=") (Right_DoubleQuote "\"") ($ VSub_Name "$TORTURE_SUITE") (Right_DoubleQuote "\"") ("; export TORTURE_SUITE\n") ("if ! test -e ") ($ VSub_Name "$resdir") ("\n") ("then\n") ("\tmkdir -p ") (Right_DoubleQuote "\"") ($ VSub_Name "$resdir") (Right_DoubleQuote "\"") (" || :\n") ("fi\n") ("mkdir ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("\n") ("echo Results directory: ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("\n") ("echo ") ($ VSub_Name "$scriptname") (" ") ($ VSub_Name "$args") ("\n") ("touch ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("/log\n") ("echo ") ($ VSub_Name "$scriptname") (" ") ($ VSub_Name "$args") (" >> ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("/log\n") ("echo ") (${ VSub_Name TORTURE_SUITE) (" > ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("/TORTURE_SUITE\n") ("pwd > ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("/testid.txt\n") ("if test -d .git\n") ("then\n") ("\tgit status >> ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("/testid.txt\n") ("\tgit rev-parse HEAD >> ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("/testid.txt\n") ("\tif ! git diff HEAD > ") ($ VSub_Name "$T") ("/git-diff 2>&1\n") ("\tthen\n") ("\t\tcp ") ($ VSub_Name "$T") ("/git-diff ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("\n") ("\tfi\n") ("fi\n") ) } do_expansion: True here_end: ___EOF___ was_filled: True spids: [1464] ) (Redir op_id:Redir_Great fd:-1 arg_word:{($ VSub_Name "$T") (/script)} spids:[1468]) ] ) (SimpleCommand words: [ {(awk)} {(-v)} {(Lit_VarLike "CONFIGDIR=") (DQ ($ VSub_Name "$CONFIGFRAG") (/))} {(-v)} {(Lit_VarLike "KVM=") (DQ ($ VSub_Name "$KVM"))} {(-v)} {(Lit_VarLike "ncpus=") ($ VSub_Name "$cpus")} {(-v)} {(Lit_VarLike "jitter=") (DQ ($ VSub_Name "$jitter"))} {(-v)} {(Lit_VarLike "rd=") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") (/)} {(-v)} {(Lit_VarLike "dur=") ($ VSub_Name "$dur")} {(-v)} {(Lit_VarLike "TORTURE_QEMU_ARG=") (DQ ($ VSub_Name "$TORTURE_QEMU_ARG"))} {(-v)} {(Lit_VarLike "TORTURE_BOOTARGS=") (DQ ($ VSub_Name "$TORTURE_BOOTARGS"))} { (SQ <"BEGIN {\n"> <"\ti = 0;\n"> <"}\n"> <"\n"> <"{\n"> <"\tcf[i] = $1;\n"> <"\tcpus[i] = $2;\n"> <"\ti++;\n"> <"}\n"> <"\n"> <"# Dump out the scripting required to run one test batch.\n"> <"function dump(first, pastlast, batchnum)\n"> <"{\n"> <"\tprint \"echo ----Start batch \" batchnum \": `date`\";\n"> <"\tprint \"echo ----Start batch \" batchnum \": `date` >> \" rd \"/log\";\n"> <"\tjn=1\n"> <"\tfor (j = first; j < pastlast; j++) {\n"> <"\t\tbuilddir=KVM \"/b\" jn\n"> <"\t\tcpusr[jn] = cpus[j];\n"> <"\t\tif (cfrep[cf[j]] == \"\") {\n"> <"\t\t\tcfr[jn] = cf[j];\n"> <"\t\t\tcfrep[cf[j]] = 1;\n"> <"\t\t} else {\n"> <"\t\t\tcfrep[cf[j]]++;\n"> <"\t\t\tcfr[jn] = cf[j] \".\" cfrep[cf[j]];\n"> <"\t\t}\n"> <"\t\tif (cpusr[jn] > ncpus && ncpus != 0)\n"> <"\t\t\tovf = \"-ovf\";\n"> <"\t\telse\n"> <"\t\t\tovf = \"\";\n"> <"\t\tprint \"echo \", cfr[jn], cpusr[jn] ovf \": Starting build. `date`\";\n"> <"\t\tprint \"echo \", cfr[jn], cpusr[jn] ovf \": Starting build. `date` >> \" rd \"/log\";\n"> <"\t\tprint \"rm -f \" builddir \".*\";\n"> <"\t\tprint \"touch \" builddir \".wait\";\n"> <"\t\tprint \"mkdir \" builddir \" > /dev/null 2>&1 || :\";\n"> <"\t\tprint \"mkdir \" rd cfr[jn] \" || :\";\n"> < "\t\tprint \"kvm-test-1-run.sh \" CONFIGDIR cf[j], builddir, rd cfr[jn], dur \" \\\"\" TORTURE_QEMU_ARG \"\\\" \\\"\" TORTURE_BOOTARGS \"\\\" > \" rd cfr[jn] \"/kvm-test-1-run.sh.out 2>&1 &\"\n" > <"\t\tprint \"echo \", cfr[jn], cpusr[jn] ovf \": Waiting for build to complete. `date`\";\n"> < "\t\tprint \"echo \", cfr[jn], cpusr[jn] ovf \": Waiting for build to complete. `date` >> \" rd \"/log\";\n" > <"\t\tprint \"while test -f \" builddir \".wait\"\n"> <"\t\tprint \"do\"\n"> <"\t\tprint \"\\tsleep 1\"\n"> <"\t\tprint \"done\"\n"> <"\t\tprint \"echo \", cfr[jn], cpusr[jn] ovf \": Build complete. `date`\";\n"> <"\t\tprint \"echo \", cfr[jn], cpusr[jn] ovf \": Build complete. `date` >> \" rd \"/log\";\n"> <"\t\tjn++;\n"> <"\t}\n"> <"\tfor (j = 1; j < jn; j++) {\n"> <"\t\tbuilddir=KVM \"/b\" j\n"> <"\t\tprint \"rm -f \" builddir \".ready\"\n"> <"\t\tprint \"if test -z \\\"$TORTURE_BUILDONLY\\\"\"\n"> <"\t\tprint \"then\"\n"> <"\t\tprint \"\\techo ----\", cfr[j], cpusr[j] ovf \": Starting kernel. `date`\";\n"> <"\t\tprint \"\\techo ----\", cfr[j], cpusr[j] ovf \": Starting kernel. `date` >> \" rd \"/log\";\n"> <"\t\tprint \"fi\"\n"> <"\t}\n"> <"\tnjitter = 0;\n"> <"\tsplit(jitter, ja);\n"> <"\tif (ja[1] == -1 && ncpus == 0)\n"> <"\t\tnjitter = 1;\n"> <"\telse if (ja[1] == -1)\n"> <"\t\tnjitter = ncpus;\n"> <"\telse\n"> <"\t\tnjitter = ja[1];\n"> <"\tfor (j = 0; j < njitter; j++)\n"> <"\t\tprint \"jitter.sh \" j \" \" dur \" \" ja[2] \" \" ja[3] \"&\"\n"> <"\tprint \"wait\"\n"> <"\tprint \"if test -z \\\"$TORTURE_BUILDONLY\\\"\"\n"> <"\tprint \"then\"\n"> <"\tprint \"\\techo ---- All kernel runs complete. `date`\";\n"> <"\tprint \"\\techo ---- All kernel runs complete. `date` >> \" rd \"/log\";\n"> <"\tprint \"fi\"\n"> <"\tfor (j = 1; j < jn; j++) {\n"> <"\t\tbuilddir=KVM \"/b\" j\n"> <"\t\tprint \"echo ----\", cfr[j], cpusr[j] ovf \": Build/run results:\";\n"> <"\t\tprint \"echo ----\", cfr[j], cpusr[j] ovf \": Build/run results: >> \" rd \"/log\";\n"> <"\t\tprint \"cat \" rd cfr[j] \"/kvm-test-1-run.sh.out\";\n"> <"\t\tprint \"cat \" rd cfr[j] \"/kvm-test-1-run.sh.out >> \" rd \"/log\";\n"> <"\t}\n"> <"}\n"> <"\n"> <"END {\n"> <"\tnjobs = i;\n"> <"\tnc = ncpus;\n"> <"\tfirst = 0;\n"> <"\tbatchnum = 1;\n"> <"\n"> <"\t# Each pass through the following loop considers one test.\n"> <"\tfor (i = 0; i < njobs; i++) {\n"> <"\t\tif (ncpus == 0) {\n"> <"\t\t\t# Sequential test specified, each test its own batch.\n"> <"\t\t\tdump(i, i + 1, batchnum);\n"> <"\t\t\tfirst = i;\n"> <"\t\t\tbatchnum++;\n"> <"\t\t} else if (nc < cpus[i] && i != 0) {\n"> <"\t\t\t# Out of CPUs, dump out a batch.\n"> <"\t\t\tdump(first, i, batchnum);\n"> <"\t\t\tfirst = i;\n"> <"\t\t\tnc = ncpus;\n"> <"\t\t\tbatchnum++;\n"> <"\t\t}\n"> <"\t\t# Account for the CPUs needed by the current test.\n"> <"\t\tnc -= cpus[i];\n"> <"\t}\n"> <"\t# Dump the last batch.\n"> <"\tif (ncpus != 0)\n"> <"\t\tdump(first, i, batchnum);\n"> <"}"> ) } ] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {($ VSub_Name "$T") (/cfgcpu.pack)} spids: [1618] ) (Redir op_id:Redir_DGreat fd:-1 arg_word:{($ VSub_Name "$T") (/script)} spids:[1805]) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("echo\n") ("echo\n") ("echo ") (Right_DoubleQuote "\"") (" --- ") (CommandSubPart command_list: (CommandList children:[(C {(date)})]) left_token: <Left_Backtick "`"> spids: [1827 1829] ) (" Test summary:") (Right_DoubleQuote "\"") ("\n") ("echo Results directory: ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("\n") ("kvm-recheck.sh ") ($ VSub_Name "$resdir") (/) ($ VSub_Name "$ds") ("\n") ) } do_expansion: True here_end: ___EOF___ was_filled: True spids: [1813] ) (Redir op_id:Redir_DGreat fd:-1 arg_word:{($ VSub_Name "$T") (/script)} spids:[1817]) ] ) (If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Name "$dryrun"))} {(Lit_Other "=")} {(script)})] action: [(C {(cat)} {($ VSub_Name "$T") (/script)}) (C {(exit)} {(0)})] spids: [-1 1856] ) (if_arm cond: [(C {(test)} {(DQ ($ VSub_Name "$dryrun"))} {(Lit_Other "=")} {(sched)})] action: [ (Pipeline children: [ (C {(egrep)} {(SQ <"Start batch|Starting build\\.">)} {($ VSub_Name "$T") (/script)}) (C {(grep)} {(-v)} {(DQ (">>"))}) (C {(sed)} {(-e)} {(SQ <"s/:.*$//">)} {(-e)} {(SQ <"s/^echo //">)}) ] negated: False ) (C {(exit)} {(0)}) ] spids: [1869 1881] ) ] else_action: [(C {(sh)} {($ VSub_Name "$T") (/script)})] spids: [1930 1942] ) ] )