1#!/bin/bash 2# 3# Copyright 2021 The ANGLE Project Authors. All rights reserved. 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6# 7 8sleep_duration=$1 9if [ $sleep_duration -eq 0 ]; then 10 echo "No sleep_duration provided" 11 exit 1 12fi 13 14start_time=$SECONDS 15while true; do 16 pid=$(pidof com.android.angle.test:test_process) 17 case $pid in 18 ''|*[!0-9]*) echo pid is not a number ;; 19 *) echo com.android.angle.test:test_process $pid >> /sdcard/Download/gpumem.txt ;; 20 esac 21 dumpsys gpu --gpumem >> /sdcard/Download/gpumem.txt 22 time_elapsed=$(( SECONDS - start_time )) 23 echo "time_elapsed: $time_elapsed" >> /sdcard/Download/gpumem.txt 24 sleep $sleep_duration; 25done 26