From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26174 invoked by alias); 14 Sep 2009 03:02:55 -0000 Received: (qmail 26025 invoked by uid 22791); 14 Sep 2009 03:02:54 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f219.google.com (HELO mail-fx0-f219.google.com) (209.85.220.219) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Sep 2009 03:02:50 +0000 Received: by fxm19 with SMTP id 19so1772537fxm.26 for ; Sun, 13 Sep 2009 20:02:48 -0700 (PDT) Received: by 10.204.160.143 with SMTP id n15mr4503144bkx.183.1252897368098; Sun, 13 Sep 2009 20:02:48 -0700 (PDT) Received: from nowhere (ADijon-552-1-91-97.w92-148.abo.wanadoo.fr [92.148.138.97]) by mx.google.com with ESMTPS id 35sm8201291fkt.46.2009.09.13.20.02.46 (version=SSLv3 cipher=RC4-MD5); Sun, 13 Sep 2009 20:02:47 -0700 (PDT) Received: by nowhere (nbSMTP-1.00) for uid 1000 (using TLSv1/SSLv3 with cipher RC4-MD5 (128/128 bits)) fweisbec@gmail.com; Mon, 14 Sep 2009 05:02:47 +0200 (CEST) Date: Mon, 14 Sep 2009 03:02:00 -0000 From: Frederic Weisbecker To: Masami Hiramatsu Cc: Steven Rostedt , Ingo Molnar , lkml , systemtap , DLE , Jim Keniston , Ananth N Mavinakayanahalli , Andi Kleen , Christoph Hellwig , "Frank Ch. Eigler" , "H. Peter Anvin" , Jason Baron , "K.Prasad" , Lai Jiangshan , Li Zefan , Peter Zijlstra , Srikar Dronamraju , Tom Zanussi Subject: Re: [PATCH tracing/kprobes 4/7] tracing/kprobes: Add event profiling support Message-ID: <20090914030244.GC14306@nowhere> References: <20090910235258.22412.29317.stgit@dhcp-100-2-132.bos.redhat.com> <20090910235329.22412.94731.stgit@dhcp-100-2-132.bos.redhat.com> <20090911031253.GD16396@nowhere> <4AAA7938.7070200@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AAA7938.7070200@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00705.txt.bz2 On Fri, Sep 11, 2009 at 12:22:16PM -0400, Masami Hiramatsu wrote: > Frederic Weisbecker wrote: >>> +static int probe_profile_enable(struct ftrace_event_call *call) >>> +{ >>> + struct trace_probe *tp = (struct trace_probe *)call->data; >>> + >>> + if (atomic_inc_return(&call->profile_count)) >>> + return 0; >>> + >>> + if (probe_is_return(tp)) { >>> + tp->rp.handler = kretprobe_profile_func; >>> + return enable_kretprobe(&tp->rp); >>> + } else { >>> + tp->rp.kp.pre_handler = kprobe_profile_func; >>> + return enable_kprobe(&tp->rp.kp); >>> + } >>> +} >> >> >> >> May be I misunderstood but it seems that concurrent uses of >> ftrace and perf would really mess up the result, as one would >> overwrite the handler of the other. >> >> Even though it's hard to imagine one using both at the same >> time on the same probe, but still... > > Oops, it's my misunderstanding. I thought those are exclusively > enabled each other. It's automatically managed with events because ftrace and and perf have their individual tracepoint probes, because tracepoints support multiple probes. >> Is it possible to have two kprobes having the exact same >> properties? (pointing to the same address, having the same >> probe handlers, etc...) >> >> Another solution would be to allow kprobes to have multiple >> handlers. > > It could be to have multiple kprobes on same point, but I think > it's waste of the memory and time in this case. Yeah. > > I'd like to have a dispatcher function and flags internally :) You mean kprobes that could support multiple probes? That would be a nice solution IMHO...