Editing File:Kernel patches stats.png
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 8: | Line 8: | ||
== 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, called <code>count</code>: | ||
Line 13: | Line 14: | ||
<small><source lang="bash"> | <small><source lang="bash"> | ||
#!/bin/sh | #!/bin/sh | ||
− | + | ||
# Whose patches to count | # Whose patches to count | ||
− | + | PAT='@openvz.org|@parallels.com|@sw.ru|@swsoft.com|@sw.com.sg|adobriyan@|kuznet@' | |
− | + | ||
− | |||
− | |||
# Return the date of the given tag, in a format usable by gnuplot | # Return the date of the given tag, in a format usable by gnuplot | ||
get_tag_date() { | get_tag_date() { | ||
Line 25: | Line 24: | ||
sed 's/ ..:..:..//' | sed 's/ /-/g' | sed 's/ ..:..:..//' | sed 's/ /-/g' | ||
} | } | ||
− | + | ||
# Count the number of patches whose authors match $PAT, | # Count the number of patches whose authors match $PAT, | ||
# for the period between two given git tags | # for the period between two given git tags | ||
Line 32: | Line 31: | ||
egrep '^Author: ' | egrep $PAT | wc -l | egrep '^Author: ' | egrep $PAT | wc -l | ||
} | } | ||
+ | |||
+ | # Old 2.6 kernel branch | ||
+ | # We start from 2.6.12 -- the first kernel available in git | ||
+ | # and end on 2.6.39 -- the last kernel on 2.6 branch | ||
+ | for f in $(seq 13 40); do | ||
+ | v1=v2.6.$((f-1)) | ||
+ | d1=$(get_tag_date $v1) | ||
+ | if [ $f -gt 39 ]; then | ||
+ | v2=$HEAD | ||
+ | else | ||
+ | v2=v2.6.$f | ||
+ | fi | ||
+ | d2=$(get_tag_date $v2) | ||
+ | count=$(count_patches $v1 $v2) | ||
+ | if test "$count" -gt 0; then | ||
+ | echo $d2 $v2 " " $count | ||
+ | fi | ||
+ | |||
+ | done | sed 's/ /\t/g' | ||
− | + | # New 3.x kernel branch | |
− | + | # Transition: patches from 2.6.39 to 3.0 | |
− | + | d2=$(get_tag_date v3.0) | |
− | + | count=$(count_patches v2.6.39 v3.0) | |
− | # | + | echo $d2 v3.0 " " $count |
− | # | ||
− | |||
− | |||
− | |||
− | |||
+ | # What is the latest kernel patch number (i.e. x in 3.x) | ||
+ | latest=$(git tag | grep -v -- -rc | tail -n1 | sed -e 's/^.*\.\(.*\)$/\1/') | ||
+ | |||
# Find out if number of patches for HEAD is much more | # Find out if number of patches for HEAD is much more | ||
− | # than for latest -rc. If yes, use HEAD, otherwise -rc. | + | # than for latest -rc. If yes, use HEAD, otherwise -rc. |
− | last_rc=$(git | + | last_rc=$(git tag | tail -n 1 | grep -- -rc) |
HEAD=$last_rc | HEAD=$last_rc | ||
if ! test -z "$last_rc"; then | if ! test -z "$last_rc"; then | ||
− | much_more= | + | much_more=15 |
− | count_head=$(count_patches v3.$ | + | count_head=$(count_patches v3.$latest HEAD) |
− | count_rc=$(count_patches v3.$ | + | count_rc=$(count_patches v3.$latest $last_rc) |
if test $count_head -gt $((count_rc+much_more)); then | if test $count_head -gt $((count_rc+much_more)); then | ||
HEAD="HEAD " | HEAD="HEAD " | ||
Line 57: | Line 73: | ||
fi | fi | ||
− | + | # We start from 3.0 | |
− | for | + | for f in $(seq 1 $((latest+1))); do |
− | + | v1=v3.$((f-1)) | |
− | if [ - | + | d1=$(get_tag_date $v1) |
− | + | if [ $f -gt $latest ]; then | |
− | + | v2=$HEAD | |
+ | else | ||
+ | v2=v3.$f | ||
fi | fi | ||
− | + | d2=$(get_tag_date $v2) | |
− | + | count=$(count_patches $v1 $v2) | |
− | + | if test "$count" -gt 0; then | |
− | + | echo $d2 $v2 " " $count | |
− | |||
− | if test "$ | ||
− | echo $ | ||
fi | fi | ||
− | + | ||
done | sed 's/ /\t/g' | done | sed 's/ /\t/g' | ||
</source></small> | </source></small> | ||
Line 81: | Line 96: | ||
<small><source lang="bash"> | <small><source lang="bash"> | ||
#!/bin/sh | #!/bin/sh | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
if test "$1" != "-f"; then | if test "$1" != "-f"; then | ||
− | + | git checkout master | |
− | + | git pull | |
− | + | sh count > time.dat | |
− | |||
− | |||
− | |||
fi | fi | ||
− | DATE=$(tail -n 1 | + | DATE=$(tail -n 1 time.dat | cut -f 1 | awk -F- '{print $2,$1,$3}') |
− | MAXY=$(awk 'BEGIN {max=0}; ($3 > max) {max=$3}; END {print max+ | + | 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 " | + | set terminal png enhanced font "verdanab,20" size 1600,1200 |
− | + | #set terminal png enhanced transparent font "verdanab,14" size 1200,600 | |
+ | #set terminal svg enhanced font "verdanab,8" size 800,600 | ||
set title "OpenVZ team kernel patches progress as of ${DATE}" | set title "OpenVZ team kernel patches progress as of ${DATE}" | ||
Line 122: | Line 130: | ||
set ytics nomirror # no tics at right | set ytics nomirror # no tics at right | ||
− | plot ' | + | 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, | + | '' 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> |