Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753006AbbBZE5v (ORCPT ); Wed, 25 Feb 2015 23:57:51 -0500 Received: from mail9.hitachi.co.jp ([133.145.228.44]:55186 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752880AbbBZE5u (ORCPT ); Wed, 25 Feb 2015 23:57:50 -0500 Message-ID: <54EEA7C6.3050104@hitachi.com> Date: Thu, 26 Feb 2015 13:57:42 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo Cc: Linux Kernel Mailing List , Jiri Olsa , David Ahern Subject: Re: Trying to use 'perf probe' to debug perf itself References: <20150224184947.GF25009@kernel.org> <54ED391C.2020808@hitachi.com> <20150225132502.GC11858@kernel.org> In-Reply-To: <20150225132502.GC11858@kernel.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2790 Lines: 88 (2015/02/25 22:25), Arnaldo Carvalho de Melo wrote: > Em Wed, Feb 25, 2015 at 11:53:16AM +0900, Masami Hiramatsu escreveu: >> (2015/02/25 3:49), Arnaldo Carvalho de Melo wrote: >>> Available variables at thread__get >>> @ >>> struct thread* thread >>> [root@ssdandy ~]# > >>> cool, so I thought it would be just a matter of asking to put the probes >>> and get the value of 'thread', then match things, but: > >>> [root@ssdandy ~]# perf probe -v ~/bin/perf thread__put thread > >>> Writing event: p:probe_perf/thread__put /root/bin/perf:0xd03d2 thread=-32(%sp):u64 >>> Failed to write event: Invalid argument >>> Error: Failed to add events. Reason: Invalid argument (Code: -22) >>> [root@ssdandy ~]# > >>> Not possible :-\ > >> Hmm, strange. Could you tell me the version of your kernel? > > [root@ssdandy ~]# uname -r > 3.10.0-210.el7.x86_64 > >> It seems that the kernel newer than 3.14 supports uprobes with >> memory dereference (e.g. -32(%sp) )feature. > > Right, that must be the case, will test, but then, would it be possible > for the kernel, in such cases, return something line EOPNOTSUP? Yeah, but for now, it is already supported in kernel. Of cause we can try to test feature with adding temporary event from perftools too. > I will try to figure out a better error message on the tooling side, > something like: > > . Realize we're asking for memory dereference in uprobes > . If it fails with EINVAL, check the kernel version and say something > like: > > Please upgrade your kernel to at least x.y.z to have access to feature > FOO_BAR. OK, it may be worth for users (I'm not sure RHEL can update their kernel to include that enhancement) Thank you, > > - Arnaldo > >> (it was actually introduced by 5baaa59e, and git-describe told >> it was v3.13-rc4-22-g5baaa59) >> >> And also, could you try to write the result command to uprobe_event as >> below? >> >> # echo "p:probe_perf/thread__put /root/bin/perf:0xd03d2 thread=-32(%sp):u64" >> \ >> /sys/kernel/debug/tracing/uprobe_events > > Well, I'll try that if it fails after I upgrade to 3.14. > >>> please let me know if you need some file, here is the readelf -wi for >>> those two routines: >> >> This should not be the problem of dwarf-analysis. It seems kernel-side >> (uprobe) problem. > > Thanks a lot! > > - Arnaldo > -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory 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/