Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933148AbbHLAtJ (ORCPT ); Tue, 11 Aug 2015 20:49:09 -0400 Received: from mail7.hitachi.co.jp ([133.145.228.42]:51916 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932485AbbHLAtI convert rfc822-to-8bit (ORCPT ); Tue, 11 Aug 2015 20:49:08 -0400 From: =?iso-2022-jp?B?GyRCSj8+PjJtTCYbKEIgLyBISVJBTUFUVRskQiEkGyhCTUFTQU1J?= To: "'Arnaldo Carvalho de Melo'" CC: David Ahern , Jiri Olsa , "Namhyung Kim" , Linux Kernel Mailing List Subject: RE: perf probe -L sys_select or sys_poll Thread-Topic: perf probe -L sys_select or sys_poll Thread-Index: AQHQ1ECcittBV1Lv1UiXAGfqTb4faJ4Hgqpw Date: Wed, 12 Aug 2015 00:49:04 +0000 Message-ID: <50399556C9727B4D88A595C8584AAB37524B434C@GSjpTKYDCembx32.service.hitachi.net> References: <20150811141827.GJ2521@kernel.org> In-Reply-To: <20150811141827.GJ2521@kernel.org> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.198.219.34] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2953 Lines: 87 > From: Arnaldo Carvalho de Melo [mailto:acme@kernel.org] > > 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 ~]# OK, I got what was wrong. I've ingestigated and found that SYSCALL_DEFINE macro is doing SYSCALL_DEFINE*(foo,...) { body; } is expanded as below (on debuginfo) static inline int SYSC_foo(...) { body; } int SyS_foo(...) <- is an alias of sys_foo. { return SYSC_foo(...); } "perf probe -L sys_foo" decodes SyS_foo function and it also skips inlined functions inside the target function because those functions are usually defined somewhere else. Thus, it shows only the first line of sys_foo. BTW, since SYSC_foo doesn't have no instance, "perf probe -L SYSC_foo" doesn't show anything. I think we can avoid this problem by checking whether the inlined function is defined at the same point of the target function definition. Thank you, -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu.pt@hitachi.com -- 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/