(CommandList children: [ (BraceGroup children: [ (C {(.)} {(/DietPi/dietpi/func/dietpi-globals)}) (C {(G_CHECK_ROOT_USER)}) (C {(export)} {(Lit_VarLike 'G_PROGRAM_NAME=') (SQ <DietPi-CPU_set>)}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$G_HW_MODEL')}) right: (ArithWord w:{(Lit_Digits 20)}) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(-e)} { (DQ (Lit_Other '\\') ('nNotice: CPU Governors are not available for VM.') (Lit_Other '\\') (n) ) } ) (ControlFlow token:<ControlFlow_Exit exit>) ] spids: [16777215 102] ) ] spids: [16777215 122] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CPU_GOVERNOR) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/dietpi.txt)}) (C {(grep)} {(-m1)} {(SQ <'^CONFIG_CPU_GOVERNOR='>)}) (C {(sed)} {(SQ <'s/.*=//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [127 149] ) } spids: [126] ) ] spids: [126] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CPU_MAX_FREQ) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/dietpi.txt)}) (C {(grep)} {(-m1)} {(SQ <'^CONFIG_CPU_MAX_FREQ='>)}) (C {(sed)} {(SQ <'s/.*=//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [153 175] ) } spids: [152] ) ] spids: [152] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CPU_MIN_FREQ) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/dietpi.txt)}) (C {(grep)} {(-m1)} {(SQ <'^CONFIG_CPU_MIN_FREQ='>)}) (C {(sed)} {(SQ <'s/.*=//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [179 201] ) } spids: [178] ) ] spids: [178] ) (FuncDef name: Check_GPU_Gov_Available body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithUnary op_id: Arith_Bang child: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} { ( /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors ) } ) (C {(grep)} {(-ci)} {(-m1)} {(DQ ($ VSub_Name '$CPU_GOVERNOR'))} ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [222 238] ) } ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(G_DIETPI-NOTIFY)} {(1)} { (DQ ('CPU gov: ') ($ VSub_Name '$CPU_GOVERNOR') (', not supported by kernel') ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} { ( /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors ) } ) (C {(grep)} {(-ci)} {(-m1)} {(SQ <ondemand>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [264 280] ) } ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CPU_GOVERNOR) op: Equal rhs: {(SQ <ondemand>)} spids: [290] ) ] spids: [290] ) ] spids: [16777215 286] ) (if_arm cond: [ (Sentence child: (DParen child: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} { ( /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors ) } ) (C {(grep)} {(-ci)} {(-m1)} {(SQ <interactive>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [301 317] ) } ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CPU_GOVERNOR) op: Equal rhs: {(SQ <interactive>)} spids: [327] ) ] spids: [327] ) ] spids: [297 323] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CPU_GOVERNOR) op: Equal rhs: {(SQ <performance>)} spids: [338] ) ] spids: [338] ) ] spids: [334 345] ) (C {(G_DIETPI-NOTIFY)} {(2)} {(DQ ('Switching to CPU gov: ') ($ VSub_Name '$CPU_GOVERNOR'))} ) (C {(sed)} {(-i)} { (DQ ('/^CONFIG_CPU_GOVERNOR=/c') (Lit_Other '\\') ('CONFIG_CPU_GOVERNOR=') ($ VSub_Name '$CPU_GOVERNOR') ) } {(/DietPi/dietpi.txt)} ) ] spids: [16777215 244] ) ] spids: [16777215 379] ) ] spids: [208] ) spids: [205 208] ) (FuncDef name: Apply_CPU_Gov body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:input_gov_name) op: Equal rhs: {($ VSub_Number '$1')} spids: [396] ) ] spids: [394] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:input_core_start) op: Equal rhs: {($ VSub_Number '$2')} spids: [402] ) ] spids: [400] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:input_core_end) op: Equal rhs: {($ VSub_Number '$3')} spids: [408] ) ] spids: [406] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{($ VSub_Name '$input_core_start')}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{($ VSub_Name '$input_core_end')}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$input_gov_name'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpu) (DQ ($ VSub_Name '$i')) (/cpufreq/scaling_governor) } spids: [445] ) ] ) ] spids: [436 454] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr ops: [Op_DAmp] children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_EqualTilde left: {($ VSub_Name '$CPU_MAX_FREQ')} right: {(Lit_Other '^') (-) (Lit_Other '?') (Lit_Other '[') (0-9) (Lit_Other ']') (Lit_Other '+') (Lit_Other '$') } ) ) (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Name '$CPU_MAX_FREQ')}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:converted_hz_value) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$CPU_MAX_FREQ')}) right: (ArithWord w:{(Lit_Digits 1000)}) ) spids: [503 512] ) } spids: [502] ) ] spids: [500] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{($ VSub_Name '$input_core_start')}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{($ VSub_Name '$input_core_end')}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$converted_hz_value'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpu) (DQ ($ VSub_Name '$i')) (/cpufreq/scaling_max_freq) } spids: [545] ) ] ) ] spids: [535 555] ) ) (C {(G_DIETPI-NOTIFY)} {(2)} {(DQ ('Setting CPU max freq: ') ($ VSub_Name '$CPU_MAX_FREQ') (' MHz'))} ) ] spids: [16777215 496] ) ] spids: [16777215 571] ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr ops: [Op_DAmp] children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_EqualTilde left: {($ VSub_Name '$CPU_MIN_FREQ')} right: {(Lit_Other '^') (-) (Lit_Other '?') (Lit_Other '[') (0-9) (Lit_Other ']') (Lit_Other '+') (Lit_Other '$') } ) ) (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Name '$CPU_MIN_FREQ')}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:converted_hz_value) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$CPU_MIN_FREQ')}) right: (ArithWord w:{(Lit_Digits 1000)}) ) spids: [620 629] ) } spids: [619] ) ] spids: [617] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{($ VSub_Name '$input_core_start')}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{($ VSub_Name '$input_core_end')}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$converted_hz_value'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpu) (DQ ($ VSub_Name '$i')) (/cpufreq/scaling_min_freq) } spids: [662] ) ] ) ] spids: [652 672] ) ) (C {(G_DIETPI-NOTIFY)} {(2)} {(DQ ('Setting CPU min freq: ') ($ VSub_Name '$CPU_MIN_FREQ') (' MHz'))} ) ] spids: [16777215 613] ) ] spids: [16777215 688] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:cpu_throttle_up_percent) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/dietpi.txt)}) (C {(grep)} {(-m1)} {(SQ <'^CONFIG_CPU_USAGE_THROTTLE_UP='>)}) (C {(sed)} {(SQ <'s/.*=//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [695 717] ) } spids: [694] ) ] spids: [692] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$input_gov_name'))} {(Lit_Other '=')} {(interactive)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-f)} { ( /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(G_DIETPI-NOTIFY)} {(2)} { (DQ ('Setting go_hispeed_load: ') ($ VSub_Name '$cpu_throttle_up_percent') (' %') ) } ) (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$cpu_throttle_up_percent'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: { ( /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load ) } spids: [780] ) ] ) ] spids: [16777215 759] ) ] spids: [16777215 786] ) ] spids: [16777215 740] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$input_gov_name'))} {(Lit_Other '=')} {(ondemand)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:cpu_ondemand_sampling_rate) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/dietpi.txt)}) (C {(grep)} {(-m1)} {(SQ <'^CONFIG_CPU_ONDEMAND_SAMPLE_RATE='>)} ) (C {(sed)} {(SQ <'s/.*=//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [816 838] ) } spids: [815] ) ] spids: [813] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:cpu_ondemand_sampling_down_factor) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/dietpi.txt)}) (C {(grep)} {(-m1)} {(SQ <'^CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR='>)} ) (C {(sed)} {(SQ <'s/.*=//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [844 866] ) } spids: [843] ) ] spids: [841] ) (C {(G_DIETPI-NOTIFY)} {(2)} { (DQ ('Setting up_threshold: ') ($ VSub_Name '$cpu_throttle_up_percent') (' %') ) } ) (C {(G_DIETPI-NOTIFY)} {(2)} { (DQ ('Setting sampling_rate: ') ($ VSub_Name '$cpu_ondemand_sampling_rate') (' microseconds') ) } ) (C {(G_DIETPI-NOTIFY)} {(2)} { (DQ ('Setting sampling_down_factor: ') ($ VSub_Name '$cpu_ondemand_sampling_down_factor') ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-f)} {(/sys/devices/system/cpu/cpufreq/ondemand/up_threshold)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$cpu_throttle_up_percent'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpufreq/ondemand/up_threshold)} spids: [932] ) ] ) (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$cpu_ondemand_sampling_rate'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpufreq/ondemand/sampling_rate)} spids: [943] ) ] ) (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Name '$cpu_ondemand_sampling_down_factor'))} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: { ( /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor ) } spids: [954] ) ] ) ] spids: [16777215 922] ) ] else_action: [ (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{($ VSub_Name '$input_core_start')}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{($ VSub_Name '$input_core_end')}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$cpu_throttle_up_percent'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpu) (DQ ($ VSub_Name '$i')) (/cpufreq/ondemand/up_threshold) } spids: [1000] ) ] ) (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Name '$cpu_ondemand_sampling_rate'))} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpu) (DQ ($ VSub_Name '$i')) (/cpufreq/ondemand/sampling_rate) } spids: [1015] ) ] ) (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Name '$cpu_ondemand_sampling_down_factor'))} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpu) (DQ ($ VSub_Name '$i')) (/cpufreq/ondemand/sampling_down_factor) } spids: [1030] ) ] ) ] spids: [991 1039] ) ) ] spids: [964 1042] ) ] spids: [794 809] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$input_gov_name'))} {(Lit_Other '=')} {(SQ <conservative>)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cpu_throttle_up_percent) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(/DietPi/dietpi.txt)}) (C {(grep)} {(-m1)} {(SQ <'^CONFIG_CPU_USAGE_THROTTLE_UP='>)} ) (C {(sed)} {(SQ <'s/.*=//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1072 1094] ) } spids: [1071] ) ] spids: [1071] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{($ VSub_Name '$G_HW_MODEL')}) right: (ArithWord w:{(Lit_Digits 11)}) ) ) terminator: <Op_Semi ';'> ) ] action: [ (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{($ VSub_Name '$input_core_start')}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w:{($ VSub_Name '$input_core_end')}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Name '$cpu_throttle_up_percent'))} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpu) (DQ ($ VSub_Name '$i')) (/cpufreq/conservative/up_threshold) } spids: [1149] ) ] ) ] spids: [1139 1159] ) ) ] spids: [16777215 1116] ) ] else_action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$cpu_throttle_up_percent'))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/sys/devices/system/cpu/cpufreq/conservative/up_threshold)} spids: [1173] ) ] ) ] spids: [1163 1179] ) ] spids: [1050 1067] ) ] spids: [16777215 1183] ) ] spids: [390] ) spids: [387 390] ) (C {(G_DIETPI-NOTIFY)} {(3)} {(DietPi-Cpu_Set)} {(DQ ('Applying CPU gov'))}) (C {(Check_GPU_Gov_Available)}) (C {(Apply_CPU_Gov)} {(DQ ($ VSub_Name '$CPU_GOVERNOR'))} {(0)} {($ VSub_Name '$G_HW_CPU_CORES')}) (C {(G_DIETPI-NOTIFY)} {(0)} {(DQ ('CPU gov applied: ') ($ VSub_Name '$CPU_GOVERNOR') (Lit_Other '\\') (n))} ) (ControlFlow token:<ControlFlow_Exit exit>) ] spids: [3] ) ] )