Editing File:Kernel patches stats.png

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
[[Category: Development]]
 
 
 
== Description ==
 
== Description ==
  
Line 8: Line 6:
  
 
== Source code ==
 
== Source code ==
 +
 
=== Collect data ===
 
=== Collect data ===
Here is the script to produce the data for the graph, called <code>count</code>:
+
Here is the script to produce the data for the graph:
  
 
<small><source lang="bash">
 
<small><source lang="bash">
 
#!/bin/sh
 
#!/bin/sh
  
# Whose patches to count
+
latest=$(git tag | grep -v -- -rc | tail -n1 | sed -e 's/^.*\.\(.*\)$/\1/')
#PAT='@openvz.org|@parallels.com|@sw.ru|@swsoft.com|@sw.com.sg|kuznet@'
+
((latest++))
#PAT='@openvz.org|@parallels.com|@sw.ru|@swsoft.com|@sw.com.sg|adobriyan@|kuznet@|gorcunov@'
 
PAT='@openvz.org|@parallels.com|@sw.ru|@swsoft.com|@sw.com.sg|@virtuozzo.com|kuznet@|gorcunov@'
 
  
# Return the date of the given tag, in a format usable by gnuplot
 
 
get_tag_date() {
 
get_tag_date() {
echo $(git show $1 | egrep ^Date: | head -n1) |  
+
        echo $(git show $1 | egrep ^Date: | head -n1) |
sed 's/^Date: ... \(.*\) [-+]....$/\1/' |
+
                sed 's/^Date: ... \(.*\) [-+]....$/\1/' |
sed 's/ ..:..:..//' | sed 's/ /-/g'
+
                sed 's/ ..:..:..//' | sed 's/ /-/g'
 
}
 
}
  
# Count the number of patches whose authors match $PAT,
+
for f in $(seq 13 $latest); do
# for the period between two given git tags
+
        v1=v2.6.$((f-1))
count_patches() {
+
        d1=$(get_tag_date $v1)
git log --pretty=short --no-merges $1..$2 |
+
        if [ $f = $latest ]; then
egrep '^Author: ' | egrep $PAT | wc -l
+
                v2="HEAD  "
}
+
        else
 +
                v2=v2.6.$f
 +
        fi
 +
        d2=$(get_tag_date $v2)
 +
        echo -n $d2 $v2 " "
 +
        git log --pretty=short --no-merges $v1..$v2 | grep 'Author:' | egrep \
 +
                '@openvz.org|@parallels.com|@sw.ru|@swsoft.com|@sw.com.sg|adobriyan@|kuznet@' | wc -l
 +
done | sed 's/ /\t/g'
  
count_total_patches() {
 
git log --pretty=short --no-merges $1..$2 | grep -c '^commit '
 
}
 
 
# Latest 3.x kernel
 
#latest3=$(git tag | grep -v -- -rc | tail -n1 | sed -e 's/^.*\.\(.*\)$/\1/')
 
latest3=$(git tag | grep -v -- -rc | grep -F 'v3.' | \
 
awk -F . '{print $2}' | sort -n | tail -n1)
 
# Latest 2.6.x kernel
 
latest26=39
 
 
# Find out if number of patches for HEAD is much more
 
# than for latest -rc. If yes, use HEAD, otherwise -rc.:
 
last_rc=$(git describe --abbrev=0)
 
HEAD=$last_rc
 
if ! test -z "$last_rc"; then
 
much_more=10
 
count_head=$(count_patches v3.$latest3 HEAD)
 
count_rc=$(count_patches v3.$latest3 $last_rc)
 
if test $count_head -gt $((count_rc+much_more)); then
 
HEAD="HEAD  "
 
fi
 
fi
 
 
pv=''
 
for v in $(git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags |\
 
grep -v -E -- '-rc|-tree|v2.6.11') HEAD; do
 
if [ -z "$pv" ]; then
 
pv=$v
 
continue
 
fi
 
 
pd=$(get_tag_date $pv)
 
d=$(get_tag_date $v)
 
count_ours=$(count_patches $pv $v)
 
count_total=$(count_total_patches $pv $v)
 
if test "$count_ours" -gt 0; then
 
echo $d $v " " $count_ours $count_total
 
fi
 
pv=$v
 
done | sed 's/ /\t/g'
 
 
</source></small>
 
</source></small>
  
Line 81: Line 43:
 
<small><source lang="bash">
 
<small><source lang="bash">
 
#!/bin/sh
 
#!/bin/sh
 
REPO=~/git/linux/.git
 
COUNT=$(pwd)/count
 
OUT=$(pwd)/time.dat
 
export GDFONTPATH=/usr/share/fonts/microsoft
 
export GIT_DIR=$REPO
 
  
 
if test "$1" != "-f"; then
 
if test "$1" != "-f"; then
echo "== Previous (old) stats =="
+
git pull
tail -n 2 $OUT
+
sh count > time.dat
# Update the repo and count new stats
 
(cd $REPO && cd .. && git pull) && sh $COUNT > $OUT
 
echo "== New stats =="
 
tail -n 2 $OUT
 
 
fi
 
fi
  
DATE=$(tail -n 1 $OUT | cut -f 1 | awk -F- '{print $2,$1,$3}')
+
DATE=$(date '+%d %b %Y')
MAXY=$(awk 'BEGIN {max=0}; ($3 > max) {max=$3}; END {print max+80}' < time.dat)
+
MAXY=$(awk 'BEGIN {max=0}; ($3 > max) {max=$3}; END {print max+50}' < time.dat)
 
# GNU date is powerful!
 
# GNU date is powerful!
 
MAXX=$(date +%b-1-%Y --date='+2 months')
 
MAXX=$(date +%b-1-%Y --date='+2 months')
  
 +
export GDFONTPATH=/usr/share/fonts/msttcorefonts/
 
cat << EOF | gnuplot > plot.png
 
cat << EOF | gnuplot > plot.png
set terminal png enhanced font "verdana,13" size 1600,1200
+
set terminal png enhanced font "verdanab,20" size 1600,1200
 
 
  
 
set title "OpenVZ team kernel patches progress as of ${DATE}"
 
set title "OpenVZ team kernel patches progress as of ${DATE}"
Line 116: Line 68:
 
set xrange [ : "${MAXX}" ]
 
set xrange [ : "${MAXX}" ]
 
set yrange [ 0 : ${MAXY} ]
 
set yrange [ 0 : ${MAXY} ]
set ylabel "Number of patches from OpenVZ team,\n per kernel release, accepted into mainstream"
+
set ylabel "Number of patches, per kernel release,\naccepted into mainstream"
  
 
set border 3 # no lines at right and top
 
set border 3 # no lines at right and top
Line 122: Line 74:
 
set ytics nomirror # no tics at right
 
set ytics nomirror # no tics at right
  
plot '${OUT}' using 1:3 with linespoints pt 6 ps 1 lw 2 lt 2 notitle, \
+
plot 'time.dat' using 1:3 with linespoints pt 6 ps 1 lw 2 lt 2 notitle, \
'' using 1:3:2 with labels left offset 0,5.5 rotate notitle, \
+
'' using 1:3:2 with labels left offset 0,1 rotate notitle, \
 
'' using 1:3:3 with labels left offset 0.7,0 notitle
 
'' using 1:3:3 with labels left offset 0.7,0 notitle
  
 
EOF
 
EOF
 
</source></small>
 
</source></small>

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)