Linsched调度程序模拟器 [英] Scheduler simulator linsched

查看:66
本文介绍了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:

  1. Copy the code in listing 4 to the bottom of basic_test.c
  2. initialize the variable count to zero or some other good value.
  3. Change topo_db to linsched_topo_db
  4. change the function name to test_new_test
  5. Add TEST(new_test), to struct test tests[], but NOT at the bottom because the last one is used as a sentinel when printing.
  6. Add the function as forward declaration at the top of the file void test_new_test(int argc, char **argv);
  7. Compile and run: /basic_tests list
    trivial_bal
    basic_bal1
    basic_bal2
    bal1
    new_test
  8. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆