Skip to content

Commit ebbf559

Browse files
Juri Lellijlelli
Juri Lelli
authored andcommitted
tutorial: add info about bref event
Add information in the tutorial and an example about how bref event can be used to measure end-to-end latency of pipelines of tasks. Signed-off-by: Juri Lelli <[email protected]>
1 parent b01ad77 commit ebbf559

File tree

2 files changed

+75
-9
lines changed

2 files changed

+75
-9
lines changed

doc/examples/tutorial/example9.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
/*
3+
* Latency associated with a pipeline of tasks.
4+
* Task tick start the pipeline every 24ms.
5+
* Task task1 gets a time reference (bref) and wakes task2 up (after
6+
* executing for a while). task2 wakes task3 up.
7+
* Eitherr task1 or task3 (extremes of the pipeline), depending on
8+
* who arrives last, will use bref to compute end-to-end latency
9+
* (pipe_latency) in the log.
10+
*/
11+
"tasks" : {
12+
"tick" : {
13+
"loop" : -1,
14+
"cpus" : [0],
15+
"phases" : {
16+
"p1" : {
17+
"loop" : 1,
18+
"resume" : "task1",
19+
"timer" : { "ref" : "tick", "period": 6000 }
20+
},
21+
"p2" : {
22+
"loop" : 3,
23+
"timer" : { "ref" : "tick", "period": 6000 }
24+
}
25+
}
26+
},
27+
"task1" : {
28+
"loop" : -1,
29+
"bref" : "pipeline",
30+
"run1" : 300,
31+
"resume" : "task2",
32+
"run2" : 4000,
33+
"barrier" : "pipeline",
34+
"suspend" : "task1"
35+
},
36+
"task2" : {
37+
"loop" : -1,
38+
"suspend" : "task2",
39+
"run" : 1000,
40+
"resume" : "task3"
41+
},
42+
"task3" : {
43+
"loop" : -1,
44+
"suspend" : "task3",
45+
"run" : 1000,
46+
"barrier" : "pipeline"
47+
}
48+
},
49+
"global" : {
50+
"default_policy" : "SCHED_OTHER",
51+
"duration" : 6,
52+
"ftrace" : true,
53+
"gnuplot" : false,
54+
"lock_pages" : false,
55+
"logdir" : "./",
56+
"log_basename" : "example9",
57+
"calibration" : "CPU0"
58+
}
59+
}

doc/tutorial.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,12 @@ generates the following sequence:
521521
"unlock" : "SyncPointA" (internal mutex)
522522
}
523523

524+
* bref : String. Time reference for a pipeline of tasks. It has to match a
525+
barrier (see above). The task at the beginning of the pipeline calls this
526+
event to get such a reference; the last task at the other end of the pipeline
527+
(the one that broadcasts and wakes everybody else up) will compute the delta.
528+
See doc/examples/tutorial/example9.json for more information.
529+
524530
* suspend : String. Block the calling thread until another thread wakes it up
525531
with resume. The String can be let empty as it will be filled by workgen with
526532
the right thread's name before starting the use case.
@@ -626,19 +632,20 @@ metrics are:
626632
- c_duration: sum of the configured duration of run/runtime events
627633
- c_period: sum of the timer(s) period(s)
628634
- wu_lat: sum of wakeup latencies after timer events
635+
- pipe_lat: end-to-end latency of a pipeline of tasks (0 if no pipeline exists)
629636

630637
Below is an extract of a log:
631638

632639
# Policy : SCHED_OTHER priority : 0
633-
#idx perf run period start end rel_st slack c_duration c_period wu_lat
634-
0 92164 19935 98965 504549567051 504549666016 2443 78701 20000 100000 266
635-
0 92164 19408 99952 504549666063 504549766015 101455 80217 20000 100000 265
636-
0 92164 19428 99952 504549766062 504549866014 201454 80199 20000 100000 264
637-
0 92164 19438 99955 504549866060 504549966015 301452 80190 20000 100000 265
638-
0 92164 19446 99952 504549966061 504550066013 401453 80093 20000 100000 264
639-
0 92164 19415 99953 504550066060 504550166013 501452 80215 20000 100000 263
640-
0 92164 19388 99954 504550166059 504550266013 601451 80242 20000 100000 264
641-
0 92164 19444 99956 504550266060 504550366015 701452 80185 20000 100000 265
640+
#idx perf run period start end rel_st slack c_duration c_period wu_lat pipe_lat
641+
0 92164 19935 98965 504549567051 504549666016 2443 78701 20000 100000 266 0
642+
0 92164 19408 99952 504549666063 504549766015 101455 80217 20000 100000 265 0
643+
0 92164 19428 99952 504549766062 504549866014 201454 80199 20000 100000 264 0
644+
0 92164 19438 99955 504549866060 504549966015 301452 80190 20000 100000 265 0
645+
0 92164 19446 99952 504549966061 504550066013 401453 80093 20000 100000 264 0
646+
0 92164 19415 99953 504550066060 504550166013 501452 80215 20000 100000 263 0
647+
0 92164 19388 99954 504550166059 504550266013 601451 80242 20000 100000 264 0
648+
0 92164 19444 99956 504550266060 504550366015 701452 80185 20000 100000 265 0
642649

643650
Some gnuplot files are also created to generate charts based on the log files
644651
for each thread and for each kind of metrics. The format of the chart that

0 commit comments

Comments
 (0)