Lee Revell | 1 Aug 2004 11:08

Re: [PATCH] Display latency histogram on exit, add -n/--num-cycles argument

On Sun, 2004-08-01 at 02:06, Lee Revell wrote:
> This patch displays a histogram of latency measurements from each
> cycle.  The histogram is updated in jack_cpu_load, which runs every
> JACK_ENGINE_ROLLING_COUNT frames.  The overhead is essentially zero, as
> existing infrastructure is reused.
> 
> The patch also adds an -n/--num-cycles argument, which causes jack to
> run that many cycles and then exit.  I find 500000 cycles useful, at 32
> frames (with no clients) this is about 5 minutes.
> 
> It was pointed out to me that these numbers only represent the
> scheduling delay when there are no clients running; otherwise you are
> measuring the time the slowest client takes.  So this is only useful for
> benchmarking scheduler latency with no clients.
> 
> Also the patch replaces a few occurrences of if/else where a variable
> always gets a value with the ternary operator.  I am not even sure this
> is faster with a modern compiler.  Feel free to omit these lines. 
> 

The patch has an off-by-992 error.  This fixes it:

-#define JACK_ENGINE_ROLLING_COUNT 32
+#define JACK_ENGINE_ROLLING_COUNT 1024

Here are some results.  At least three distinct peaks are visible which
repeat in both trials of N=500000.  These are clearer with N=1000000.

Trial 1, N=500000

Delay   Count
-----   -----
6       15217
7       252848
8       4669
9       6296
10      4093
11      3816
12      4147
13      4142
14      3922
15      4615
16      4155
17      4112
18      3763
19      3594
20      4614
21      3239
22      1981
23      1374
24      889
25      378
26      93
27      42
28      44
29      26
30      34
31      34
32      35
33      37
34      39
35      52
36      38
37      50
38      45
39      49
40      43
41      54
42      46
43      34
44      32
45      12
46      9
47      11
48      6
49      8
50      6
51      1
52      2
53      2
54      1
55      2
57      1
58      1
63      1
64      5
72      2
73      3
74      2
75      1
76      6
77      1
79      2
80      1
81      1
82      1
83      1
84      1
85      2
91      1
92      1
93      1
94      1
97      2
99      1
101     6
102     1
104     1
105     2

Trial 2, N=500000

Delay   Count
-----   -----
6       58599
7       196716
8       9648
9       19370
10      5284
11      3936
12      3398
13      3316
14      3029
15      3414
16      3570
17      3544
18      3396
19      2999
20      3973
21      2833
22      2431
23      1456
24      668
25      259
26      64
27      22
28      31
29      25
30      42
31      36
32      41
33      49
34      44
35      42
36      49
37      47
38      42
39      53
40      63
41      62
42      46
43      19
44      24
45      18
46      19
47      7
48      7
49      6
50      7
51      7
52      3
55      1
56      1
57      3
58      1
59      2
60      1
61      4
62      1
63      1
64      1
65      4
68      1
69      2
70      3
71      1
72      3
73      6
74      4
75      9
76      5
77      6
78      2
86      4
88      4
89      1
90      1
91      2
92      1
93      1
94      1
97      1
98      1
101     1
102     1
103     2
106     1
121     1
127     1

Lee

-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com

Gmane