Skip to content

Commit

Permalink
added tools directory
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelog committed Feb 7, 2011
1 parent d8b4c50 commit 122149e
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tools/getstats.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
file=${1}
OLDIFS=$IFS
echo "------------------------"
echo -n "malloc: "
grep -ni allocated ${file} | wc -l
echo "------------------------"
echo -n "mfree: "
grep -ni freeing ${file} | wc -l
echo "------------------------"
echo "Inconsistent alloced to free: "
tools/mm_trace.sh ${file} | grep \:1
echo "------------------------"
echo -n "Warns: "
warns=`grep -ni "WARN - " ${file}`
let i=0
IFS=$'\n'
for j in ${warns}; do
let i+=1
done
echo ${i}
if [ "${i}" -gt "0" ]; then
for j in ${warns}; do
echo ${j}
done
fi
echo "------------------------"
echo -n "Nops: "
grep -ni "Sent NOP" ${file} | wc -l
echo "------------------------"
echo -n "KeepAlives: "
grep -ni "keepalive - Woke up" ${file} | wc -l
echo "------------------------"
echo -n "Execs: "
grep -ni "mdm_device_exec" ${file} | grep -i start| wc -l
echo "------------------------"
echo -n "73xx Execs: "
grep 73xx_exec ${file} | grep -vi pre | grep -vi post | grep -i start | grep -vi got | wc -l
echo "------------------------"
echo -n "8426 Execs: "
grep 8426_exec ${file} | grep -vi pre | grep -vi post | grep -i start | grep -vi got | wc -l
echo "------------------------"
echo -n "9xxx Execs: "
grep 9xxx_exec ${file} | grep -vi pre | grep -vi post | grep -i start | grep -vi got | wc -l
echo "------------------------"
echo -n "Errors: "
errors=`grep -n "ERROR - " ${file}`
let i=0
for j in ${errors}; do
let i+=1
done
echo ${i}
if [ "${i}" -gt "0" ]; then
for j in ${errors}; do
echo ${j}
done
fi
echo "------------------------"
IFS=$OLDIFS

2 changes: 2 additions & 0 deletions tools/mm_debug_get_allocated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
file=${1}
grep -i allocated ${file} | cut -d'x' -f3
2 changes: 2 additions & 0 deletions tools/mm_debug_get_freed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
file=${1}
grep -i freeing ${file} | cut -d'x' -f3
4 changes: 4 additions & 0 deletions tools/mm_debug_get_nonallocated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
tools/mm_debug_get_freed.sh > /tmp/freed
tools/mm_debug_get_allocated.sh > /tmp/allocated
for i in `cat /tmp/freed`; do grep ${i} /tmp/allocated > /dev/null; echo ${i}\:${?}; done | grep \:1
4 changes: 4 additions & 0 deletions tools/mm_debug_get_nonfreed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
tools/mm_debug_get_freed.sh > /tmp/freed
tools/mm_debug_get_allocated.sh > /tmp/allocated
for i in `cat /tmp/allocated`; do grep ${i} /tmp/freed > /dev/null; echo ${i}\:${?}; done | grep \:1
26 changes: 26 additions & 0 deletions tools/mm_trace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
file=${1}
tools/mm_debug_get_freed.sh ${file} > /tmp/freed
tools/mm_debug_get_allocated.sh ${file} > /tmp/allocated
for i in `cat /tmp/allocated | sort -u`; do
echo -n "A:${i}:"
total=`grep ${i} ${file} | wc -l | tr -d "\t"`
echo -n "$total:"
mod=$(($total % 2))
if [ ! "${mod}" -eq "0" ]; then
echo "1"
else
echo "0"
fi
done
for i in `cat /tmp/freed | sort -u`; do
echo -n "F:${i}:"
total=`grep ${i} ${file} | wc -l | tr -d "\t"`
echo -n "$total:"
mod=$(($total % 2))
if [ ! "${mod}" -eq "0" ]; then
echo "1"
else
echo "0"
fi
done
15 changes: 15 additions & 0 deletions tools/runall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

rm /tmp/runall.tmp
touch /tmp/runall.tmp

let i=1
while [ "${i}" -le "${2}" ]; do
echo Alcatel: $i
time php example_Alcatel_73xx.php ${1} 34000 30000 300000 2>&1>>/tmp/runall.tmp&
echo ZTE8426: $i
time php example_ZTE_8426.php ${1} 34000 30000 300000 2>&1>>/tmp/runall.tmp&
echo ZTE9xxx: $i
time php example_ZTE_9xxx.php ${1} 34000 30000 300000 2>&1>>/tmp/runall.tmp&
let i+=1
done

0 comments on commit 122149e

Please sign in to comment.