Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 257cbe7d authored by Phil Burk's avatar Phil Burk
Browse files

aaudio: Fix parsing of power commands

Was not handling continuation lines and comments well.

Also extended the synthmark script.

Test: measure_device_power.py
Change-Id: If4a5085e26fefdbb6f9d94d48f6664d7b8d2d275
parent fda15906
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -225,13 +225,13 @@ def measureEnergyForCommands(fileName):
        line = fp.readline()
        while line:
            command = line.strip()
            if command.endswith('\\'):
                command = command[:-1].strip() # remove \\:
                runCommand(command)
            elif command.startswith("#"):
            if command.startswith("#"):
                # ignore comment
                print((command + "\n"))
                comment = command
                comment = command[1:].strip() # remove leading '#'
            elif command.endswith('\\'):
                command = command[:-1].strip() # remove \\
                runCommand(command)
            elif command:
                report = averageEnergyForCommand(command, DEFAULT_NUM_ITERATIONS)
                finalReport += comment + ", " + command + ", " + formatEnergyData(report) + "\n"
+45 −0
Original line number Diff line number Diff line
# Measure energy consumption with synthmark.

# ADPF <400 RR
adb root \
adb shell setprop vendor.powerhal.adpf.uclamp_min.high_limit 400 \
adb shell synthmark -tj -n1 -N50 -B2 -z1
adb shell synthmark -tj -n1 -N75 -B2 -z1
adb shell synthmark -tj -n1 -N100 -B2 -z1

# ADPF <500 RR
adb root \
adb shell setprop vendor.powerhal.adpf.uclamp_min.high_limit 500 \
adb shell synthmark -tj -n1 -N50 -B2 -z1
adb shell synthmark -tj -n1 -N75 -B2 -z1
adb shell synthmark -tj -n1 -N100 -B2 -z1

# ADPF <600 RR
adb root \
adb shell setprop vendor.powerhal.adpf.uclamp_min.high_limit 600 \
adb shell synthmark -tj -n1 -N50 -B2 -z1
adb shell synthmark -tj -n1 -N75 -B2 -z1
adb shell synthmark -tj -n1 -N100 -B2 -z1

# None
adb shell synthmark -tj -n1 -N50 -B2 -z0
adb shell synthmark -tj -n1 -N75 -B2 -z0
adb shell synthmark -tj -n1 -N100 -B2 -z0

# uclamp
# adb root \
# adb shell synthmark -tj -n1 -N75 -B2 -u1

# steady
# adb shell synthmark -tj -n75 -B2 -u0

# CPU affinity
# adb shell synthmark -tj -n1 -N75 -B2 -u0 -c1
# adb shell synthmark -tj -n1 -N75 -B2 -u0 -c4
# adb shell synthmark -tj -n1 -N75 -B2 -u0 -c6

# steady + affinity
# adb shell synthmark -tj -n75 -B2 -u0 -c1
# adb shell synthmark -tj -n75 -B2 -u0 -c4
# adb shell synthmark -tj -n75 -B2 -u0 -c6