Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbZKAOt1 (ORCPT ); Sun, 1 Nov 2009 09:49:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752525AbZKAOt0 (ORCPT ); Sun, 1 Nov 2009 09:49:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38683 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752439AbZKAOtZ (ORCPT ); Sun, 1 Nov 2009 09:49:25 -0500 Message-ID: <4AED9FCD.6010202@redhat.com> Date: Sun, 01 Nov 2009 09:48:45 -0500 From: Masami Hiramatsu User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: "Frank Ch. Eigler" CC: Steven Rostedt , linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Frederic Weisbecker , Peter Zijlstra , Thomas Gleixner , Arnaldo Carvalho de Melo , "H. Peter Anvin" , Li Zefan , Lai Jiangshan , "David S. Miller" , Stephen Hemminger Subject: Re: [PATCH 0/3][RFC] tracing/kprobes: prevent jprobes from crashing function graph tracer References: <20091029205151.852744305@goodmis.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1411 Lines: 47 Frank Ch. Eigler wrote: > Steven Rostedt writes: > >> [...] Jprobes and the function graph tracer use the same mechanism >> to trace the exit of a function. Unfortunately, only one can be done >> at a time. The function graph tracer replaces the return address >> with its own handler, but so does jprobes. The two are not >> compatible. [...] > > What about kretprobes? It too uses the same mechanism. Exactly, kretprobe uses similar mechanism with func-graph tracer. Fortunately, it doesn't cause any problem, because kretprobe doesn't skip any function-return, and func-graph tracer(mcount) always intrudes a function after kretprobe. --- call func <-- kretprobe prehandler changes return address func() <-- func-graph prehandler changes return address ... return --> func-graph trampoline sets ip to "kretprobe trampoline" --> kretprobe trampoline sets ip to "real return address" (return address) --- So that kretprobe handler doesn't conflict with function graph tracer. Thank you, -- Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: mhiramat@redhat.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/