diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2014-09-24 11:15:43 +0200 |
---|---|---|
committer | Vincent Guittot <vincent.guittot@linaro.org> | 2014-09-24 12:44:48 +0200 |
commit | a53a86aeb060afd569b53dfde6f7f406e6308f21 (patch) | |
tree | a256dccdc7263bb15411231d6e5ddfacc4a4efb7 /doc | |
parent | f281736bb1e6d0fecea8d5765f3f57efe82361e9 (diff) |
update example file
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/browser.json | 208 | ||||
-rw-r--r-- | doc/examples/example1.json | 23 | ||||
-rw-r--r-- | doc/examples/example2.json | 33 | ||||
-rw-r--r-- | doc/examples/example3.json | 23 | ||||
-rw-r--r-- | doc/examples/example4.json | 20 | ||||
-rw-r--r-- | doc/examples/mp3.json | 90 |
6 files changed, 142 insertions, 255 deletions
diff --git a/doc/examples/browser.json b/doc/examples/browser.json index f9cb034..a5b4dee 100644 --- a/doc/examples/browser.json +++ b/doc/examples/browser.json @@ -5,201 +5,119 @@ "phases" : { "start" : { "loop" : 1, - "sleep0" : 400000, - "run0" : 15000, - "lock0" : "trig0_mutex", - "signal0" : "trig0", - "unlock0" : "trig0_mutex", - "run1" : 7000, - "sleep1" : 8000, + "sleep" : 400000, + "run" : 15000, + "resume" : "Browser", + "run" : 7000, + "sleep" : 8000, }, "render1" : { "loop" : 50, - "lock0" : "trig00_mutex", - "signal0" : "trig00", - "unlock0" : "trig00_mutex", - "run0" : 3000, + "resume" : "BrowserSub", + "run" : 3000, }, "render2" : { "loop" : 1, - "lock0" : "trig0_mutex", - "wait0" : { "ref" : "wait0", "mutex": "trig0_mutex" }, - "unlock0" : "trig0_mutex", - "run0" : 10000, - "lock1" : "trig0_mutex", - "signal1" : "trig0", - "unlock1" : "trig0_mutex", - "run1" : 5000, + "suspend" : "Browser", + "run" : 10000, + "resume" : "Browser", + "run" : 5000, }, "render3" : { "loop" : 20, - "lock0" : "trig00_mutex", - "signal0" : "trig00", - "unlock0" : "trig00_mutex", - "run0" : 3000, + "resume" : "BrowserSub", + "run" : 3000, }, "stop" : { "loop" : 1, - "run0" : 2000, - "sleep0" : 200000, - "lock0" : "trig0_mutex", - "wait0" : { "ref" : "wait0", "mutex": "trig0_mutex" }, - "unlock0" : "trig0_mutex", - "sleep1" : 600000, + "run" : 2000, + "sleep" : 200000, + "suspend" : "Browser", + "sleep" : 600000, }, "scroll" : { "loop" : 4, - "lock0" : "trig0_mutex", - "signal0" : "trig0", - "unlock0" : "trig0_mutex", - "lock1" : "trig000_mutex", - "signal1" : "trig000", - "unlock1" : "trig000_mutex", + "resume" : "Browser", + "suspend" : "BrowserNext", "run" : 1000, }, "stop2" : { "loop" : 1, - "lock0" : "trig0_mutex", - "wait0" : { "ref" : "wait0", "mutex": "trig0_mutex" }, - "unlock0" : "trig0_mutex", - "run0" : 200, - "sleep0" : 800000, + "suspend" : "Browser", + "run" : 200, + "sleep" : 800000, }, } }, "BrowserSub1" : { "priority" : -6, "loop" : -1, - "lock0" : "trig00_mutex", - "wait0" : { "ref" : "wait00", "mutex": "trig00_mutex" }, - "unlock0" : "trig00_mutex", - "run0" : 100, + "suspend" : "BrowserSub", + "run" : 100, }, - "BrowserSub2" : { + "BrowserSub2" : { "priority" : -6, "loop" : -1, - "lock0" : "trig00_mutex", - "wait0" : { "ref" : "wait00", "mutex": "trig00_mutex" }, - "unlock0" : "trig00_mutex", - "run0" : 100, + "suspend" : "BrowserSub", + "run" : 100, }, - "BrowserDisplay" : { + "BrowserDisplay" : { "priority" : -6, "loop" : -1, - "lock0" : "trig0_mutex", - "wait0" : { "ref" : "wait0", "mutex": "trig0_mutex" }, - "unlock0" : "trig0_mutex", - "run0" : 300, - "lock1" : "trig000_mutex", - "signal1" : "trig000", - "unlock1" : "trig000_mutex", - "run1" : 12000, - "lock2" : "trig11_mutex", - "sync2" : { "ref" : "sync11", "mutex": "trig11_mutex" }, - "unlock2" : "trig11_mutex", - "run2" : 300, - "lock3" : "trig1_mutex", - "signal3" : "trig1", - "unlock3" : "trig1_mutex", - "run3" : 400, + "suspend" : "Browser", + "run" : 300, + "resume" : "BrowserNext", + "run" : 12000, + "lock" : "mutex11", + "sync" : { "ref" : "queue11", "mutex": "mutex11" }, + "unlock" : "mutex11", + "run" : 300, + "resume" : "Binder-display", + "run" : 400, }, "Binder-dummy" : { "priority" : -6, "loop" : -1, - "lock0" : "trig11_mutex", - "wait0" : { "ref" : "wait11", "mutex": "trig11_mutex" }, - "unlock0" : "trig11_mutex", - "run0" : 200, - "lock1" : "trig11_mutex", - "signal1" : "trig11", - "unlock1" : "trig11_mutex", - "run1" : 100, + "lock" : "mutex11", + "wait" : { "ref" : "queue11", "mutex": "mutex11" }, + "unlock" : "mutex11", + "run" : 200, + "lock" : "mutex11", + "signal" : "queue11", + "unlock" : "mutex11", + "run" : 100, }, - "Binder-display" : { + "Binder-display" : { "priority" : -6, "loop" : -1, - "lock0" : "trig1_mutex", - "wait0" : { "ref" : "wait1", "mutex": "trig1_mutex" }, - "unlock0" : "trig1_mutex", - "run0" : 300, - "lock1" : "trig2_mutex", - "signal1" : "trig2", - "unlock1" : "trig2_mutex", - "lock2" : "trig22_mutex", - "signal2" : "trig22", - "unlock2" : "trig22_mutex", + "suspend", + "run" : 300, + "resume" : "Event-Browser", + "resume" : "Event-Display", }, "Event-Browser" : { "priority" : -9, "loop" : -1, - "lock0" : "trig2_mutex", - "wait0" : { "ref" : "wait2", "mutex": "trig2_mutex" }, - "unlock0" : "trig2_mutex", - "run0" : 50, - "sleep0" : 16000, - "run1" : 50, - "lock1" : "trig0_mutex", - "signal1" : "trig0", - "unlock1" : "trig0_mutex", + "suspend", + "run" : 50, + "sleep" : 16000, + "run" : 50, + "resume" : "Browser", }, "Event-Display" : { "priority" : -9, "loop" : -1, - "lock0" : "trig22_mutex", - "wait0" : { "ref" : "wait22", "mutex": "trig22_mutex" }, - "unlock0" : "trig22_mutex", - "run0" : 50, - "sleep0" : 16000, - "run1" : 50, - "lock1" : "trig3_mutex", - "signal1" : "trig3", - "unlock1" : "trig3_mutex", + "suspend", + "run" : 50, + "sleep" : 16000, + "run" : 50, + "resume" : "Display", }, "Display" : { "priority" : -8, "loop" : -1, - "lock0" : "trig3_mutex", - "wait0" : { "ref" : "wait3", "mutex": "trig3_mutex" }, - "unlock0" : "trig3_mutex", - "run0" : 16000, + "suspend", + "run" : 16000, }, }, - "resources" : { - "trig0_mutex" : { "type" : "mutex" }, - "wait0" : { "type" : "wait" }, - "trig0" : { "type" : "signal", "target" : "wait0" }, - "trig00_mutex" : { "type" : "mutex" }, - "wait00" : { "type" : "wait" }, - "trig00" : { "type" : "signal", "target" : "wait00" }, - "trig000_mutex" : { "type" : "mutex" }, - "wait000" : { "type" : "wait" }, - "trig000" : { "type" : "signal", "target" : "wait000" }, - "trig1_mutex" : { "type" : "mutex" }, - "wait1" : { "type" : "wait" }, - "trig1" : { "type" : "signal", "target" : "wait1" }, - "trig11_mutex" : { "type" : "mutex" }, - "wait11" : { "type" : "wait" }, - "trig11" : { "type" : "signal", "target" : "wait11" }, - "sync11" : { "type" : "sync", "target" : "wait11" }, - "trig2_mutex" : { "type" : "mutex" }, - "wait2" : { "type" : "wait" }, - "trig2" : { "type" : "signal", "target" : "wait2" }, - "trig22_mutex" : { "type" : "mutex" }, - "wait22" : { "type" : "wait" }, - "trig22" : { "type" : "signal", "target" : "wait22" }, - "trig3_mutex" : { "type" : "mutex" }, - "wait3" : { "type" : "wait" }, - "trig3" : { "type" : "signal", "target" : "wait3" }, - }, - "global" : { - "default_policy" : "SCHED_OTHER", - "duration" : 10, - "ftrace" : false, - "gnuplot" : false, - "logdir" : "./", - "log_basename" : "web", - "lock_pages" : false, - "frag" : 1, - "calibration" : "CPU0", - } } diff --git a/doc/examples/example1.json b/doc/examples/example1.json index e62a6bf..bf3fe1e 100644 --- a/doc/examples/example1.json +++ b/doc/examples/example1.json @@ -1,24 +1,13 @@ { + /* + * Simple use case which creates a thread that run 1ms then sleep 9ms + * until the use case is stopped with Ctrl+C + */ "tasks" : { "thread0" : { - "run" : 300, - "sleep" : 8000, - }, - "thread1" : { "loop" : -1, - "run" : 5000, - "sleep" : 33000, + "run" : 1000, + "sleep" : 9000, }, }, - "global" : { - "default_policy" : "SCHED_OTHER", - "duration" : 10, - "ftrace" : false, - "gnuplot" : false, - "logdir" : "./", - "log_basename" : "rt-app", - "lock_pages" : false, - "frag" : 0, - "calibration" : "CPU1", - } } diff --git a/doc/examples/example2.json b/doc/examples/example2.json index 9dfad5c..c5116f6 100644 --- a/doc/examples/example2.json +++ b/doc/examples/example2.json @@ -1,34 +1,13 @@ { - "resources" : { - "mutex1" : { "type" : "mutex" }, - }, + /* + * Simple use case which creates 10% load + * until the use case is stopped with Ctrl+C + */ "tasks" : { "thread0" : { "loop" : -1, - "lock" : "mutex1", - "run" : 275, - "unlock" : "mutex1", - "run_end" : 25, - "sleep" : 7700, - }, - "thread1" : { - "loop" : 100, - "lock" : "mutex1", - "run" : 4000, - "unlock" : "mutex1", - "runend" : 1000, - "sleep" : 28000, + "run" : 1000, + "timer" : { "ref" : "tick", "period" : 10000 }, }, }, - "global" : { - "default_policy" : "SCHED_OTHER", - "duration" : 10, - "ftrace" : false, - "gnuplot" : false, - "logdir" : "./", - "log_basename" : "rt-app", - "lock_pages" : false, - "frag" : 0, - "calibration" : "CPU1", - } } diff --git a/doc/examples/example3.json b/doc/examples/example3.json new file mode 100644 index 0000000..56039c3 --- /dev/null +++ b/doc/examples/example3.json @@ -0,0 +1,23 @@ +{ + /* + * Simple use case which starts with a 10% load during 1sec (100 loops) + * and then increase to 90% for the next sec (100 loops) + */ + "tasks" : { + "thread0" : { + "loop" : 1, + "phases" : { + "light" : { + "loop" : 100, + "run" : 1000, + "timer" : { "ref" : "tick", "period" : 10000 }, + }, + "heavy" : { + "loop" : 100, + "run" : 9000, + "timer" : { "ref" : "tick", "period" : 10000 }, + } + } + }, + }, +} diff --git a/doc/examples/example4.json b/doc/examples/example4.json new file mode 100644 index 0000000..2865075 --- /dev/null +++ b/doc/examples/example4.json @@ -0,0 +1,20 @@ +{ + /* + * Simple use case with 2 threads that runs for 10 ms and wake up each + * other until the use case is stopped with Ctrl+C + */ + "tasks" : { + "thread0" : { + "loop" : -1, + "run" : 10000, + "resume" : "thread1", + "suspend", + }, + "thread1" : { + "loop" : -1, + "run" : 10000, + "resume" : "thread0", + "suspend", + }, + }, +} diff --git a/doc/examples/mp3.json b/doc/examples/mp3.json index 231358e..c1b40f0 100644 --- a/doc/examples/mp3.json +++ b/doc/examples/mp3.json @@ -6,95 +6,53 @@ "phases" : { "p1" : { "loop" : 1, - "lock1" : "trig0_mutex", - "signal2" : "trig0", - "unlock3" : "trig0_mutex", - "timer4" : { "ref" : "tick", "period": 6000 }, + "resume" : "AudioOut", + "timer" : { "ref" : "tick", "period": 6000 }, }, "p2" : { "loop" : 4, - "timer0" : { "ref" : "tick", "period": 6000 }, + "timer" : { "ref" : "tick", "period": 6000 }, } } }, "AudioOut" : { "priority" : -19, "loop" : -1, - "phases" : { - "p1" : { - "loop" : 1, - "run3" : 275, - "lock4" : "trig1_mutex", - "signal5" : "trig1", - "unlock6" : "trig1_mutex", - "run7" : 4725, - "lock0" : "trig0_mutex", - "wait1" : { "ref" : "wait0", "mutex": "trig0_mutex" }, - "unlock2" : "trig0_mutex", - }, - } + "run" : 275, + "resume" : "AudioTrack", + "run" : 4725, + "suspend", }, "AudioTrack" : { "priority" : -16, "loop" : -1, - "lock0" : "trig1_mutex", - "wait1" : { "ref" : "wait1", "mutex": "trig1_mutex" }, - "unlock2" : "trig1_mutex", - "run3" : 300, - "signal4" : "trig2", + "suspend", + "run" : 300, + "resume" : "mp3.decoder", }, "mp3.decoder" : { "priority" : -2, "loop" : -1, - "lock0" : "trig2_mutex", - "wait1" : { "ref" : "wait2", "mutex": "trig2_mutex" }, - "unlock2" : "trig2_mutex", - "run3" : 1000, - "lock4" : "trig3_mutex", - "signal5" : "trig3", - "wait6" : { "ref" : "wait3", "mutex": "trig3_mutex" }, - "unlock7" : "trig3_mutex", - "run8" : 150, + "suspend", + "run" : 1000, + "lock" : "mutex", + "signal" : "queue", + "wait" : { "ref" : "queue", "mutex": "mutex" }, + "unlock" : "mutex", + "run" : 150, }, "OMXCall" : { "priority" : -2, "loop" : -1, - "phases" : { - "p1" : { - "lock0" : "trig3_mutex", - "wait1" : { "ref" : "wait3", "mutex": "trig3_mutex" }, - "unlock2" : "trig3_mutex", - "run3" : 300, - "lock4" : "trig3_mutex", - "signal5" : "trig3", - "unlock6" : "trig3_mutex", - }, - "p2" : { - "lock0" : "trig3_mutex", - "wait1" : { "ref" : "wait3", "mutex": "trig3_mutex" }, - "unlock2" : "trig3_mutex", - "run3" : 300, - "lock4" : "trig3_mutex", - "signal5" : "trig3", - "unlock6" : "trig3_mutex", - } } + "lock" : "mutex", + "wait" : { "ref" : "queue", "mutex": "mutex" }, + "unlock" : "mutex", + "run" : 300, + "lock" : "mutex", + "signal" : "queue", + "unlock" : "mutex", }, }, - "resources" : { - "tick" : { "type" : "timer" }, - "trig0_mutex" : { "type" : "mutex" }, - "wait0" : { "type" : "wait" }, - "trig0" : { "type" : "signal", "target" : "wait0" }, - "trig1_mutex" : { "type" : "mutex" }, - "wait1" : { "type" : "wait" }, - "trig1" : { "type" : "signal", "target" : "wait1" }, - "trig2_mutex" : { "type" : "mutex" }, - "wait2" : { "type" : "wait" }, - "trig2" : { "type" : "signal", "target" : "wait2" }, - "trig3_mutex" : { "type" : "mutex" }, - "wait3" : { "type" : "wait" }, - "trig3" : { "type" : "signal", "target" : "wait3" }, - }, "global" : { "default_policy" : "SCHED_OTHER", "duration" : 5, |