Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  drm_pmu.sh

  Sprache: Shell
 

#!/bin/bash
# DRM PMU
# SPDX-License-Identifier: GPL-2.0

set -e

output=$(mktemp /tmp/perf.drm_pmu.XXXXXX.txt)

cleanup() {
  rm -f "${output}"

  trap - EXIT TERM INT
}

trap_cleanup() {
  echo "Unexpected signal in ${FUNCNAME[1]}"
  cleanup
  exit 1
}
trap trap_cleanup EXIT TERM INT

# Array to store file descriptors and device names
declare -A device_fds

# Open all devices and store file descriptors. Opening the device will create a
# /proc/$$/fdinfo file containing the DRM statistics.
fd_count=3 # Start with file descriptor 3
for device in /dev/dri/*
do
  if [[ ! -c "$device" ]]
  then
    continue
  fi
  major=$(stat -c "%Hr" "$device")
  if [[ "$major" != 226 ]]
  then
    continue
  fi
  echo "Opening $device"
  eval "exec $fd_count<\"$device\""
  echo "fdinfo for: $device (FD: $fd_count)"
  cat "/proc/$$/fdinfo/$fd_count"
  echo
  device_fds["$device"]="$fd_count"
  fd_count=$((fd_count + 1))
done

if [[ ${#device_fds[@]} -eq 0 ]]
then
  echo "No DRM devices found [Skip]"
  cleanup
  exit 2
fi

# For each DRM event
err=0
for p in $(perf list --raw-dump drm-)
do
  echo -n "Testing perf stat of $p. "
  perf stat -e "$p" --pid=$$ true > "$output" 2>&1
  if ! grep -q "$p" "$output"
  then
    echo "Missing DRM event in: [Failed]"
    cat "$output"
    err=1
  else
    echo "[OK]"
  fi
done

# Close all file descriptors
for fd in "${device_fds[@]}"do
  eval "exec $fd<&-"
done

# Finished
cleanup
exit $err

Messung V0.5 in Prozent
C=96 H=90 G=93

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-06-07) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002