From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu Subject: Re: trace_printk() support in trace-cmd Date: Thu, 16 Dec 2010 22:36:19 +0900 Message-ID: <4D0A15D3.5020806@hitachi.com> References: <4CE16941.3080008@redhat.com> <1289920433.30543.5.camel@gandalf.stny.rr.com> <4CEB9FCE.9020108@redhat.com> <1290522640.30543.306.camel@gandalf.stny.rr.com> <4CEBD1AE.7000203@redhat.com> <1290527132.30543.372.camel@gandalf.stny.rr.com> <4D04F9CC.3060908@redhat.com> <20101212173623.GB2478@ghostprotocols.net> <4D05096E.6000003@redhat.com> <20101212174317.GC2478@ghostprotocols.net> <4D050AB3.7070604@redhat.com> <4D06016D.60302@hitachi.com> <4D09E7DB.5060801@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Arnaldo Carvalho de Melo , Steven Rostedt , linux-trace-users@vger.kernel.org, KVM list To: Avi Kivity Return-path: In-Reply-To: <4D09E7DB.5060801@redhat.com> Sender: linux-trace-users-owner@vger.kernel.org List-Id: kvm.vger.kernel.org (2010/12/16 19:20), Avi Kivity wrote: > On 12/13/2010 01:20 PM, Masami Hiramatsu wrote: >> (2010/12/13 2:47), Avi Kivity wrote: >> > On 12/12/2010 07:43 PM, Arnaldo Carvalho de Melo wrote: >> >> Em Sun, Dec 12, 2010 at 07:42:06PM +0200, Avi Kivity escreveu: >> >> > On 12/12/2010 07:36 PM, Arnaldo Carvalho de Melo wrote: >> >> > >Em Sun, Dec 12, 2010 at 06:35:24PM +0200, Avi Kivity escreveu: >> >> > >> On 11/23/2010 05:45 PM, Steven Rostedt wrote: >> >> > >> >Again, the work around is to replace your trace_printks() with >> >> > >> >__trace_printk(_THIS_IP_, ...) or just modify the trace_printk() macro >> >> > >> >in include/linux/kernel.h to always use the __trace_printk() version. >> >> > >> >> >> > >> This works; I'm using it for now (I tried to use 'perf probe', but I >> >> > >> get unpredictable results, like null pointer derefs). >> >> > > >> >> > >Can you tell us which functions, environment, etc? >> >> > >> >> > Something around 2.6.27-rc4; example functions are FNAME(fetch) in >> >> > arch/x86/kvm/paging_tmpl.h; compiled modular (which was Steven's >> >> > guess as to why it fails). >> >> > >> >> > (note, the failure is with trace-cmd, not /sys/kernel/debug/tracing). >> >> >> >> I mean the "I tried to use 'perf probe'" part. >> > >> > Well, same, more or less. >> > >> > perf probe -m kvm --add 'fetch_access=paging64_fetch pt_access=gw->pt_access pte_access=gw->pte_access dirty' >> > >> > would return garbage for gw->*, and the log would show the exception handler called. gw is most certainly valid. >> > >> >> Thank you for reporting. >> Hmm, actually, pagefaults could happen on fetching variables. But >> fetching argument routines should handle it... > > They did handle it (or so I understood from the logs). But they shouldn't have > occured in the first place, since gw was dereferenceable (and the function dereferences it). Ah, OK. Sometimes, it's hard to find the register/memory location of local variables. (and sometimes it fails) > So something went wrong while fetching gw itself (do you interpret the > dwarf tables to find where the variable is stored?) Hm, yes, you can use eu-readelf to dump debuginfo, and also objdump will help you to find the address and assembler code. > >> I'd like to check it, could you tell me details? for example, that exception log, >> kprobe-tracer's event definition(you can see it via debugfs/tracing/kprobe-events) >> and the result of `perf probe -L paging64_fetch:0-10`. > > I no longer have the logs, I'll try to reproduce it later. Oh, Thank you! :) -- Masami HIRAMATSU 2nd Dept. Linux Technology Center Hitachi, Ltd., Systems Development Laboratory E-mail: masami.hiramatsu.pt@hitachi.com