All of lore.kernel.org
 help / color / mirror / Atom feed
* perf probe -L sys_select or sys_poll
@ 2015-08-11 14:18 Arnaldo Carvalho de Melo
  2015-08-11 22:59 ` 平松雅巳 / HIRAMATU,MASAMI
  2015-08-12  0:49 ` 平松雅巳 / HIRAMATU,MASAMI
  0 siblings, 2 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-11 14:18 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: David Ahern, Jiri Olsa, Namhyung Kim, Linux Kernel Mailing List

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
  <SyS_select@/home/git/linux/fs/select.c:0>
      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
  <SyS_poll@/home/git/linux/fs/select.c:0>
      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
  <SyS_poll@/home/git/linux/fs/select.c:0>
      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 <SyS_poll>:
		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 <SyS_poll+0x90>
		  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 <poll_select_set_timeout>
			  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 <do_sys_poll>
  
	  if (ret == -EINTR) {
  ffffffff8122984d:	83 f8 fc             	cmp    $0xfffffffc,%eax
  ffffffff81229850:	74 5c                	je     ffffffff812298ae <SyS_poll+0xce>
		  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 <SyS_poll+0x119>
  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 <do_sys_poll>
  
	  if (ret == -EINTR) {
  ffffffff81229877:	83 f8 fc             	cmp    $0xfffffffc,%eax
  ffffffff8122987a:	75 d6                	jne    ffffffff81229852 <SyS_poll+0x72>
  
  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 = &current->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 <SyS_poll+0x72>
		  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 = &current->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 = &current->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 <SyS_poll+0x72>
		  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 <SyS_ppoll>:
		  ret = -ERESTART_RESTARTBLOCK;
	  }
	  return ret;
  }

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-08-13  8:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11 14:18 perf probe -L sys_select or sys_poll Arnaldo Carvalho de Melo
2015-08-11 22:59 ` 平松雅巳 / HIRAMATU,MASAMI
2015-08-12  0:49 ` 平松雅巳 / HIRAMATU,MASAMI
2015-08-12  1:24   ` [BUGFIX PATCH perf/core ] perf-probe: Fix to show lines of sys_ functions correctly Masami Hiramatsu
2015-08-12 13:23     ` Arnaldo Carvalho de Melo
2015-08-12 13:40       ` Arnaldo Carvalho de Melo
2015-08-12 21:37         ` 平松雅巳 / HIRAMATU,MASAMI
2015-08-13  8:06     ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.