File: bitesize_example.txt

package info (click to toggle)
perf-tools-unstable 1.0%2Bgit7ffb3fd-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 932 kB
  • ctags: 95
  • sloc: sh: 2,519; perl: 278; makefile: 20
file content (63 lines) | stat: -rw-r--r-- 2,495 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Demonstrations of bitesize, the Linux perf_events version.


bitesize traces block I/O issued, and reports a histogram of I/O size. By
default five buckets are used to gather statistics on common I/O sizes:

# ./bitesize 
Tracing block I/O size (bytes), until Ctrl-C...
^C
            Kbytes         : I/O      Distribution
              -> 0.9       : 0        |                                      |
          1.0 -> 7.9       : 38       |#                                     |
          8.0 -> 63.9      : 10108    |######################################|
         64.0 -> 127.9     : 13       |#                                     |
        128.0 ->           : 1        |#                                     |

In this case, most of the I/O was between 8 and 63.9 Kbytes. The "63.9"
really means "less than 64".


Specifying custom buckets to examine the I/O size in more detail:

# ./bitesize -b "8 16 24 32"
Tracing block I/O size (bytes), until Ctrl-C...
^C
            Kbytes         : I/O      Distribution
              -> 7.9       : 89       |#                                     |
          8.0 -> 15.9      : 14665    |######################################|
         16.0 -> 23.9      : 657      |##                                    |
         24.0 -> 31.9      : 661      |##                                    |
         32.0 ->           : 376      |#                                     |

The I/O is mostly between 8 and 15.9 Kbytes

It's probably 8 Kbytes. Checking:

# ./bitesize -b "8 9"
Tracing block I/O size (bytes), until Ctrl-C...
^C
            Kbytes         : I/O      Distribution
              -> 7.9       : 62       |#                                     |
          8.0 -> 8.9       : 11719    |######################################|
          9.0 ->           : 1358     |#####                                 |

It is.

The overhead of this tool is relative to the number of buckets used, hence only
using what is necessary.

To study this I/O in more detail, I can use iosnoop(8) and capture it to a file
for post-processing.


Use -h to print the USAGE message:

# ./bitesize -h
USAGE: bitesize [-h] [-b buckets] [seconds]
                 -b buckets      # specify histogram buckets (Kbytes)
                 -h              # this usage message
   eg,
       bitesize                  # trace I/O size until Ctrl-C
       bitesize 10               # trace I/O size for 10 seconds
       bitesize -b "8 16 32"     # specify custom bucket points