Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965168AbbHKOSf (ORCPT ); Tue, 11 Aug 2015 10:18:35 -0400 Received: from mail.kernel.org ([198.145.29.136]:37158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964890AbbHKOSe (ORCPT ); Tue, 11 Aug 2015 10:18:34 -0400 Date: Tue, 11 Aug 2015 11:18:27 -0300 From: Arnaldo Carvalho de Melo To: Masami Hiramatsu Cc: David Ahern , Jiri Olsa , Namhyung Kim , Linux Kernel Mailing List Subject: perf probe -L sys_select or sys_poll Message-ID: <20150811141827.GJ2521@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10922 Lines: 278 Hi Masami, Have you noticed that sys_select or sys_poll stops after the first few lines? Please let me know if you need more info than is below. [root@zoo ~]# perf probe -L sys_select 0 SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp, fd_set __user *, exp, struct timeval __user *, tvp) { struct timespec end_time, *to = NULL; [root@zoo ~]# perf probe -L sys_poll 0 SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs) { struct timespec end_time, *to = NULL; [root@zoo ~]# I haven't investigated it too much, if there is some trouble that makes 'perf probe -L' to stop like that maybe we should warn the user somehow? Using -v didn't helped that much: [root@zoo ~]# perf probe -v -L sys_poll Using /root/.debug/.build-id/a8/26726b5ddacfab1f0bade868f1a7924f6b20c4 for symbols Open Debuginfo file: /root/.debug/.build-id/a8/26726b5ddacfab1f0bade868f1a7924f6b20c4 path: (null) Symbol sys_poll address found : ffffffff812297e0 fname: /home/git/linux/fs/select.c, lineno:957 New line range: 957 to 2147483647 path: /home/git/linux/fs/select.c 0 SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout_msecs) { struct timespec end_time, *to = NULL; [root@zoo ~]# [acme@zoo linux]$ cat /etc/fedora-release Fedora release 21 (Twenty One) [acme@zoo linux]$ rpm -q elfutils elfutils-0.163-1.fc21.x86_64 [acme@zoo linux]$ [acme@zoo linux]$ uname -a Linux zoo 4.2.0-rc5+ #1 SMP Tue Aug 4 16:55:11 BRT 2015 x86_64 x86_64 x86_64 GNU/Linux objdump --start-address=0xffffffff812297e0 -dS /root/.debug/.build-id/a8/26726b5ddacfab1f0bade868f1a7924f6b20c4 | less /root/.debug/.build-id/a8/26726b5ddacfab1f0bade868f1a7924f6b20c4: file format elf64-x86-64 Disassembly of section .text: ffffffff812297e0 : ret = -ERESTART_RESTARTBLOCK; } return ret; } SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, ffffffff812297e0: e8 4b af 53 00 callq ffffffff81764730 <__fentry__> ffffffff812297e5: 55 push %rbp ffffffff812297e6: 48 89 d1 mov %rdx,%rcx ffffffff812297e9: 48 89 e5 mov %rsp,%rbp ffffffff812297ec: 41 54 push %r12 ffffffff812297ee: 53 push %rbx ffffffff812297ef: 49 89 fc mov %rdi,%r12 ffffffff812297f2: 48 89 f3 mov %rsi,%rbx ffffffff812297f5: 48 83 ec 20 sub $0x20,%rsp ffffffff812297f9: 65 48 8b 04 25 28 00 mov %gs:0x28,%rax ffffffff81229800: 00 00 ffffffff81229802: 48 89 45 e8 mov %rax,-0x18(%rbp) ffffffff81229806: 31 c0 xor %eax,%eax int, timeout_msecs) { struct timespec end_time, *to = NULL; int ret; if (timeout_msecs >= 0) { ffffffff81229808: 85 d2 test %edx,%edx ffffffff8122980a: 78 64 js ffffffff81229870 to = &end_time; poll_select_set_timeout(to, timeout_msecs / MSEC_PER_SEC, NSEC_PER_MSEC * (timeout_msecs % MSEC_PER_SEC)); ffffffff8122980c: 89 c8 mov %ecx,%eax ffffffff8122980e: ba d3 4d 62 10 mov $0x10624dd3,%edx struct timespec end_time, *to = NULL; int ret; if (timeout_msecs >= 0) { to = &end_time; poll_select_set_timeout(to, timeout_msecs / MSEC_PER_SEC, ffffffff81229813: 48 8d 7d d8 lea -0x28(%rbp),%rdi NSEC_PER_MSEC * (timeout_msecs % MSEC_PER_SEC)); ffffffff81229817: f7 ea imul %edx ffffffff81229819: 89 c8 mov %ecx,%eax ffffffff8122981b: c1 f8 1f sar $0x1f,%eax ffffffff8122981e: c1 fa 06 sar $0x6,%edx ffffffff81229821: 89 d6 mov %edx,%esi ffffffff81229823: 29 c6 sub %eax,%esi ffffffff81229825: 69 c6 e8 03 00 00 imul $0x3e8,%esi,%eax struct timespec end_time, *to = NULL; int ret; if (timeout_msecs >= 0) { to = &end_time; poll_select_set_timeout(to, timeout_msecs / MSEC_PER_SEC, ffffffff8122982b: 48 63 f6 movslq %esi,%rsi NSEC_PER_MSEC * (timeout_msecs % MSEC_PER_SEC)); ffffffff8122982e: 29 c1 sub %eax,%ecx ffffffff81229830: 48 63 c9 movslq %ecx,%rcx struct timespec end_time, *to = NULL; int ret; if (timeout_msecs >= 0) { to = &end_time; poll_select_set_timeout(to, timeout_msecs / MSEC_PER_SEC, ffffffff81229833: 48 69 d1 40 42 0f 00 imul $0xf4240,%rcx,%rdx ffffffff8122983a: e8 21 eb ff ff callq ffffffff81228360 NSEC_PER_MSEC * (timeout_msecs % MSEC_PER_SEC)); } ret = do_sys_poll(ufds, nfds, to); ffffffff8122983f: 48 8d 55 d8 lea -0x28(%rbp),%rdx ffffffff81229843: 89 de mov %ebx,%esi ffffffff81229845: 4c 89 e7 mov %r12,%rdi ffffffff81229848: e8 73 f9 ff ff callq ffffffff812291c0 if (ret == -EINTR) { ffffffff8122984d: 83 f8 fc cmp $0xfffffffc,%eax ffffffff81229850: 74 5c je ffffffff812298ae ret = -ERESTART_RESTARTBLOCK; } return ret; } SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, ffffffff81229852: 48 8b 5d e8 mov -0x18(%rbp),%rbx ffffffff81229856: 65 48 33 1c 25 28 00 xor %gs:0x28,%rbx ffffffff8122985d: 00 00 } else restart_block->poll.has_timeout = 0; ret = -ERESTART_RESTARTBLOCK; } return ret; ffffffff8122985f: 48 98 cltq ret = -ERESTART_RESTARTBLOCK; } return ret; } SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, ffffffff81229861: 0f 85 92 00 00 00 jne ffffffff812298f9 ffffffff81229867: 48 83 c4 20 add $0x20,%rsp ffffffff8122986b: 5b pop %rbx ffffffff8122986c: 41 5c pop %r12 ffffffff8122986e: 5d pop %rbp ffffffff8122986f: c3 retq to = &end_time; poll_select_set_timeout(to, timeout_msecs / MSEC_PER_SEC, NSEC_PER_MSEC * (timeout_msecs % MSEC_PER_SEC)); } ret = do_sys_poll(ufds, nfds, to); ffffffff81229870: 31 d2 xor %edx,%edx ffffffff81229872: e8 49 f9 ff ff callq ffffffff812291c0 if (ret == -EINTR) { ffffffff81229877: 83 f8 fc cmp $0xfffffffc,%eax ffffffff8122987a: 75 d6 jne ffffffff81229852 DECLARE_PER_CPU(struct task_struct *, current_task); static __always_inline struct task_struct *get_current(void) { return this_cpu_read_stable(current_task); ffffffff8122987c: 65 48 8b 04 25 40 b9 mov %gs:0xb940,%rax ffffffff81229883: 00 00 struct restart_block *restart_block; restart_block = ¤t->restart_block; restart_block->fn = do_restart_poll; ffffffff81229885: 48 c7 80 58 03 00 00 movq $0xffffffff81229760,0x358(%rax) ffffffff8122988c: 60 97 22 81 restart_block->poll.ufds = ufds; ffffffff81229890: 4c 89 a0 60 03 00 00 mov %r12,0x360(%rax) restart_block->poll.nfds = nfds; ffffffff81229897: 89 98 68 03 00 00 mov %ebx,0x368(%rax) if (timeout_msecs >= 0) { restart_block->poll.tv_sec = end_time.tv_sec; restart_block->poll.tv_nsec = end_time.tv_nsec; restart_block->poll.has_timeout = 1; } else restart_block->poll.has_timeout = 0; ffffffff8122989d: c7 80 6c 03 00 00 00 movl $0x0,0x36c(%rax) ffffffff812298a4: 00 00 00 ret = -ERESTART_RESTARTBLOCK; ffffffff812298a7: b8 fc fd ff ff mov $0xfffffdfc,%eax ffffffff812298ac: eb a4 jmp ffffffff81229852 restart_block->fn = do_restart_poll; restart_block->poll.ufds = ufds; restart_block->poll.nfds = nfds; if (timeout_msecs >= 0) { restart_block->poll.tv_sec = end_time.tv_sec; ffffffff812298ae: 48 8b 55 d8 mov -0x28(%rbp),%rdx ffffffff812298b2: 65 48 8b 04 25 40 b9 mov %gs:0xb940,%rax ffffffff812298b9: 00 00 if (ret == -EINTR) { struct restart_block *restart_block; restart_block = ¤t->restart_block; restart_block->fn = do_restart_poll; ffffffff812298bb: 48 c7 80 58 03 00 00 movq $0xffffffff81229760,0x358(%rax) ffffffff812298c2: 60 97 22 81 restart_block->poll.ufds = ufds; ffffffff812298c6: 4c 89 a0 60 03 00 00 mov %r12,0x360(%rax) restart_block->poll.nfds = nfds; if (timeout_msecs >= 0) { restart_block->poll.tv_sec = end_time.tv_sec; ffffffff812298cd: 48 89 90 70 03 00 00 mov %rdx,0x370(%rax) restart_block->poll.tv_nsec = end_time.tv_nsec; ffffffff812298d4: 48 8b 55 e0 mov -0x20(%rbp),%rdx struct restart_block *restart_block; restart_block = ¤t->restart_block; restart_block->fn = do_restart_poll; restart_block->poll.ufds = ufds; restart_block->poll.nfds = nfds; ffffffff812298d8: 89 98 68 03 00 00 mov %ebx,0x368(%rax) if (timeout_msecs >= 0) { restart_block->poll.tv_sec = end_time.tv_sec; restart_block->poll.tv_nsec = end_time.tv_nsec; restart_block->poll.has_timeout = 1; ffffffff812298de: c7 80 6c 03 00 00 01 movl $0x1,0x36c(%rax) ffffffff812298e5: 00 00 00 restart_block->poll.ufds = ufds; restart_block->poll.nfds = nfds; if (timeout_msecs >= 0) { restart_block->poll.tv_sec = end_time.tv_sec; restart_block->poll.tv_nsec = end_time.tv_nsec; ffffffff812298e8: 48 89 90 78 03 00 00 mov %rdx,0x378(%rax) restart_block->poll.has_timeout = 1; } else restart_block->poll.has_timeout = 0; ret = -ERESTART_RESTARTBLOCK; ffffffff812298ef: b8 fc fd ff ff mov $0xfffffdfc,%eax ffffffff812298f4: e9 59 ff ff ff jmpq ffffffff81229852 ret = -ERESTART_RESTARTBLOCK; } return ret; } SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, ffffffff812298f9: e8 02 0d e7 ff callq ffffffff8109a600 <__stack_chk_fail> ffffffff812298fe: 66 90 xchg %ax,%ax ffffffff81229900 : ret = -ERESTART_RESTARTBLOCK; } return ret; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/