Gentoo Archives: gentoo-user

From: Daniel Iliev <daniel.iliev@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Fragmentation [experiment]
Date: Tue, 02 Dec 2008 10:22:03
Message-Id: ae107db90812020222j55b66477s59783f8660666752@mail.gmail.com
1 On Mon, 1 Dec 2008 22:11:58 +0200
2 "Daniel Iliev" <daniel.iliev@×××××.com> wrote:
3
4 [snip-]
5
6 > for (( i=0 ; i<=400 ; i++ ))
7 > do
8 >
9 > sync
10 > echo 3 > /proc/sys/vm/drop_caches
11 >
12 > echo -n "try_no=$i "
13 >
14 > /usr/bin/time -f "\
15 > command=%C|\
16 > real_t=%e|\
17 > kernel_t=%S|\
18 [-snip-]
19
20
21 The results are ready. I'm just sending them w/o any analysis, because
22 I've got no time right now. I just took a bare look for any obvious
23 mistakes and found that I have left "space" instead of "pipe" for
24 separator between the first two fields (see the quote above). To
25 fix this, one can issue:
26
27 IFS="|";bzcat results.txt.bz2 | \
28 sed 's/try_no=\(.*\) command/\1|command/g'
29
30 To get only specific fields (id real time and io wait for example), one
31 can issue:
32
33 IFS="|";bzcat results.txt.bz2 | \
34 sed 's/try_no=\(.*\) command/\1|command/g' | \
35 while read id comm rt kt ut maf mif csw iow fsr fsw
36 do
37 echo "$id $rt $iow"
38 done
39
40 To get only the values and specific parts of the string, one could use
41 ${var##*=} and ${var:offset:length}. Example:
42
43 IFS="|";bzcat results.txt.bz2 | \
44 sed 's/try_no=\(.*\) command/\1|command/g' | \
45 while read id comm rt kt ut maf mif csw iow fsr fsw
46 do
47 echo -e "${comm:11:5}\t${rt##*=}\t${iow##*=}"
48 done
49
50
51 Tonight I hope I'll have more time to discuss the results. I believe
52 the format is not hard to parse for input into an SQL backend in order
53 to use a statistics application for analysis and graphical
54 representation (RRDtool, perhaps?).
55
56
57
58 --
59 Best regards,
60 Daniel

Attachments

File name MIME type
results.txt.bz2 application/x-bzip2