)]}'
{"lib/dstat":[{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"4946432e2b6a8e5959c313ebb7a0b269c305e26e","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    # To enable memory_tracker add:"},{"line_number":30,"context_line":"    #    enable_service memory_tracker"},{"line_number":31,"context_line":"    # to your localrc"},{"line_number":32,"context_line":"    run_process memory_tracker \"$TOP_DIR/tools/memory_tracker.py\""},{"line_number":33,"context_line":"}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# stop_dstat() stop dstat process"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"da36d5c6_86add28a","line":32,"updated":"2017-02-20 00:58:56.000000000","message":"Sorry to keep coming back to this, but I just worry we end up with a bunch of different hardly-used services doing all similar things.  I mean, we\u0027re already up to 3 :)\n\nDo you think maybe \"dstat\" should just run this (renamed to lockmem_tracker or something more specific) and the peakmem tracker all at once (along with the existing dstat output)?  \n\nJust have one knob that we turn on.  \n\npeakmem tracker seems to come out at about 200kb (see [1]) and has the overall lock mem info so might be a help seeing if this is needed in the first place.\n\nthis looks like it\u0027s generally tiny [2]\n\nGiven how useful it can be and how hard it is to debug without this type of info, i think there\u0027s a strong argument we should simplify this to one debug service.\n\n[1] http://logs.openstack.org/11/434511/1/check/gate-tempest-dsvm-platform-centos7-nv/cecd782/logs/screen-peakmem_tracker.txt.gz\n[2] http://logs.openstack.org/74/434474/3/check/gate-tempest-dsvm-platform-centos7-nv/9336048/logs/screen-memory_tracker.txt.gz","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"738c2b2606445e7d1d954ef16802fb09bcce88b9","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    # To enable memory_tracker add:"},{"line_number":30,"context_line":"    #    enable_service memory_tracker"},{"line_number":31,"context_line":"    # to your localrc"},{"line_number":32,"context_line":"    run_process memory_tracker \"$TOP_DIR/tools/memory_tracker.py\""},{"line_number":33,"context_line":"}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# stop_dstat() stop dstat process"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"da36d5c6_4832e5f2","line":32,"in_reply_to":"da36d5c6_86add28a","updated":"2017-02-20 23:30:34.000000000","message":"OK, lemme integrate it into peakmem_tracker, and rename it into memory_tracker to reflect new intent. I hope I don\u0027t need to support the old name of the service, do I?","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"fdb8e8e3f773f4baf2b30166e1659f7c73cb0186","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    # To enable memory_tracker add:"},{"line_number":25,"context_line":"    #    enable_service memory_tracker"},{"line_number":26,"context_line":"    # to your localrc"},{"line_number":27,"context_line":"    run_process memory_tracker \"$TOP_DIR/tools/memory_tracker.sh\""},{"line_number":28,"context_line":"}"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"# stop_dstat() stop dstat process"}],"source_content_type":"application/x-shellscript","patch_set":8,"id":"ba2be162_eb004904","line":27,"updated":"2017-03-06 04:38:57.000000000","message":"i don\u0027t think it is worth deprecating this -- we could in theory retain a peakmem_tracker that wraps this.\n\nbut it would be nice to see a needed-by: flag for the corresponding d-g change to update the name","commit_id":"84ac80cab3a4b86c1d8b34c5e397b7839582de43"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"1efba40cecf0ba6d4cfc0bcdee526ec34a66b47e","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    # To enable memory_tracker add:"},{"line_number":25,"context_line":"    #    enable_service memory_tracker"},{"line_number":26,"context_line":"    # to your localrc"},{"line_number":27,"context_line":"    run_process memory_tracker \"$TOP_DIR/tools/memory_tracker.sh\""},{"line_number":28,"context_line":"}"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"# stop_dstat() stop dstat process"}],"source_content_type":"application/x-shellscript","patch_set":8,"id":"ba2be162_428596ab","line":27,"in_reply_to":"ba2be162_eb004904","updated":"2017-03-06 18:08:54.000000000","message":"Done","commit_id":"84ac80cab3a4b86c1d8b34c5e397b7839582de43"}],"tools/memory_tracker.py":[{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"4946432e2b6a8e5959c313ebb7a0b269c305e26e","unresolved":false,"context_lines":[{"line_number":19,"context_line":"        try:"},{"line_number":20,"context_line":"            msg \u003d _get_report()"},{"line_number":21,"context_line":"        except Exception as e:"},{"line_number":22,"context_line":"            msg \u003d \"Exception occurred: %s\" % str(e)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"        # append timestamp"},{"line_number":25,"context_line":"        print \"%(time)s %(data)s\" % {"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_c6b50ad1","line":22,"updated":"2017-02-20 00:58:56.000000000","message":"presumably just race conditions where this hits in [1]?\n\n[1] http://logs.openstack.org/74/434474/3/check/gate-tempest-dsvm-platform-centos7-nv/9336048/logs/screen-memory_tracker.txt.gz","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"738c2b2606445e7d1d954ef16802fb09bcce88b9","unresolved":false,"context_lines":[{"line_number":19,"context_line":"        try:"},{"line_number":20,"context_line":"            msg \u003d _get_report()"},{"line_number":21,"context_line":"        except Exception as e:"},{"line_number":22,"context_line":"            msg \u003d \"Exception occurred: %s\" % str(e)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"        # append timestamp"},{"line_number":25,"context_line":"        print \"%(time)s %(data)s\" % {"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_e868f9bc","line":22,"in_reply_to":"da36d5c6_c6b50ad1","updated":"2017-02-20 23:30:34.000000000","message":"Done","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"3025bc4a586fe48d6e62542d42fe607202453b32","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def _get_report():"},{"line_number":39,"context_line":"    mlock_users \u003d []"},{"line_number":40,"context_line":"    for proc in psutil.process_iter():"},{"line_number":41,"context_line":"        pid \u003d proc.pid"},{"line_number":42,"context_line":"        # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":43,"context_line":"        # call to pmap and parse the output here"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_f389d6cb","line":40,"updated":"2017-02-20 19:37:09.000000000","message":"consider passing the whole list of pids into pmap","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"738c2b2606445e7d1d954ef16802fb09bcce88b9","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def _get_report():"},{"line_number":39,"context_line":"    mlock_users \u003d []"},{"line_number":40,"context_line":"    for proc in psutil.process_iter():"},{"line_number":41,"context_line":"        pid \u003d proc.pid"},{"line_number":42,"context_line":"        # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":43,"context_line":"        # call to pmap and parse the output here"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_083f0db5","line":40,"in_reply_to":"da36d5c6_f389d6cb","updated":"2017-02-20 23:30:34.000000000","message":"Nah, it makes it hard to parse the output.","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"3025bc4a586fe48d6e62542d42fe607202453b32","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        pid \u003d proc.pid"},{"line_number":42,"context_line":"        # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":43,"context_line":"        # call to pmap and parse the output here"},{"line_number":44,"context_line":"        out \u003d subprocess.check_output([\u0027pmap\u0027, \u0027-XX\u0027, str(pid)])"},{"line_number":45,"context_line":"        last_line \u003d out.splitlines()[-1]"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # some processes don\u0027t provide a memory map, for example those"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_d3edb28c","line":44,"updated":"2017-02-20 19:37:09.000000000","message":"gotta catch \u003d\u003d 42 here and skip to next process","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"738c2b2606445e7d1d954ef16802fb09bcce88b9","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        pid \u003d proc.pid"},{"line_number":42,"context_line":"        # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":43,"context_line":"        # call to pmap and parse the output here"},{"line_number":44,"context_line":"        out \u003d subprocess.check_output([\u0027pmap\u0027, \u0027-XX\u0027, str(pid)])"},{"line_number":45,"context_line":"        last_line \u003d out.splitlines()[-1]"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # some processes don\u0027t provide a memory map, for example those"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_c87335b0","line":44,"in_reply_to":"da36d5c6_d3edb28c","updated":"2017-02-20 23:30:34.000000000","message":"Done","commit_id":"88cf28a3ec1ce1daf66ee86ad0a9b9bd74ad85b0"}],"tools/memory_tracker.sh":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f63a2cd853525462acd9dd32fa0d598e57dfcc70","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        echo \"---\""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        # list processes that lock memory from swap"},{"line_number":76,"context_line":"        $TOP_DIR/tools/mlock_report.py"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        echo \"]]]\""},{"line_number":79,"context_line":"        sleep $SLEEP_TIME"}],"source_content_type":"text/x-sh","patch_set":5,"id":"da36d5c6_c29a0463","line":76,"range":{"start_line":76,"start_character":8,"end_line":76,"end_character":16},"updated":"2017-02-22 06:50:27.000000000","message":"seems like TOP_DIR is not really passed into the process.","commit_id":"182582d709e92fabf3a752b19b14b157753d8550"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"fdb8e8e3f773f4baf2b30166e1659f7c73cb0186","unresolved":false,"context_lines":[{"line_number":21,"context_line":"# around reclaimable memory.  However, it is not available until 3.14"},{"line_number":22,"context_line":"# kernel (i.e. Ubuntu LTS Trusty misses it).  In that case, we fall"},{"line_number":23,"context_line":"# back to free+buffers+cache as the available memory."},{"line_number":24,"context_line":"USE_MEM_AVAILBLE\u003d0"},{"line_number":25,"context_line":"if grep -q \u0027^MemAvailable:\u0027 /proc/meminfo; then"},{"line_number":26,"context_line":"    USE_MEM_AVAILABLE\u003d1"},{"line_number":27,"context_line":"fi"}],"source_content_type":"text/x-sh","patch_set":8,"id":"ba2be162_cb2e25a4","line":24,"updated":"2017-03-06 04:38:57.000000000","message":"we should fix this typo because I90bb0f8a936157e74f2715f5b29cac4bbf18d4b4 won\u0027t catch it because this isn\u0027t a rename","commit_id":"84ac80cab3a4b86c1d8b34c5e397b7839582de43"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"1efba40cecf0ba6d4cfc0bcdee526ec34a66b47e","unresolved":false,"context_lines":[{"line_number":21,"context_line":"# around reclaimable memory.  However, it is not available until 3.14"},{"line_number":22,"context_line":"# kernel (i.e. Ubuntu LTS Trusty misses it).  In that case, we fall"},{"line_number":23,"context_line":"# back to free+buffers+cache as the available memory."},{"line_number":24,"context_line":"USE_MEM_AVAILBLE\u003d0"},{"line_number":25,"context_line":"if grep -q \u0027^MemAvailable:\u0027 /proc/meminfo; then"},{"line_number":26,"context_line":"    USE_MEM_AVAILABLE\u003d1"},{"line_number":27,"context_line":"fi"}],"source_content_type":"text/x-sh","patch_set":8,"id":"ba2be162_62a9ba24","line":24,"in_reply_to":"ba2be162_cb2e25a4","updated":"2017-03-06 18:08:54.000000000","message":"Done","commit_id":"84ac80cab3a4b86c1d8b34c5e397b7839582de43"}],"tools/mlock_tracker.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e0d59c55d257fc687f0a2ea698dd03e4891c5d4e","unresolved":false,"context_lines":[{"line_number":10,"context_line":"import psutil"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"SUMMARY_REGEX \u003d re.compile(\".*\\s+(?P\u003clocked\u003e[^\\s]+)\\s+KB\")"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_9b761105","line":13,"updated":"2017-02-16 14:45:24.000000000","message":"Missing r in front of the string. It should be:\n\n re.compile(r\"\u003cyour_regex\")","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e21f4e117da963e78ba28b279bd3157476cf0f90","unresolved":false,"context_lines":[{"line_number":10,"context_line":"import psutil"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"SUMMARY_REGEX \u003d re.compile(\".*\\s+(?P\u003clocked\u003e[^\\s]+)\\s+KB\")"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_8c80958d","line":13,"range":{"start_line":13,"start_character":44,"end_line":13,"end_character":49},"updated":"2017-02-16 15:36:37.000000000","message":"There is \\S for that but should be safer to do just \\d instead as it\u0027s converted to int on L32 without any try-catch around.","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":10,"context_line":"import psutil"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"SUMMARY_REGEX \u003d re.compile(\".*\\s+(?P\u003clocked\u003e[^\\s]+)\\s+KB\")"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_ed982b1e","line":13,"range":{"start_line":13,"start_character":44,"end_line":13,"end_character":49},"in_reply_to":"fa31d9ce_8c80958d","updated":"2017-02-16 17:01:23.000000000","message":"Done","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":10,"context_line":"import psutil"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"SUMMARY_REGEX \u003d re.compile(\".*\\s+(?P\u003clocked\u003e[^\\s]+)\\s+KB\")"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_8d4defc6","line":13,"in_reply_to":"fa31d9ce_9b761105","updated":"2017-02-16 17:01:23.000000000","message":"I will add it, though why. It\u0027s sugar.","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e0d59c55d257fc687f0a2ea698dd03e4891c5d4e","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def main():"},{"line_number":17,"context_line":"    while True:"},{"line_number":18,"context_line":"        start \u003d datetime.datetime.utcnow()"},{"line_number":19,"context_line":"        mlock_users \u003d []"},{"line_number":20,"context_line":"        for proc in psutil.process_iter():"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_bb8f55cb","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":15},"updated":"2017-02-16 14:45:24.000000000","message":"Maybe we should be more defensive and run the whole below in different function. Otherwise if we get non-zero output of pmap or any other error, the loop will end and we won\u0027t continue getting reports. Something like:\n\n def main():\n     while True:\n         try:\n             run_routine()\n         except Exception as e:\n             print \"Exception occured: %s\" % e","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def main():"},{"line_number":17,"context_line":"    while True:"},{"line_number":18,"context_line":"        start \u003d datetime.datetime.utcnow()"},{"line_number":19,"context_line":"        mlock_users \u003d []"},{"line_number":20,"context_line":"        for proc in psutil.process_iter():"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_1f03e60e","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":15},"in_reply_to":"fa31d9ce_bb8f55cb","updated":"2017-02-16 17:01:23.000000000","message":"Done","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e0d59c55d257fc687f0a2ea698dd03e4891c5d4e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"            # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":23,"context_line":"            # call to pmap and parse the output here"},{"line_number":24,"context_line":"            out \u003d subprocess.check_output([\u0027pmap\u0027, \u0027-XX\u0027, str(pid)])"},{"line_number":25,"context_line":"            last_line \u003d out.split(\u0027\\n\u0027)[-2]"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"            # some processes don\u0027t provide a memory map, for example those"},{"line_number":28,"context_line":"            # running as kernel services, so we need to skip those that don\u0027t"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_bb2bd593","line":25,"range":{"start_line":25,"start_character":40,"end_line":25,"end_character":42},"updated":"2017-02-16 14:45:24.000000000","message":"I don\u0027t know if I\u0027m doing anything wrong. I\u0027m not familiar with pmap utility but when I run it, I just get some line full of \"\u003d\" signs.\n\nIs the last_line -2 because there are two \\n at the end?","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e0d59c55d257fc687f0a2ea698dd03e4891c5d4e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"            # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":23,"context_line":"            # call to pmap and parse the output here"},{"line_number":24,"context_line":"            out \u003d subprocess.check_output([\u0027pmap\u0027, \u0027-XX\u0027, str(pid)])"},{"line_number":25,"context_line":"            last_line \u003d out.split(\u0027\\n\u0027)[-2]"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"            # some processes don\u0027t provide a memory map, for example those"},{"line_number":28,"context_line":"            # running as kernel services, so we need to skip those that don\u0027t"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_1b43016e","line":25,"range":{"start_line":25,"start_character":24,"end_line":25,"end_character":39},"updated":"2017-02-16 14:45:24.000000000","message":"out.splitlines()","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":22,"context_line":"            # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":23,"context_line":"            # call to pmap and parse the output here"},{"line_number":24,"context_line":"            out \u003d subprocess.check_output([\u0027pmap\u0027, \u0027-XX\u0027, str(pid)])"},{"line_number":25,"context_line":"            last_line \u003d out.split(\u0027\\n\u0027)[-2]"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"            # some processes don\u0027t provide a memory map, for example those"},{"line_number":28,"context_line":"            # running as kernel services, so we need to skip those that don\u0027t"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_df478e49","line":25,"range":{"start_line":25,"start_character":24,"end_line":25,"end_character":39},"in_reply_to":"fa31d9ce_1b43016e","updated":"2017-02-16 17:01:23.000000000","message":"Done","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a8002cf1aad927a4c2669e5f0175f88dd015d569","unresolved":false,"context_lines":[{"line_number":22,"context_line":"            # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":23,"context_line":"            # call to pmap and parse the output here"},{"line_number":24,"context_line":"            out \u003d subprocess.check_output([\u0027pmap\u0027, \u0027-XX\u0027, str(pid)])"},{"line_number":25,"context_line":"            last_line \u003d out.split(\u0027\\n\u0027)[-2]"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"            # some processes don\u0027t provide a memory map, for example those"},{"line_number":28,"context_line":"            # running as kernel services, so we need to skip those that don\u0027t"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_3b525ede","line":25,"range":{"start_line":25,"start_character":40,"end_line":25,"end_character":42},"in_reply_to":"fa31d9ce_3f56ea06","updated":"2017-02-17 11:11:04.000000000","message":"Ok, mystery solved. The split(\u0027\\n\u0027) adds an empty line at the end while splitlines() doesn\u0027t.","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":22,"context_line":"            # sadly psutil does not expose locked pages info, that\u0027s why we"},{"line_number":23,"context_line":"            # call to pmap and parse the output here"},{"line_number":24,"context_line":"            out \u003d subprocess.check_output([\u0027pmap\u0027, \u0027-XX\u0027, str(pid)])"},{"line_number":25,"context_line":"            last_line \u003d out.split(\u0027\\n\u0027)[-2]"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"            # some processes don\u0027t provide a memory map, for example those"},{"line_number":28,"context_line":"            # running as kernel services, so we need to skip those that don\u0027t"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_3f56ea06","line":25,"range":{"start_line":25,"start_character":40,"end_line":25,"end_character":42},"in_reply_to":"fa31d9ce_bb2bd593","updated":"2017-02-16 17:01:23.000000000","message":"Do you execute the tool as root?\n\nYes, it\u0027s because of the last empty line.","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e0d59c55d257fc687f0a2ea698dd03e4891c5d4e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            # some processes don\u0027t provide a memory map, for example those"},{"line_number":28,"context_line":"            # running as kernel services, so we need to skip those that don\u0027t"},{"line_number":29,"context_line":"            # match"},{"line_number":30,"context_line":"            result \u003d re.match(SUMMARY_REGEX, last_line)"},{"line_number":31,"context_line":"            if result:"},{"line_number":32,"context_line":"                locked \u003d int(result.group(\u0027locked\u0027))"},{"line_number":33,"context_line":"                if locked:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_bb1cb5c2","line":30,"range":{"start_line":30,"start_character":21,"end_line":30,"end_character":55},"updated":"2017-02-16 14:45:24.000000000","message":"SUMMARY_REGEX.match(last_line)","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":27,"context_line":"            # some processes don\u0027t provide a memory map, for example those"},{"line_number":28,"context_line":"            # running as kernel services, so we need to skip those that don\u0027t"},{"line_number":29,"context_line":"            # match"},{"line_number":30,"context_line":"            result \u003d re.match(SUMMARY_REGEX, last_line)"},{"line_number":31,"context_line":"            if result:"},{"line_number":32,"context_line":"                locked \u003d int(result.group(\u0027locked\u0027))"},{"line_number":33,"context_line":"                if locked:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_3fa42a07","line":30,"range":{"start_line":30,"start_character":21,"end_line":30,"end_character":55},"in_reply_to":"fa31d9ce_bb1cb5c2","updated":"2017-02-16 17:01:23.000000000","message":"Meh but ok.","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e0d59c55d257fc687f0a2ea698dd03e4891c5d4e","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        # produce a single line log message with per process mlock stats"},{"line_number":39,"context_line":"        if mlock_users:"},{"line_number":40,"context_line":"            data \u003d \"; \".join("},{"line_number":41,"context_line":"                \"[%(name)s (pid:%(pid)s)]\u003d%(locked)dKB\" % args"},{"line_number":42,"context_line":"                # log heavy users first"},{"line_number":43,"context_line":"                for args in sorted(mlock_users, key\u003dlambda d: d[\u0027locked\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_de24f7b3","line":40,"range":{"start_line":40,"start_character":21,"end_line":40,"end_character":22},"updated":"2017-02-16 14:45:24.000000000","message":"Would it be more readable if we\u0027d put \\n here?","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        # produce a single line log message with per process mlock stats"},{"line_number":39,"context_line":"        if mlock_users:"},{"line_number":40,"context_line":"            data \u003d \"; \".join("},{"line_number":41,"context_line":"                \"[%(name)s (pid:%(pid)s)]\u003d%(locked)dKB\" % args"},{"line_number":42,"context_line":"                # log heavy users first"},{"line_number":43,"context_line":"                for args in sorted(mlock_users, key\u003dlambda d: d[\u0027locked\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_bfb81a2c","line":40,"range":{"start_line":40,"start_character":21,"end_line":40,"end_character":22},"in_reply_to":"fa31d9ce_de24f7b3","updated":"2017-02-16 17:01:23.000000000","message":"no, I want a single line per report","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"b61dba5f861f0e985da5182fe76da0acaddc9ab3","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            )"},{"line_number":45,"context_line":"        else:"},{"line_number":46,"context_line":"            data \u003d \"no locked memory\""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # append timestamp"},{"line_number":49,"context_line":"        print \"%(time)s %(data)s\" % {"},{"line_number":50,"context_line":"            \u0027time\u0027: start.strftime(\"%Y-%m-%d-%H:%M:%S\"),"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_7457d157","line":47,"updated":"2017-02-15 21:15:44.000000000","message":"am i missing it, or do you not strip out everything coming up with \"0 KB\"?  That seems like a lot of noise that would be better stripped out","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b3d022abda1d710b03a08317475ebb4ff7221c24","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            )"},{"line_number":45,"context_line":"        else:"},{"line_number":46,"context_line":"            data \u003d \"no locked memory\""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # append timestamp"},{"line_number":49,"context_line":"        print \"%(time)s %(data)s\" % {"},{"line_number":50,"context_line":"            \u0027time\u0027: start.strftime(\"%Y-%m-%d-%H:%M:%S\"),"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_8a66dcea","line":47,"in_reply_to":"fa31d9ce_7457d157","updated":"2017-02-15 21:36:41.000000000","message":"I do strip it in line 33.","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"b61dba5f861f0e985da5182fe76da0acaddc9ab3","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # but keep timing between iterations independent of system load"},{"line_number":56,"context_line":"        iter_time \u003d (datetime.datetime.utcnow() - start).total_seconds()"},{"line_number":57,"context_line":"        time_to_sleep \u003d 30 - iter_time"},{"line_number":58,"context_line":"        time.sleep(time_to_sleep)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"if __name__ \u003d\u003d \"__main__\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_94a1a596","line":58,"updated":"2017-02-15 21:15:44.000000000","message":"i think you probably want a min(time_to_sleep, 10) or something to avoid this raising an exception if the loop takes \u003e 30s\n\nwhich seems unlikely, but we did something similar in diskimage builder and on big systems with lots of stuff happening the loop started blowing out when you had to fork each time","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c2e5aa86cf81b3c9a2a5f54191e3a899cb17edfb","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # but keep timing between iterations independent of system load"},{"line_number":56,"context_line":"        iter_time \u003d (datetime.datetime.utcnow() - start).total_seconds()"},{"line_number":57,"context_line":"        time_to_sleep \u003d 30 - iter_time"},{"line_number":58,"context_line":"        time.sleep(time_to_sleep)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"if __name__ \u003d\u003d \"__main__\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_ff0372bc","line":58,"in_reply_to":"fa31d9ce_4aa7840a","updated":"2017-02-16 17:01:23.000000000","message":"Done","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b3d022abda1d710b03a08317475ebb4ff7221c24","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        # but keep timing between iterations independent of system load"},{"line_number":56,"context_line":"        iter_time \u003d (datetime.datetime.utcnow() - start).total_seconds()"},{"line_number":57,"context_line":"        time_to_sleep \u003d 30 - iter_time"},{"line_number":58,"context_line":"        time.sleep(time_to_sleep)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"if __name__ \u003d\u003d \"__main__\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa31d9ce_4aa7840a","line":58,"in_reply_to":"fa31d9ce_94a1a596","updated":"2017-02-15 21:36:41.000000000","message":"Makes sense, will do.","commit_id":"8f953456cf3594ad9ed6b643a2eda32aafbd1e37"}]}
