Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-bootchart: When "--per-cpus" is selected, utilization for CPU > 4 is not displayed #404

Closed
gmacario opened this issue Jun 29, 2015 · 6 comments

Comments

@gmacario
Copy link
Contributor

When I execute the following command on my machine (with 8 cores)

# /usr/lib/systemd/systemd-bootchart --rel \
--freq=50 --samples=500 --scale-x=100 --scale-y=20 \
--no-filter --cmdline --per-cpu

only the CPU utilization/wait diagrams for CPU[0] up to CPU[4] are displayed in the resulting *.svg.

Tested on systemd master (0bf134a)

@zonque
Copy link
Member

zonque commented Jun 29, 2015

The code base of this utility is really messed up, and my latest cleanup series were only superficial, so this probably needs some more love.

Given that you are an active user of this tool and that I don't have a machine with > 4 cores to test on, could you come up with a pull request to address this issue?

@xnox
Copy link
Member

xnox commented Jun 29, 2015

A VM can be started with any number of CPUs, even more than what one has locally.

@gmacario
Copy link
Contributor Author

@zonque: I am working on the PR, stay tuned!

@gmacario
Copy link
Contributor Author

@xnox: Here is the result of `cat /proc/schedstat' on the VM (actually, Docker container) where I reproduced the bug:

[root@2f5b1362f712 bootchart]# cat /proc/schedstat
version 15
timestamp 4855039882
cpu0 188037 0 1573906835 574514540 339919368 4004785195 1501182590913299 8420652801903980 22467416634
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000011 134649152 89534074 19713977 798211662 109752875 197773 172178 89361899 2335911 2136442 65868 30733663 347352 337 1095 2135347 604381376 387782326 80163252 3173762028 385055253 75881 1792212 385990114 1721 23 1698 0 0 0 0 0 0 1802526934 1024138408 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 108887839 58771373 15694353 1104687215 164394830 335113 4493107 50121360 4233671 3887978 162755 40154190 503656 697 334176 2647057 467945578 71970048 131388844 2503935286 968007823 184952 43381465 28588583 9166 285 8881 0 0 0 0 0 0 3122541789 1785843057 0
cpu1 240297 0 1652691900 649274775 300474859 3986346559 1487405059640541 8160206669741573 22470648751
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000022 101129555 65939355 17488230 3938517273 78818577 200632 210924 65728432 2818129 2515557 104746 42129311 509671 1533 1915 2513642 608968434 392706477 80098673 3261436001 380753935 86881 1931332 390775145 1435 15 1420 0 0 0 0 0 0 1826647331 1055117637 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 83285090 44679079 12708885 4029939773 125984150 235934 4608258 36838026 5693138 5113431 276208 66286595 845059 1849 407411 3496015 472804745 74540968 131737939 2729614987 973152502 177847 44417230 30123738 5798 119 5679 0 0 0 0 0 0 3077415561 1771446826 0
cpu2 199218 0 1191750380 533476723 4161182288 3735082099 1495673105688649 8191453038886621 22126176006
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000044 74679569 45959901 14947049 3286041044 65122055 244667 159469 45800434 3910234 3323525 245627 72259177 948508 6848 4567 3318958 641696096 411568883 83915197 464380705 412092600 118388 2005848 409563035 2290 30 2260 0 0 0 0 0 0 1740156626 1030846938 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 60937474 32617107 10026125 2816494709 93015766 141901 5330866 26480355 8044738 7206063 396610 93369028 1204498 2412 631072 5352284 495484075 77564274 139253247 996076918 1021784046 160977 47705782 29858492 3381 58 3323 0 0 0 0 0 0 2980910859 1749484462 0
cpu3 200265 0 1490439275 655658616 81023678 3840517113 1476777327550991 7952051433119413 22302002138
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000088 53135553 35084386 9470613 1944847089 42498753 77992 125903 34958482 5757810 4969852 313066 100613535 1236810 4545 6145 4963707 636971753 410164145 83173632 309500874 401136724 60223 2119939 408044206 387 3 384 0 0 0 0 0 0 1799897491 1067856974 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 44564009 24058957 8082687 1934203330 65034933 98038 5458543 16895301 10900549 9664683 597934 137445845 1756478 3837 864326 6732155 493337755 79342729 137731280 810980941 1012063469 149127 50320489 29022240 2577 17 2560 0 0 0 0 0 0 3030543666 1756752788 0
cpu4 126033 0 374029566 4262002520 696982547 188035363 1669885023278932 5613489989842793 26169285087
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000011 36900040 27346453 3515644 981983141 48687122 34725 48377 27298078 6917980 6122169 269318 101044458 1647857 3630 3751 6118418 398752023 270684263 45234898 1301138669 316956371 19550 562562 270121701 145 8 137 0 0 0 0 0 0 1746190403 408417415 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 30962753 26702311 1837548 384546834 11300487 3622 1312510 3734439 10783960 10783960 0 0 0 0 0 0 315919158 57558137 103687594 3985986289 572064695 11422 37921679 19636458 135 5 130 0 0 0 0 0 0 3057724077 1602014694 0
cpu5 161341 0 773580473 149016886 789936373 224134563 1666061373729131 5580271261805111 26386208164
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000022 33487504 23712590 3051382 886238557 51633594 15957 48216 23664374 7541392 6743811 260919 101435565 1650134 2152 4227 6739584 382508188 259937555 43681233 789179204 297601982 13176 570900 259366655 54 6 48 0 0 0 0 0 0 1795167122 411387394 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 26875322 22369661 1993472 391770583 12042310 3163 1347253 3403133 11690922 11690922 0 0 0 0 0 0 303618782 56737572 99226474 2776962740 546089911 11743 38002614 18734958 147 2 145 0 0 0 0 0 0 3065601984 1596349943 0
cpu6 130884 0 660727901 55371146 1116652530 366309999 1665397803977611 5642037364280924 26367666055
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000044 27238427 18295072 2719825 824037378 45812167 7826 23392 18271680 8683365 7929961 213345 105416612 1640151 870 2121 7927840 389551539 262820669 44958083 1190380038 309971775 9796 549692 262270977 26 1 25 0 0 0 0 0 0 1820826657 409852376 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 21066033 17868651 1397536 274533387 8669621 1962 1034306 2414286 12960496 12960495 0 9 27 0 0 0 307778752 58235557 100600019 3293590029 554363381 8277 39542928 18692629 133 0 133 0 0 0 0 0 0 3224483170 1606332646 0
cpu7 125267 0 953037923 224103548 967512440 285798610 1663500791729491 5605628887670911 26490604187
domain0 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000088 27837371 17462608 2910386 898102865 52933399 11226 33126 17429482 8798973 7967306 256434 109922928 1760139 1518 3400 7963906 380886748 258353194 43770931 756570275 296063635 11832 560718 257792476 33 1 32 0 0 0 0 0 0 1843327379 413060649 0
domain1 00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff 20474849 16002274 2012869 378638085 11609468 4101 1454897 2959750 13416378 13416378 0 0 0 0 0 1 302124124 58981851 98561555 2800636566 537451232 14279 41444060 17537791 125 1 124 0 0 0 0 0 0 3133353747 1595633702 0
[root@2f5b1362f712 bootchart]#

My current understanding is that the code in src/bootchart/store.c does only a partial read of /proc/schedstat

gmacario pushed a commit to gmacario/systemd that referenced this issue Jun 29, 2015
On multi-core systems file /proc/schedstat may be
larger than 4096 bytes and pread will read only part of it.

Call pread repeatedly to make sure all the file is read.

Fix issue systemd#404
@gmacario
Copy link
Contributor Author

Here is PR #407

gmacario pushed a commit to gmacario/systemd that referenced this issue Jun 30, 2015
On multi-core systems file /proc/schedstat may be
larger than 4096 bytes and pread() will only read part of it.

Fix issue systemd#404
@gmacario
Copy link
Contributor Author

Fix via c91d0fd

Yamakuzure pushed a commit to elogind/elogind that referenced this issue Jan 3, 2017
On multi-core systems file /proc/schedstat may be
larger than 4096 bytes and pread() will only read part of it.

Fix issue systemd/systemd#404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants