Skip to content

Commit

Permalink
tutorial: add info about bref event
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Juri Lelli committed Jul 20, 2017
1 parent 2c6f1a2 commit 9978cc8
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 9 deletions.
59 changes: 59 additions & 0 deletions doc/examples/tutorial/example9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
/*
* Latency associated with a pipeline of tasks.
* Task tick start the pipeline every 24ms.
* Task task1 gets a time reference (bref) and wakes task2 up (after
* executing for a while). task2 wakes task3 up.
* Eitherr task1 or task3 (extremes of the pipeline), depending on
* who arrives last, will use bref to compute end-to-end latency
* (pipe_latency) in the log.
*/
"tasks" : {
"tick" : {
"loop" : -1,
"cpus" : [0],
"phases" : {
"p1" : {
"loop" : 1,
"resume" : "task1",
"timer" : { "ref" : "tick", "period": 6000 }
},
"p2" : {
"loop" : 3,
"timer" : { "ref" : "tick", "period": 6000 }
}
}
},
"task1" : {
"loop" : -1,
"bref" : "pipeline",
"run1" : 300,
"resume" : "task2",
"run2" : 4000,
"barrier" : "pipeline",
"suspend" : "task1"
},
"task2" : {
"loop" : -1,
"suspend" : "task2",
"run" : 1000,
"resume" : "task3"
},
"task3" : {
"loop" : -1,
"suspend" : "task3",
"run" : 1000,
"barrier" : "pipeline"
}
},
"global" : {
"default_policy" : "SCHED_OTHER",
"duration" : 6,
"ftrace" : true,
"gnuplot" : false,
"lock_pages" : false,
"logdir" : "./",
"log_basename" : "example9",
"calibration" : "CPU0"
}
}
25 changes: 16 additions & 9 deletions doc/tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ generates the following sequence:
"unlock" : "SyncPointA" (internal mutex)
}

* bref : String. Time reference for a pipeline of tasks. It has to match a
barrier (see above). The task at the beginning of the pipeline calls this
event to get such a reference; the last task at the other end of the pipeline
(the one that broadcasts and wakes everybody else up) will compute the delta.
See doc/examples/tutorial/example9.json for more information.

* suspend : String. Block the calling thread until another thread wakes it up
with resume. The String can be let empty as it will be filled by workgen with
the right thread's name before starting the use case.
Expand Down Expand Up @@ -626,19 +632,20 @@ metrics are:
- c_duration: sum of the configured duration of run/runtime events
- c_period: sum of the timer(s) period(s)
- wu_lat: sum of wakeup latencies after timer events
- pipe_lat: end-to-end latency of a pipeline of tasks (0 if no pipeline exists)

Below is an extract of a log:

# Policy : SCHED_OTHER priority : 0
#idx perf run period start end rel_st slack c_duration c_period wu_lat
0 92164 19935 98965 504549567051 504549666016 2443 78701 20000 100000 266
0 92164 19408 99952 504549666063 504549766015 101455 80217 20000 100000 265
0 92164 19428 99952 504549766062 504549866014 201454 80199 20000 100000 264
0 92164 19438 99955 504549866060 504549966015 301452 80190 20000 100000 265
0 92164 19446 99952 504549966061 504550066013 401453 80093 20000 100000 264
0 92164 19415 99953 504550066060 504550166013 501452 80215 20000 100000 263
0 92164 19388 99954 504550166059 504550266013 601451 80242 20000 100000 264
0 92164 19444 99956 504550266060 504550366015 701452 80185 20000 100000 265
#idx perf run period start end rel_st slack c_duration c_period wu_lat pipe_lat
0 92164 19935 98965 504549567051 504549666016 2443 78701 20000 100000 266 0
0 92164 19408 99952 504549666063 504549766015 101455 80217 20000 100000 265 0
0 92164 19428 99952 504549766062 504549866014 201454 80199 20000 100000 264 0
0 92164 19438 99955 504549866060 504549966015 301452 80190 20000 100000 265 0
0 92164 19446 99952 504549966061 504550066013 401453 80093 20000 100000 264 0
0 92164 19415 99953 504550066060 504550166013 501452 80215 20000 100000 263 0
0 92164 19388 99954 504550166059 504550266013 601451 80242 20000 100000 264 0
0 92164 19444 99956 504550266060 504550366015 701452 80185 20000 100000 265 0

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

0 comments on commit 9978cc8

Please sign in to comment.