source: MondoRescue/branches/2.2.10/tools/quality @ 2321

Last change on this file since 2321 was 2321, checked in by Bruno Cornec, 11 years ago

r3332@localhost: bruno | 2009-08-07 23:59:34 +0200

  • bkpinfo->tmpchdir is now dynamically allocated
  • reorganize how tmpdir and scratchdir are initialized and the startup of the main sections
  • change of interface for maintain_collection_of_recent_archives, mondo_makefilelist, chop_filelist
  • sensibly_set_tmpdir_and_scratchdir => sensibly_set_scratchdir
  • reset_bkpinfo => init_bkpinfo
  • add function mr_free_bkpinfo
  • Fix a bug in mr_strtok
  • mondoarchive seems to globally work. Newt stuff needs more testing
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5# Mesures quality improvement of mondorescue project
6#
7
8# Adapt to your needs
9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ ${prem} == "/" ]; then
12        export TOOLHOME=$dname
13else
14        export TOOLHOME=${PWD}/$dname
15fi
16
17d=$TOOLHOME/..
18
19if [ $# -gt 0 ]; then
20    if [ -d $1 ]; then
21        d=$1
22    fi
23fi
24
25echo "Working on $d"
26echo " "
27cd $d
28
29# How many sprintf/strcat/strcpy vs asprintf are they
30for s in asprintf mr_asprintf sprintf snprintf strcat strcpy strncpy fgets malloc mr_malloc malloc_string getline mr_getline MAX_STR_LEN getcwd goto free mr_free paranoid_free paranoid_system mr_system assert; do
31    echo "mondorescue $s usage : "
32    tot=0
33    for i in `find . -name '*.c' -o -name '*.h' |  egrep -v '\.svn|/\*|monitas|mindi-busybox' | xargs grep -r -c -w $s | egrep -v ":0$"`; do
34            echo " === $i"
35            ((tot=$tot+`echo $i | cut -d: -f2`))
36    done
37    echo "total $s usage : $tot"
38done
39
40echo " "
41echo "Qualimetry: "
42pbg -w asprintf | grep -vE 'monitas|mindi-busybox|quality|/\*|asprintf\(&' > /tmp/mondo.quality
43cat /tmp/mondo.quality
44echo "mondorescue uses : `cat /tmp/mondo.quality | wc -l` asprintf without &"
45pbg -w getline | grep -vE 'monitas|mindi-busybox|quality|/\*|getline\(&' > /tmp/mondo.quality
46cat /tmp/mondo.quality
47echo "mondorescue uses : `cat /tmp/mondo.quality | wc -l` getline without &"
48pbg mr_asprintf | grep -vE '"|FNAME|ISOFS|syscall_sprintf|mr_mem|quality' > /tmp/mondo.quality
49cat /tmp/mondo.quality
50echo "mondorescue uses : `cat /tmp/mondo.quality | wc -l` mr_asprintf without \""
51find . -name '*.c' -o -name '*.h' |  egrep -v '\.svn|/\*|monitas|/\*|mindi-busybox' | xargs grep -rw mr_getline | egrep -v '/\*' | egrep -v 'mr_getline\(&' > /tmp/mondo.quality
52cat /tmp/mondo.quality
53echo "monodrescue uses : `cat /tmp/mondo.quality | wc -l` mr_getline without &"
54
55echo " "
56echo "Splint: "
57find . -name '*.c' -o -name '*.h' | xargs splint +posixlib -Dlinux
58
59rm -f /tmp/mondo.quality
Note: See TracBrowser for help on using the repository browser.