Skip to content

Commit

Permalink
bugfi: get_fps: reset and print fps as 0 in when no available profile…
Browse files Browse the repository at this point in the history
… data
  • Loading branch information
NasdaqGodzilla committed Mar 22, 2023
1 parent b206676 commit 8c75f44
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions get_fps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function log_println() {
}

function log_err_print() {
[[ "$log_enable" == "true" ]] || return 0
echo -e $log_tag"[ERR]:\t""$@"
}

Expand Down Expand Up @@ -119,6 +120,7 @@ function profile_data_merge() {
if [ -z "$first_occur" ]
then
log_err_print "No available profile data"
calculate_done "FPS: "
return -1
fi

Expand Down Expand Up @@ -198,6 +200,10 @@ function calculate_fps() {
}

function calculate_done() {
[[ "0" -ge "$fps" ]] && { \
fps=0
}

[[ "$print_aver_total" == "true" ]] &&
echo "Average elapsed $aver_total ms" ||
# echo "$PREFIX$fps$SUFFIX"
Expand All @@ -218,6 +224,7 @@ log_print "Target pkg: "$target_pkg
if [ -z "$target_pkg" ]
then
log_err_print "NULL TARGET"
calculate_done "FPS: "
return -1
fi

Expand All @@ -241,6 +248,7 @@ data_end_line=$(echo "$gfxinfo" | grep "$data_end" -n | awk -F: '{print $1}')
if [ -z "$data_start_line" ] || [ -z "$data_end_line" ]
then
log_err_print "No available profile data"
calculate_done "FPS: "
return -1
fi

Expand Down

0 comments on commit 8c75f44

Please sign in to comment.