Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 244297 Details for
Bug 333277
ebuild submission: net-misc/asterisk-g729
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
collect-g729-stats
collect-g729-stats (text/plain), 4.74 KB, created by
Jaco Kroon
on 2010-08-23 21:48:34 UTC
(
hide
)
Description:
collect-g729-stats
Filename:
MIME Type:
Creator:
Jaco Kroon
Created:
2010-08-23 21:48:34 UTC
Size:
4.74 KB
patch
obsolete
>#! /bin/bash > >set -o pipefail > >nruns=5 > >cat <<DISCLAIMER >This script collects some basic information regarding the system it's run on, >specifically it does the following: > >1. Counts the number of cores on your system >2. Collects the vendor_id, cpu family, model, model name and stepping values of cpu 0 in /proc/cpuinfo. >3. Determines the MAC of the lower PCI ID NIC in your system. >4. Runs benchg729 a few times and extracts the timing values from it. >5. Determines the arch as per "uname -m". >6. The version of benchg729 that you have installed (which also contains the codec version). > >This is the only information this script gathers. It submits this data to >g729.uls.co.za, you can obtain some aggregated statistical data from this site >(it's public). If you do not agree that your data be added into this data, >please terminate this script now. > >This script will submit the run times for all codecs that the bench tool tests, >this is to allow us to with sufficient information discard outlier data. > >Please attempt to run this script when the rest of your system is idle in order >to provide the most accurate possible results. > >DISCLAIMER > >read -p "Please press ^C if you do not agree with this terms, or press enter to proceed..." A >echo > >echo "Attempting to locate the benchg729 utility (you can export benchg729 env var to override):" >[ -n "${benchg729}" ] && benchg729=$(which "${benchg729}") >if [ ! -x "${benchg729}" ]; then > echo -n "using which: " > benchg729=$(which benchg729 2>/dev/null) && echo $benchg729 || echo "No" >fi >if [ ! -x "${benchg729}" ]; then > echo -n "bash completion: " > for i in $(compgen -A command benchg729); do > [ -x "$(which $i)" ] && benchg729="$(which $i)" && break > done > [ -x "${benchg729}" ] && echo "${benchg729}" || echo "No" >fi >if [ ! -x "${benchg729}" ]; then > echo -n "Using locate: " > locate=$(which locate) > if [ -x "${locate}" ]; then > options=($("${locate}" benchg729 2>/dev/null)) > for i in "${options[@]}"; do > [ -x "$i" ] && benchg729="$i" && break > done > [ -x "${benchg729}" ] && echo "${benchg729}" || echo "No" > else > echo "not available." > fi >fi > >while [ ! -x "${benchg729}" ]; do > read -p "Error locating benchg729 tool, please enter the full path: " benchg729 >done > >echo "Using ${benchg729}" > >function get_cpu_field() >{ > awk -F'[[:space:]]*:[[:space:]]*' '$1 == "'"$1"'" { print $2; exit(0) }' /proc/cpuinfo >} > >tfile=$(mktemp /tmp/g729-bench-XXXXXX) >trap "rm '${tfile}'" EXIT >for i in $(seq 1 ${nruns}); do > echo "Performing run $i:" > "${benchg729}" | tee "${tfile}" || exit 1 > eval "$(sed -nre "s/^Average for flavor '([^']+)' is ([0-9]+) .*/flavor${i}_\1=\2/p" < "${tfile}" | tr '-' '_')" >done >flavors=($(sed -nre "s/^Average for flavor '([^']+)' .*/\1/p" < "${tfile}")) > >arch=$(uname -m) >ncpus=$(awk -F'[[:space:]]*:[[:space:]]*' '$1 == "processor" { maxid=$2 } END { print maxid+1 }' /proc/cpuinfo) > >cpu_vendor=$(get_cpu_field "vendor_id") >cpu_family=$(get_cpu_field "cpu family") >cpu_model=$(get_cpu_field "model") >cpu_name=$(get_cpu_field "model name") >cpu_stepping=$(get_cpu_field "stepping") > >iface=$(for i in /sys/class/net/*; do > [[ "$(<$i/type)" -eq 1 ]] && [[ "$(readlink $i)" != */virtual/* ]] && (readlink $i || sed -nre "s:^PHYSDEVPATH=(.*):../..\1/$(basename $i):p" < $i/uevent) >done | awk -F/ '{ print $5 " " $NF }' | sort | sed -nre '1 s/.* //p') >mac=$(</sys/class/net/${iface}/address) > >echo "Collected data:" >echo >echo "Kernel Arch: ${arch}" >echo "CPU Vendor: ${cpu_vendor}" >echo "CPU Family: ${cpu_family}" >echo "CPU Model: ${cpu_model}" >echo "CPU Name: ${cpu_name}" >echo "CPU Stepping: ${cpu_stepping}" >echo "Total Cores: ${ncpus}" >echo "MAC: ${mac} (from ${iface})" >echo "G.729 run times (ms):" > >for f in "${flavors[@]}"; do > printf "%-20s" "${f}" > for i in $(seq 1 ${nruns}); do > vname=flavor${i}_${f//-/_} > printf "%5d" "${!vname}" > done > echo >done > >function urlencode() { > echo "${@}" | sed -e 's: :+:g' \ > -e 's:(:%28:g' \ > -e 's:):%29:g' \ > -e 's:[[]:%5b:g' \ > -e 's:]:%5d:g' \ > -e 's:@:%40:g' \ > -e 's:=:%3d:g' \ > -e 's:/:%2f:g' >} > >post_data="arch=$(urlencode "${arch}")" >post_data+="&vendor=$(urlencode "${cpu_vendor}")" >post_data+="&family=$(urlencode "${cpu_family}")" >post_data+="&model=$(urlencode "${cpu_model}")" >post_data+="&name=$(urlencode "${cpu_name}")" >post_data+="&stepping=$(urlencode "${cpu_stepping}")" >post_data+="&ncpus=$(urlencode "${ncpus}")" >post_data+="&mac=$(urlencode "${mac}")" >#post_data+="&flavors=$(urlencode "${flavors[@]}")" >for f in "${flavors[@]}"; do > for i in $(seq 1 ${nruns}); do > vname=flavor${i}_${f//-/_} > post_data+="&$(urlencode "times[${f}][$i]")=$(urlencode "${!vname}")" > done >done > >echo "${post_data}" > >wget http://g729.uls.co.za/submit/ --post-data "${post_data}" -O "${tfile}" && cat "${tfile}" || echo "Data submission failed."
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 333277
:
243415
|
243417
|
243443
| 244297 |
279807
|
279907
|
285357