diff --git a/README.md b/README.md index e110648..d3e44e6 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,32 @@ default). ### Visualisation The `prmon_plot.py` script can be used to plot the outputs of prmon from the -timestamped output file (usually `prmon.txt`). e.g., +timestamped output file (usually `prmon.txt`). Some examples include: +* Memory usage as a function of wall-time: ```sh -prmon_plot.py --yvar pss,rss,swap,vmem +prmon_plot.py --input prmon.txt --xvar wtime --yvar vmem,pss,rss,swap ``` +![](example-plots/PrMon_wtime_vs_vmem_pss_rss_swap.png) +* Rate of change in memory usage as a function of wall-time: +```sh +prmon_plot.py --input prmon.txt --xvar wtime --yvar vmem,pss,rss,swap --diff +``` +![](example-plots/PrMon_wtime_vs_diff_vmem_pss_rss_swap.png) + +* Rate of change in CPU usage as a function of wall-time with stacked +user and system utilizations: +```sh +prmon_plot.py --input prmon.txt --xvar wtime --yvar utime,stime --yunit SEC --diff --stacked +``` +![](example-plots/PrMon_wtime_vs_diff_utime_stime.png) + +The plots above, as well as the input `prmon.txt` file that is used +to produce them, can be found under the `example-plots` folder. + +The script allows the user to specify variables, their units, plotting +style (stacked vs overlaid), as well as the format of the output image. Use `-h` for more information. ## Developer @@ -125,4 +145,4 @@ to CMake using `Gperftools_ROOT_DIR`. Copyright (c) 2018, CERN. - \ No newline at end of file + diff --git a/example-plots/PrMon_wtime_vs_diff_utime_stime.png b/example-plots/PrMon_wtime_vs_diff_utime_stime.png new file mode 100644 index 0000000..cf0d97f Binary files /dev/null and b/example-plots/PrMon_wtime_vs_diff_utime_stime.png differ diff --git a/example-plots/PrMon_wtime_vs_diff_vmem_pss_rss_swap.png b/example-plots/PrMon_wtime_vs_diff_vmem_pss_rss_swap.png new file mode 100644 index 0000000..b29e6d9 Binary files /dev/null and b/example-plots/PrMon_wtime_vs_diff_vmem_pss_rss_swap.png differ diff --git a/example-plots/PrMon_wtime_vs_vmem_pss_rss_swap.png b/example-plots/PrMon_wtime_vs_vmem_pss_rss_swap.png new file mode 100644 index 0000000..e706912 Binary files /dev/null and b/example-plots/PrMon_wtime_vs_vmem_pss_rss_swap.png differ diff --git a/example-plots/prmon.txt b/example-plots/prmon.txt new file mode 100644 index 0000000..635106e --- /dev/null +++ b/example-plots/prmon.txt @@ -0,0 +1,61 @@ +Time wtime stime utime pss rss swap vmem rchar read_bytes wchar write_bytes rx_bytes rx_packets tx_bytes tx_packets +1527669447 1 0 0 5116 5816 0 35036 749220 3526656 0 0 2421 11 668 4 +1527669478 32 6 7 379469 385508 0 929804 21411819 272224256 1091256 69632 9089738 7021 348583 2560 +1527669510 63 9 21 675151 681332 0 1288928 29769911 335474688 1346624 217088 13157914 10702 716675 4589 +1527669540 93 10 41 896376 902552 0 1515160 36393823 366415872 1437303 303104 20272670 16437 1117086 7018 +1527669571 124 11 53 935779 942008 0 1615260 38861991 393740288 1794378 352256 40950542 31764 1664028 9968 +1527669602 155 14 72 401373 407144 0 956468 53247957 729001984 5693752 3100672 55317251 41829 1868803 11613 +1527669633 186 16 78 571599 577808 0 1239196 63246514 850055168 5836242 3215360 68344574 52250 2448135 14609 +1527669664 218 17 81 700030 706052 0 1388560 65262265 898285568 6152118 3403776 83886797 64809 3243516 18535 +1527669695 248 18 98 1047449 1053484 0 1985344 93386240 1415069696 6866208 3960832 207646280 149933 4222851 29777 +1527669727 280 19 109 1281159 1287192 0 2422024 152931651 1744584704 8160880 5005312 417791699 293737 5651020 47121 +1527669757 311 19 112 1340431 1346464 0 2513168 155720848 1744592896 8199523 5033984 420885535 297052 6092686 48826 +1527669788 341 20 118 1502215 1508248 0 2641256 158524967 1744592896 8249415 5083136 491302409 346247 7496796 60755 +1527669819 372 21 132 2032875 2038908 0 3225064 161320740 1744592896 8292418 5111808 510624959 360482 8129482 64694 +1527669850 403 22 145 2249087 2255120 0 3541508 292454866 1900785664 8448872 5242880 541378274 383250 9034024 70502 +1527669882 435 41 257 10066363 27319528 0 37913036 611972575 2504003584 31751488 56139776 777966617 546590 12071667 112350 +1527669913 465 52 483 21640097 38101640 0 53545020 777476285 3288907776 69657777 94572544 797469632 560614 12414817 115828 +1527669944 496 56 729 22178590 38561744 68 53978692 884362198 3334696960 124134161 149536768 797631008 561001 12459353 115923 +1527669975 528 59 977 22238303 38608444 432 54058204 997933781 3362930688 186910530 217894912 797650556 561253 12492126 115958 +1527670006 558 62 1224 22645304 38985352 884 54464908 1302330616 3395383296 248947044 285585408 797671986 561526 12529228 116001 +1527670037 589 67 1470 22746799 39022904 1384 54817372 1588203847 3443814400 373493237 417435648 797693066 561785 12559786 116031 +1527670068 620 71 1716 22991998 39184676 1960 54994476 1839941468 3476852736 483129293 532942848 797722800 562086 12600719 116121 +1527670098 651 74 1962 22905916 39083996 2988 55103320 2123666739 3511218176 611655460 666382336 797745612 562365 12631513 116175 +1527670130 683 81 2182 22408456 38567408 2988 55427364 2324367614 3540262912 728267167 801734656 797774105 562671 12677379 116239 +1527670161 714 85 2214 19922613 34044408 2864 49022752 2355056422 3731451904 812326763 906936320 797979159 563101 12723318 116324 +1527670192 744 89 2243 17431318 29522004 2264 42575640 2382738975 3737804800 897505451 1010356224 798000192 563374 12748039 116357 +1527670223 776 93 2273 14937942 24998484 1872 36095228 2407439284 3741683712 982028799 1107103744 798020757 563636 12773908 116384 +1527670253 807 96 2302 12431324 20461768 1524 29574484 2429155471 3748548608 1065182269 1208356864 798097871 563951 12809361 116446 +1527670285 838 100 2333 10011974 16003796 1052 23215812 2447874791 3753418752 1147365831 1314119680 798120606 564238 12841498 116479 +1527670316 869 103 2363 7594359 11559684 428 16824952 2460581862 3758059520 1229692378 1422102528 798151937 564528 12871976 116575 +1527670347 900 107 2391 5071220 7000732 52 10418064 2473317841 3763732480 1302609956 1514868736 798171690 564783 12910062 116620 +1527670377 930 111 2415 2315059 2321112 0 3832956 2540478311 3769876480 1422297342 1623924736 801031827 567025 12984394 117264 +1527670408 961 119 2429 523762 609584 0 2344096 2566492577 4702695424 1431092854 1628282880 801092241 567353 13043540 117347 +1527670439 993 123 2451 365029 446204 0 1946432 2586508125 5013233664 1435742146 1633054720 801298668 567768 13103650 117463 +1527670471 1024 129 2467 163369 168960 0 862288 2609680202 5175758848 1441388981 1633611776 801601971 568324 13190988 117706 +1527670501 1054 133 2479 773603 780396 0 1889812 2629377540 5684695040 1442320245 1633804288 802287473 569521 13407261 118427 +1527670532 1085 133 2482 928036 934868 0 2057760 2632797190 5721944064 1442483069 1633914880 805363344 573102 13959710 120419 +1527670563 1116 134 2504 1384668 1391512 0 2746856 2678586314 5864558592 1458737632 1650155520 807192463 575227 14273016 121681 +1527670594 1148 139 2524 367441 494824 0 1754520 2738369142 6095372288 1488588400 1681481728 807215236 575515 14308439 121731 +1527670625 1179 145 2543 1055245 1157228 0 3172324 2763787370 6776659968 1489461283 1681547264 807242326 575809 14323960 121789 +1527670657 1210 149 2564 505447 512376 0 1494208 2777393953 6822879232 1497190852 1686589440 807654291 576643 14405639 122372 +1527670687 1240 154 2581 545683 552240 0 1540220 2797616609 7263186944 1498690425 1687068672 807893695 577464 14520600 123269 +1527670718 1271 156 2589 827010 833844 0 1963188 2808226496 7503966208 1499050737 1687347200 809780724 580639 15154370 125552 +1527670749 1303 157 2594 995397 1002236 0 2153984 2812845067 7565443072 1499253952 1687486464 814264867 585259 15695336 127798 +1527670780 1334 157 2595 1026968 1033812 0 2178832 2814545296 7565443072 1499291803 1687523328 820494690 591245 16349472 130491 +1527670811 1365 158 2604 1514691 1521536 0 2826044 2949937241 7830458368 1499579507 1687769088 824171383 594844 16700964 132065 +1527670843 1396 159 2633 1983595 1990440 0 3462264 3096085570 7871467520 1629661806 1818116096 824248028 595133 16704369 132105 +1527670873 1426 161 2661 1986091 1992944 0 3499936 3260494337 7886315520 1777362790 1966096384 824273005 595407 16707144 132135 +1527670904 1457 163 2691 2024221 2031076 0 3513480 3423994759 7890980864 1933121491 2122158080 824305853 595800 16746667 132247 +1527670935 1488 164 2720 1999425 2006280 0 3513480 3591801976 7907631104 2080889509 2270224384 824327371 596060 16773004 132276 +1527670966 1520 167 2746 165602 170400 0 811592 3714120917 7955263488 2184513287 2378997760 824349849 596331 16801745 132311 +1527670997 1551 174 2760 878130 985516 0 2867588 3742635592 8617844736 2186326544 2379055104 824374680 596628 16849810 132358 +1527671028 1582 176 2788 399968 488280 0 2053608 3749757536 8821317632 2191329643 2384179200 824399638 596894 16890699 132439 +1527671060 1613 181 2805 791332 798344 0 1868816 3772192017 8961232896 2196394110 2384355328 824685633 597435 16979435 132694 +1527671090 1643 187 2818 757319 764012 0 1879988 3792446633 9492439040 2197624510 2384715776 825517368 598904 17228698 133616 +1527671121 1674 187 2825 952628 959464 0 2156052 3814368119 9669677056 2197985952 2384982016 845651145 614891 18120820 138333 +1527671152 1705 187 2826 967812 974648 0 2182208 3817977275 9686036480 2198091297 2385063936 849121907 618762 18659585 140290 +1527671183 1736 194 2877 1986844 4740324 0 8250368 4449835233 10325934080 2205477298 2393337856 850251192 620039 18817612 140864 +1527671215 1768 200 2895 403696 408604 0 1274960 4588150488 10729717760 2225362200 2408914944 851240364 621015 18891247 141083 +1527671245 1798 201 2924 540378 545432 0 1411124 4754903037 10730872832 2244510940 2428071936 851262204 621289 18912310 141113 +1527671276 1829 204 2949 451441 453700 0 1282896 4998568196 10770522112 2272461066 2471686144 851297702 621607 18953941 141198 diff --git a/package/scripts/prmon_plot.py b/package/scripts/prmon_plot.py index 0db1da7..d1a6dd4 100755 --- a/package/scripts/prmon_plot.py +++ b/package/scripts/prmon_plot.py @@ -20,7 +20,7 @@ sys.exit(-1) # Define the labels/units for beautification -axisunits = {'vmem':'kb', 'pss':'kb', 'rss':'kb', +axisunits = {'vmem':'kb', 'pss':'kb', 'rss':'kb', 'swap':'kb', 'utime':'sec', 'stime':'sec', 'wtime':'sec', 'rchar':'char','wchar':'char', 'read_bytes':'b','write_bytes':'b', @@ -30,6 +30,7 @@ axisnames = {'vmem':'Memory', 'pss':'Memory', 'rss':'Memory', + 'swap':'Memory', 'utime':'CPU-time', 'stime':'CPU-time', 'wtime':'Wall-time', @@ -45,6 +46,7 @@ legendnames = {'vmem':'Virtual Memory', 'pss':'Proportional Set Size', 'rss':'Resident Set Size', + 'swap':'Swap Size', 'utime':'User CPU-time', 'stime':'System CPU-time', 'wtime':'Wall-time',