调度程序模拟器 linsched

发布于 2024-12-26 10:10:13 字数 165 浏览 1 评论 0原文

如何使用linsched(Linux调度程序模拟器)?需要一个有关如何运行和检查输出的示例。一直在寻找教程并浏览自述文件​​。不明白如何运行和检查输出。尝试运行 basic_tests 脚本(如 ./basic_tests trivial_bal UNIPROCESSOR)但是,它没有显示任何内容,..提前感谢..

How to use linsched (Linux scheduler simulator)? In need of an example on how to run and check the output. Have been searching for tutorials and also went through the README file. Din't understand how to run and checkout the outputs. Tried running basic_tests script (as ./basic_tests trivial_bal UNIPROCESSOR) but, it din't show up anything, .. Thanks in advance..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零崎曲识 2025-01-02 10:10:13

您不可能是唯一遇到此问题的人!运行一个小例子并不是一件容易的事。

对于您想要输出的每个测试(每个人都想要输出,显然编写测试的人除外),在测试末尾添加 linsched_print_task_stats(); 并重新编译。

如果您想添加自己的测试,例如 中的清单 4 http://www.ibm.com/developerworks/linux/library/l-linux-scheduler-simulator/ 这样做:

  1. 将清单 4 中的代码复制到 basic_test.c 的底部
  2. 初始化变量 count 为零或其他合适的值。
  3. topo_db 更改为 linsched_topo_db
  4. 将函数名称更改为 test_new_test
  5. TEST(new_test), 添加到 struct test测试[],但不在底部,因为最后一个在打印时用作哨兵。
  6. 在文件顶部添加函数作为前向声明 void test_new_test(int argc, char **argv);
  7. 编译并运行:/basic_tests list
    <代码>
    trivial_bal
    basic_bal1
    basic_bal2
    球1
    新测试
    尝试您的新命令

  8. ./basic_tests new_test 单处理器
任务 id = 3 (1),exec_time = 7116000000,run_delay = 52092000000,  
任务id = 4(2),exec_time = 7116000000,run_delay = 52093000000,  
任务id = 5(3),exec_time = 7116000000,run_delay = 52094000000,  
任务id = 6(4),exec_time = 7115000000,run_delay = 52095000000,  
任务id = 7(5),exec_time = 7115000000,run_delay = 52091000000,  
任务id = 8(6),exec_time = 3430000000,run_delay = 25771000000,  
任务id = 9(7),exec_time = 3430000000,run_delay = 25772000000,  
任务id = 10(8),exec_time = 3430000000,run_delay = 25773000000,   
任务id = 11(9),exec_time = 3430000000,run_delay = 25774000000,  
任务id = 12(10),exec_time = 3430000000,run_delay = 25775000000,  
任务id = 13(11),exec_time = 7272000000,run_delay = 52725000000,  
总 exec_time = 60000000000

我上面提到的链接对如何解释这些数字有很好的解释。
祝您安排顺利!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文