{"action":"closed","number":677,"pull_request":{"url":"https://api.github.com/repos/iovisor/bcc/pulls/677","id":82974091,"html_url":"https://github.com/iovisor/bcc/pull/677","diff_url":"https://github.com/iovisor/bcc/pull/677.diff","patch_url":"https://github.com/iovisor/bcc/pull/677.patch","issue_url":"https://api.github.com/repos/iovisor/bcc/issues/677","number":677,"state":"closed","locked":false,"title":"fileslower: use de->d_name.name, add filtering","user":{"login":"markdrayton","id":26722,"avatar_url":"https://avatars.githubusercontent.com/u/26722?v=3","gravatar_id":"","url":"https://api.github.com/users/markdrayton","html_url":"https://github.com/markdrayton","followers_url":"https://api.github.com/users/markdrayton/followers","following_url":"https://api.github.com/users/markdrayton/following{/other_user}","gists_url":"https://api.github.com/users/markdrayton/gists{/gist_id}","starred_url":"https://api.github.com/users/markdrayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markdrayton/subscriptions","organizations_url":"https://api.github.com/users/markdrayton/orgs","repos_url":"https://api.github.com/users/markdrayton/repos","events_url":"https://api.github.com/users/markdrayton/events{/privacy}","received_events_url":"https://api.github.com/users/markdrayton/received_events","type":"User","site_admin":false},"body":"I think this PR goes some way towards solving #609 by reading `de->d_name.name` instead of `de->d_iname`.\r\n\r\nIn my experience the current fileslower.py prints a lot of lines for the file `TCPv6`. I dug into this and many of these reads are actually for regular disk files, not TCP sockets. I'm not quite sure what's going on but my guess is that TCP dentries get reused for regular file dentries and the short name (`d_iname`) isn't destroyed, leading to a misleading attribution in fileslower.py. This PR switches to reading `de->d_name.name`, which AFAICT is the source of truth (it either points to external storage for long file names or `d_iname` for short names; http://lxr.free-electrons.com/source/fs/dcache.c#L1638).\r\n\r\nOther fixes:\r\n\r\n* by default, only show regular files. Add a `-a` option to show all files (sockets, FIFOs, etc)\r\n* make `-p` match process IDs instead of thread IDs\r\n* remove unused signal handling code\r\n* indicate when a name was longer than the 32 byte buffer by replacing the last 3 chars with `...` (fits within 80 chars assuming `comm` and `bytes` don't overflow)\r\n\r\nE.g.\r\n\r\n```\r\n$ ./tools/fileslower.py \r\nTracing sync read/writes slower than 1 ms\r\nTIME(s)  COMM           TID    D BYTES   LAT(ms) FILENAME\r\n1.790    dd             3843   W 8192       1.33 paddingpaddingpaddingpadding...\r\n```","created_at":"2016-08-27T01:48:38Z","updated_at":"2016-08-30T19:18:58Z","closed_at":"2016-08-30T19:18:58Z","merged_at":"2016-08-30T19:18:57Z","merge_commit_sha":"4c2b5388f8d685a127a4d757c254a380e0aa915c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/iovisor/bcc/pulls/677/commits","review_comments_url":"https://api.github.com/repos/iovisor/bcc/pulls/677/comments","review_comment_url":"https://api.github.com/repos/iovisor/bcc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iovisor/bcc/issues/677/comments","statuses_url":"https://api.github.com/repos/iovisor/bcc/statuses/74347318d9fc303e3f7a65d5d1e15deaeacb07af","head":{"label":"markdrayton:fileslower","ref":"fileslower","sha":"74347318d9fc303e3f7a65d5d1e15deaeacb07af","user":{"login":"markdrayton","id":26722,"avatar_url":"https://avatars.githubusercontent.com/u/26722?v=3","gravatar_id":"","url":"https://api.github.com/users/markdrayton","html_url":"https://github.com/markdrayton","followers_url":"https://api.github.com/users/markdrayton/followers","following_url":"https://api.github.com/users/markdrayton/following{/other_user}","gists_url":"https://api.github.com/users/markdrayton/gists{/gist_id}","starred_url":"https://api.github.com/users/markdrayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markdrayton/subscriptions","organizations_url":"https://api.github.com/users/markdrayton/orgs","repos_url":"https://api.github.com/users/markdrayton/repos","events_url":"https://api.github.com/users/markdrayton/events{/privacy}","received_events_url":"https://api.github.com/users/markdrayton/received_events","type":"User","site_admin":false},"repo":{"id":53119447,"name":"bcc","full_name":"markdrayton/bcc","owner":{"login":"markdrayton","id":26722,"avatar_url":"https://avatars.githubusercontent.com/u/26722?v=3","gravatar_id":"","url":"https://api.github.com/users/markdrayton","html_url":"https://github.com/markdrayton","followers_url":"https://api.github.com/users/markdrayton/followers","following_url":"https://api.github.com/users/markdrayton/following{/other_user}","gists_url":"https://api.github.com/users/markdrayton/gists{/gist_id}","starred_url":"https://api.github.com/users/markdrayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markdrayton/subscriptions","organizations_url":"https://api.github.com/users/markdrayton/orgs","repos_url":"https://api.github.com/users/markdrayton/repos","events_url":"https://api.github.com/users/markdrayton/events{/privacy}","received_events_url":"https://api.github.com/users/markdrayton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markdrayton/bcc","description":"BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more","fork":true,"url":"https://api.github.com/repos/markdrayton/bcc","forks_url":"https://api.github.com/repos/markdrayton/bcc/forks","keys_url":"https://api.github.com/repos/markdrayton/bcc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markdrayton/bcc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markdrayton/bcc/teams","hooks_url":"https://api.github.com/repos/markdrayton/bcc/hooks","issue_events_url":"https://api.github.com/repos/markdrayton/bcc/issues/events{/number}","events_url":"https://api.github.com/repos/markdrayton/bcc/events","assignees_url":"https://api.github.com/repos/markdrayton/bcc/assignees{/user}","branches_url":"https://api.github.com/repos/markdrayton/bcc/branches{/branch}","tags_url":"https://api.github.com/repos/markdrayton/bcc/tags","blobs_url":"https://api.github.com/repos/markdrayton/bcc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markdrayton/bcc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markdrayton/bcc/git/refs{/sha}","trees_url":"https://api.github.com/repos/markdrayton/bcc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markdrayton/bcc/statuses/{sha}","languages_url":"https://api.github.com/repos/markdrayton/bcc/languages","stargazers_url":"https://api.github.com/repos/markdrayton/bcc/stargazers","contributors_url":"https://api.github.com/repos/markdrayton/bcc/contributors","subscribers_url":"https://api.github.com/repos/markdrayton/bcc/subscribers","subscription_url":"https://api.github.com/repos/markdrayton/bcc/subscription","commits_url":"https://api.github.com/repos/markdrayton/bcc/commits{/sha}","git_commits_url":"https://api.github.com/repos/markdrayton/bcc/git/commits{/sha}","comments_url":"https://api.github.com/repos/markdrayton/bcc/comments{/number}","issue_comment_url":"https://api.github.com/repos/markdrayton/bcc/issues/comments{/number}","contents_url":"https://api.github.com/repos/markdrayton/bcc/contents/{+path}","compare_url":"https://api.github.com/repos/markdrayton/bcc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markdrayton/bcc/merges","archive_url":"https://api.github.com/repos/markdrayton/bcc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markdrayton/bcc/downloads","issues_url":"https://api.github.com/repos/markdrayton/bcc/issues{/number}","pulls_url":"https://api.github.com/repos/markdrayton/bcc/pulls{/number}","milestones_url":"https://api.github.com/repos/markdrayton/bcc/milestones{/number}","notifications_url":"https://api.github.com/repos/markdrayton/bcc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markdrayton/bcc/labels{/name}","releases_url":"https://api.github.com/repos/markdrayton/bcc/releases{/id}","deployments_url":"https://api.github.com/repos/markdrayton/bcc/deployments","created_at":"2016-03-04T08:19:53Z","updated_at":"2016-04-30T17:20:55Z","pushed_at":"2016-08-29T13:20:35Z","git_url":"git://github.com/markdrayton/bcc.git","ssh_url":"git@github.com:markdrayton/bcc.git","clone_url":"https://github.com/markdrayton/bcc.git","svn_url":"https://github.com/markdrayton/bcc","homepage":"","size":2992,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"iovisor:master","ref":"master","sha":"4ebb7cf1e23d64f72777ce80e398786ad08ef21b","user":{"login":"iovisor","id":12766186,"avatar_url":"https://avatars.githubusercontent.com/u/12766186?v=3","gravatar_id":"","url":"https://api.github.com/users/iovisor","html_url":"https://github.com/iovisor","followers_url":"https://api.github.com/users/iovisor/followers","following_url":"https://api.github.com/users/iovisor/following{/other_user}","gists_url":"https://api.github.com/users/iovisor/gists{/gist_id}","starred_url":"https://api.github.com/users/iovisor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iovisor/subscriptions","organizations_url":"https://api.github.com/users/iovisor/orgs","repos_url":"https://api.github.com/users/iovisor/repos","events_url":"https://api.github.com/users/iovisor/events{/privacy}","received_events_url":"https://api.github.com/users/iovisor/received_events","type":"Organization","site_admin":false},"repo":{"id":34921116,"name":"bcc","full_name":"iovisor/bcc","owner":{"login":"iovisor","id":12766186,"avatar_url":"https://avatars.githubusercontent.com/u/12766186?v=3","gravatar_id":"","url":"https://api.github.com/users/iovisor","html_url":"https://github.com/iovisor","followers_url":"https://api.github.com/users/iovisor/followers","following_url":"https://api.github.com/users/iovisor/following{/other_user}","gists_url":"https://api.github.com/users/iovisor/gists{/gist_id}","starred_url":"https://api.github.com/users/iovisor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iovisor/subscriptions","organizations_url":"https://api.github.com/users/iovisor/orgs","repos_url":"https://api.github.com/users/iovisor/repos","events_url":"https://api.github.com/users/iovisor/events{/privacy}","received_events_url":"https://api.github.com/users/iovisor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iovisor/bcc","description":"BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more","fork":false,"url":"https://api.github.com/repos/iovisor/bcc","forks_url":"https://api.github.com/repos/iovisor/bcc/forks","keys_url":"https://api.github.com/repos/iovisor/bcc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iovisor/bcc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iovisor/bcc/teams","hooks_url":"https://api.github.com/repos/iovisor/bcc/hooks","issue_events_url":"https://api.github.com/repos/iovisor/bcc/issues/events{/number}","events_url":"https://api.github.com/repos/iovisor/bcc/events","assignees_url":"https://api.github.com/repos/iovisor/bcc/assignees{/user}","branches_url":"https://api.github.com/repos/iovisor/bcc/branches{/branch}","tags_url":"https://api.github.com/repos/iovisor/bcc/tags","blobs_url":"https://api.github.com/repos/iovisor/bcc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iovisor/bcc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iovisor/bcc/git/refs{/sha}","trees_url":"https://api.github.com/repos/iovisor/bcc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iovisor/bcc/statuses/{sha}","languages_url":"https://api.github.com/repos/iovisor/bcc/languages","stargazers_url":"https://api.github.com/repos/iovisor/bcc/stargazers","contributors_url":"https://api.github.com/repos/iovisor/bcc/contributors","subscribers_url":"https://api.github.com/repos/iovisor/bcc/subscribers","subscription_url":"https://api.github.com/repos/iovisor/bcc/subscription","commits_url":"https://api.github.com/repos/iovisor/bcc/commits{/sha}","git_commits_url":"https://api.github.com/repos/iovisor/bcc/git/commits{/sha}","comments_url":"https://api.github.com/repos/iovisor/bcc/comments{/number}","issue_comment_url":"https://api.github.com/repos/iovisor/bcc/issues/comments{/number}","contents_url":"https://api.github.com/repos/iovisor/bcc/contents/{+path}","compare_url":"https://api.github.com/repos/iovisor/bcc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iovisor/bcc/merges","archive_url":"https://api.github.com/repos/iovisor/bcc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iovisor/bcc/downloads","issues_url":"https://api.github.com/repos/iovisor/bcc/issues{/number}","pulls_url":"https://api.github.com/repos/iovisor/bcc/pulls{/number}","milestones_url":"https://api.github.com/repos/iovisor/bcc/milestones{/number}","notifications_url":"https://api.github.com/repos/iovisor/bcc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iovisor/bcc/labels{/name}","releases_url":"https://api.github.com/repos/iovisor/bcc/releases{/id}","deployments_url":"https://api.github.com/repos/iovisor/bcc/deployments","created_at":"2015-05-01T19:52:32Z","updated_at":"2016-08-30T16:40:09Z","pushed_at":"2016-08-30T19:18:57Z","git_url":"git://github.com/iovisor/bcc.git","ssh_url":"git@github.com:iovisor/bcc.git","clone_url":"https://github.com/iovisor/bcc.git","svn_url":"https://github.com/iovisor/bcc","homepage":"","size":3950,"stargazers_count":1549,"watchers_count":1549,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":185,"mirror_url":null,"open_issues_count":87,"forks":185,"open_issues":87,"watchers":1549,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/677"},"html":{"href":"https://github.com/iovisor/bcc/pull/677"},"issue":{"href":"https://api.github.com/repos/iovisor/bcc/issues/677"},"comments":{"href":"https://api.github.com/repos/iovisor/bcc/issues/677/comments"},"review_comments":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/677/comments"},"review_comment":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iovisor/bcc/pulls/677/commits"},"statuses":{"href":"https://api.github.com/repos/iovisor/bcc/statuses/74347318d9fc303e3f7a65d5d1e15deaeacb07af"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"brendangregg","id":1101211,"avatar_url":"https://avatars.githubusercontent.com/u/1101211?v=3","gravatar_id":"","url":"https://api.github.com/users/brendangregg","html_url":"https://github.com/brendangregg","followers_url":"https://api.github.com/users/brendangregg/followers","following_url":"https://api.github.com/users/brendangregg/following{/other_user}","gists_url":"https://api.github.com/users/brendangregg/gists{/gist_id}","starred_url":"https://api.github.com/users/brendangregg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendangregg/subscriptions","organizations_url":"https://api.github.com/users/brendangregg/orgs","repos_url":"https://api.github.com/users/brendangregg/repos","events_url":"https://api.github.com/users/brendangregg/events{/privacy}","received_events_url":"https://api.github.com/users/brendangregg/received_events","type":"User","site_admin":false},"comments":11,"review_comments":0,"commits":1,"additions":92,"deletions":55,"changed_files":6}}
{"actor":{"display_login":"brendangregg"}}