Linsched调度程序模拟器 [英] Scheduler simulator linsched
问题描述
如何使用linsched(Linux调度程序模拟器)?需要有关如何运行和检查输出的示例.一直在寻找教程并浏览了自述文件.不了解如何运行和检出输出.尝试运行basic_tests脚本(如./basic_tests trivial_bal UNIPROCESSOR),但是它没有显示任何内容,..预先感谢.
您可能不是唯一遇到此问题的人!运行一个小示例并非易事.
对于要输出的每个测试(每个人都希望输出,除了显然写测试的人之外),请在测试结束时添加 linsched_print_task_stats();
并重新编译.
如果要添加自己的测试,例如 解决方案
You can't be the only one having this problem! It was not trivial to get a small example running.
For every test you want output (everybody wants output, except for the person who wrote the tests obviously), add linsched_print_task_stats();
at the end of the test and recompile.
If you want to add an own test, for example listing 4 in http://www.ibm.com/developerworks/linux/library/l-linux-scheduler-simulator/ do like this:
- Copy the code in listing 4 to the bottom of basic_test.c
- initialize the variable
count
to zero or some other good value. - Change
topo_db
tolinsched_topo_db
- change the function name to
test_new_test
- Add
TEST(new_test),
tostruct test tests[]
, but NOT at the bottom because the last one is used as a sentinel when printing. - Add the function as forward declaration at the top of the file
void test_new_test(int argc, char **argv);
- Compile and run:
/basic_tests list
trivial_bal
basic_bal1
basic_bal2
bal1
new_test
- Try your new command.
./basic_tests new_test uniprocessor
Task id = 3 (1), exec_time = 7116000000, run_delay = 52092000000, Task id = 4 (2), exec_time = 7116000000, run_delay = 52093000000, Task id = 5 (3), exec_time = 7116000000, run_delay = 52094000000, Task id = 6 (4), exec_time = 7115000000, run_delay = 52095000000, Task id = 7 (5), exec_time = 7115000000, run_delay = 52091000000, Task id = 8 (6), exec_time = 3430000000, run_delay = 25771000000, Task id = 9 (7), exec_time = 3430000000, run_delay = 25772000000, Task id = 10 (8), exec_time = 3430000000, run_delay = 25773000000, Task id = 11 (9), exec_time = 3430000000, run_delay = 25774000000, Task id = 12 (10), exec_time = 3430000000, run_delay = 25775000000, Task id = 13 (11), exec_time = 7272000000, run_delay = 52725000000, Total exec_time = 60000000000
The link I mentioned above has a very good explanation on how to interpret the numbers. Good luck with the scheduling!
这篇关于Linsched调度程序模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!