{"action":"created","issue":{"url":"https://api.github.com/repos/namhyung/uftrace/issues/183","repository_url":"https://api.github.com/repos/namhyung/uftrace","labels_url":"https://api.github.com/repos/namhyung/uftrace/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/namhyung/uftrace/issues/183/comments","events_url":"https://api.github.com/repos/namhyung/uftrace/issues/183/events","html_url":"https://github.com/namhyung/uftrace/issues/183","id":267062580,"number":183,"title":"dump chrome: JSON parsing error about cpython trace json file","user":{"login":"Taeung","id":3875235,"avatar_url":"https://avatars0.githubusercontent.com/u/3875235?v=4","gravatar_id":"","url":"https://api.github.com/users/Taeung","html_url":"https://github.com/Taeung","followers_url":"https://api.github.com/users/Taeung/followers","following_url":"https://api.github.com/users/Taeung/following{/other_user}","gists_url":"https://api.github.com/users/Taeung/gists{/gist_id}","starred_url":"https://api.github.com/users/Taeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taeung/subscriptions","organizations_url":"https://api.github.com/users/Taeung/orgs","repos_url":"https://api.github.com/users/Taeung/repos","events_url":"https://api.github.com/users/Taeung/events{/privacy}","received_events_url":"https://api.github.com/users/Taeung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-10-20T04:46:07Z","updated_at":"2017-11-26T15:48:07Z","closed_at":null,"author_association":"COLLABORATOR","body":"Hi,\r\n\r\nI found JSON parsing error like below on `chrome://tracing` when loading a json file dumped from cpython trace data.\r\nBut I'm not sure it is a uftrace's problem. Can you check  [py_hello.json.zip](https://github.com/namhyung/uftrace/files/1400796/py_hello.json.zip) ?\r\n\r\n```\r\nWhile importing:\r\nSyntaxError: Unexpected token h in JSON at position 956\r\n    at JSON.parse (<anonymous>)\r\n    at new TraceEventImporter (chrome://tracing/tracing.js:4876:19)\r\n    at Import.createImporter_ (chrome://tracing/tracing.js:1165:8)\r\n    at addImportStage (chrome://tracing/tracing.js:1159:167)\r\n    at Task.run (chrome://tracing/tracing.js:2207:95)\r\n    at runAnother (chrome://tracing/tracing.js:2210:371)\r\n    at runTask (chrome://tracing/tracing.js:2186:57)\r\n    at processIdleWork (chrome://tracing/tracing.js:2191:116)\r\n    at window.requestIdleCallback.timeout (chrome://tracing/tracing.js:2184:81)\r\n```\r\n\r\nI tested it like below:\r\n(recording, replaying and reporting is fine without any errors)\r\n```\r\n$ ./python --version\r\nPython 3.6.2\r\n\r\n$ uftrace record -D 4 -t 1ms ./python -c 'print(\"hello\")'\r\n\r\n$ uftrace dump --chrome > py_hello.json\r\n\r\n$ uftrace info\r\n# system information\r\n# ==================\r\n# program version     : uftrace v0.8-59-g7181\r\n# recorded on         : Fri Oct 20 13:07:07 2017\r\n# cmdline             : uftrace record -D 4 -t 1ms ./python -c print(\"hello\") \r\n# cpu info            : Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz\r\n# number of cpus      : 4 / 4 (online / possible)\r\n# memory info         : 0.0 / 7.4 GB (free / total)\r\n# system load         : 0.36 / 0.31 / 0.36 (1 / 5 / 15 min)\r\n# kernel version      : Linux 4.5.0-rc4+\r\n# hostname            : taeung-ThinkPad-X1-Carbon-3rd\r\n# distro              : \"Ubuntu 16.04.3 LTS\"\r\n#\r\n# process information\r\n# ===================\r\n# number of tasks     : 1\r\n# task list           : 7290\r\n# exe image           : /home/taeung/git/opensource/cpython/python\r\n# exit status         : exited with code: 0\r\n# elapsed time        : 0.068235585 sec\r\n# cpu time            : 0.008 / 0.048 sec (sys / user)\r\n# context switch      : 50 / 2 (voluntary / involuntary)\r\n# max rss             : 9684 KB\r\n# page fault          : 27 / 1247 (major / minor)\r\n# disk iops           : 6512 / 16 (read / write)\r\n\r\n```\r\n( In addition, the Nmap case hasn't any problems testing `chrome://tracing` with dumped json file)"},"comment":{"url":"https://api.github.com/repos/namhyung/uftrace/issues/comments/347017789","html_url":"https://github.com/namhyung/uftrace/issues/183#issuecomment-347017789","issue_url":"https://api.github.com/repos/namhyung/uftrace/issues/183","id":347017789,"user":{"login":"Taeung","id":3875235,"avatar_url":"https://avatars0.githubusercontent.com/u/3875235?v=4","gravatar_id":"","url":"https://api.github.com/users/Taeung","html_url":"https://github.com/Taeung","followers_url":"https://api.github.com/users/Taeung/followers","following_url":"https://api.github.com/users/Taeung/following{/other_user}","gists_url":"https://api.github.com/users/Taeung/gists{/gist_id}","starred_url":"https://api.github.com/users/Taeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taeung/subscriptions","organizations_url":"https://api.github.com/users/Taeung/orgs","repos_url":"https://api.github.com/users/Taeung/repos","events_url":"https://api.github.com/users/Taeung/events{/privacy}","received_events_url":"https://api.github.com/users/Taeung/received_events","type":"User","site_admin":false},"created_at":"2017-11-26T15:48:07Z","updated_at":"2017-11-26T15:48:07Z","author_association":"COLLABORATOR","body":"Sorry really for late response..\r\n\r\nI found the trivial warnings:\r\n```\r\n/home/taeung/git/uftrace/cmd-info.c: In function ‘fill_cmdline’:\r\n/home/taeung/git/uftrace/cmd-info.c:271:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]\r\n  write(fha->fd, \"cmdline:\", 8);\r\n  ^\r\n/home/taeung/git/uftrace/cmd-info.c:272:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]\r\n  write(fha->fd, p, k+1);\r\n  ^\r\n\r\n```"}}
{"actor":{"display_login":"Taeung"}}