Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755474AbbFMBiW (ORCPT ); Fri, 12 Jun 2015 21:38:22 -0400 Received: from mail4.hitachi.co.jp ([133.145.228.5]:50636 "EHLO mail4.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbbFMBiV (ORCPT ); Fri, 12 Jun 2015 21:38:21 -0400 Message-ID: <557B8986.2020905@hitachi.com> Date: Sat, 13 Jun 2015 10:38:14 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo , Alexei Starovoitov CC: David Ahern , Jiri Olsa , Namhyung Kim , Ingo Molnar , Linux Kernel Mailing List Subject: Re: perf probe and structs References: <20150612192716.GE6850@kernel.org> In-Reply-To: <20150612192716.GE6850@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2414 Lines: 77 On 2015/06/13 4:27, Arnaldo Carvalho de Melo wrote: > Hi Masami, > > I tried somethig with perf probe today, namely to ask for a > variable that is a struct perf_event_attr to be collected after > the perf_event_open syscall copies it from userspace, and got this > message: > > [root@zoo ~]# perf probe SYSC_perf_event_open:23 args > Failed to find 'args' in this function. > Error: Failed to add events. > [root@zoo ~]# > > Ok, I guess it should be instead: > > [root@zoo ~]# perf probe SYSC_perf_event_open:23 args > The 'args' variable is a struct, this is not supported yet. > Error: Failed to add events. > [root@zoo ~]# > > :-) Hmm, I need to look into it. BTW, could you tried to run `perf probe --vars SYSC_perf_event_open:23` ? > > That said, can't we just go ahead and collect sizeof(args) into the > buffer and let userspace cast the result to the right type, etc, i.e. > kinda like what is done now for a string. I'd like to add dump data struct feature instead of dumping binary. Or, at least suggesting which field you can specify :) Thank you, > > Alexei, is this already possible with eBPF? > > This is all in the context of: > > [root@zoo ~]# perf trace -e perf_event_open & > [1] 20775 > [root@zoo ~]# perf stat -e cycles usleep 1 > 7304.425 ( 0.519 ms): perf/20776 perf_event_open(attr_uptr: 0x222b220, pid: 20777, cpu: -1, group_fd: -1, flags: FD_CLOEXEC) = 3 > > Performance counter stats for 'usleep 1': > > 2,024,026 cycles > > 0.005277428 seconds time elapsed > > [root@zoo ~]# > > I want to decode that attr_uptr thing :-) > > - Arnaldo > -- > 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/ > -- 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/