From patchwork Tue Mar 4 17:31:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Nesterov X-Patchwork-Id: 3764341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D1961BF13A for ; Tue, 4 Mar 2014 17:33:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0499C20374 for ; Tue, 4 Mar 2014 17:33:38 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F288720220 for ; Tue, 4 Mar 2014 17:33:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WKtD8-0007sR-PX; Tue, 04 Mar 2014 17:32:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WKtCz-0004Qa-FE; Tue, 04 Mar 2014 17:32:49 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WKtCm-0004OR-6w for linux-arm-kernel@lists.infradead.org; Tue, 04 Mar 2014 17:32:37 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s24HVpaB031733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Mar 2014 12:31:51 -0500 Received: from tranklukator.brq.redhat.com (dhcp-1-104.brq.redhat.com [10.34.1.104]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id s24HVkUL003476; Tue, 4 Mar 2014 12:31:47 -0500 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Tue, 4 Mar 2014 18:31:38 +0100 (CET) Date: Tue, 4 Mar 2014 18:31:34 +0100 From: Oleg Nesterov To: Russell King - ARM Linux Subject: Re: [PATCH v6 00/14] uprobes: Add uprobes support for ARM Message-ID: <20140304173134.GA18830@redhat.com> References: <1392017945-4507-1-git-send-email-dave.long@linaro.org> <20140301123026.GD21483@n2100.arm.linux.org.uk> <53131DBE.7020500@linaro.org> <20140303205039.GA8949@redhat.com> <20140304005306.GO21483@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140304005306.GO21483@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140304_123236_405171_B5C71550 X-CRM114-Status: GOOD ( 26.55 ) X-Spam-Score: -3.9 (---) Cc: "Jon Medhurst \(Tixy\)" , Peter Zijlstra , Srikar Dronamraju , linux-kernel@vger.kernel.org, Anil S Keshavamurthy , Rabin Vincent , Ingo Molnar , Paul Mackerras , David Long , Arnaldo Carvalho de Melo , Masami Hiramatsu , davem@davemloft.net, linux-arm-kernel@lists.infradead.org, Ananth N Mavinakayanahalli X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 03/04, Russell King - ARM Linux wrote: > > On Mon, Mar 03, 2014 at 09:50:39PM +0100, Oleg Nesterov wrote: > > > > And why CONFIG_UPROBES should depend on PERF_EVENTS? uprobes can be > > used by (say) systemtap without UPROBE_EVENT/PERF_EVENTS. > > > > But as Russell pointed out the events directory is only built if > > CONFIG_PERF_EVENTS=y, so it should depend on it or select... > > > > > > I dunno. Personally I vote for the patch from Srikar in > > > > http://article.gmane.org/gmane.linux.kernel/1017186 > > > > This is what we currently have, currently CONFIG_UPROBES is not > > user-selectable anyway. > > Yes, me too, but with the proviso that UPROBE_EVENT also sorts itself > out with PERF_EVENTS in some way too (either by selecting it, which > IMHO isn't nice, or by depending on it, or the build dependency itself > gets sorted.) OK... what do you think about the patch below for now? > Maybe a simpler answer would be to change the build stuff (hand-crafted): > > kernel/Makefile > -obj-$(CONFIG_PERF_EVENTS) += events/ > +obj-y += events/ > > and kernel/events/Makefile: > > -obj-y := core.o ring_buffer.o callchain.o > +perf-y := core.o ring_buffer.o callchain.o > > -obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o > +perf-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o > + > +obj-${CONFIG_PERF_EVENTS) += $(perf-y) I fully agree. Except I can't review this change ;) But hopefully I can understand what it should do. But personally I'd prefer to start with the simple/safe change which allows us to merge this series. If nothing else, even if I think that kernel/events/uprobes.c doesn't need CONFIG_PERF_EVENTS, this should be verified and discussed with perf maintainers. If you agree with the patch below, how should we route it? I won't argue if you push it along with other patches from David. BTW... why UPROBE_EVENT depends on MMU? I think that ARCH_SUPPORTS_UPROBES should not be true if !CONFIG_MMU. Oleg. diff --git a/arch/Kconfig b/arch/Kconfig index 80bbb8c..97ff872 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -86,9 +86,7 @@ config KPROBES_ON_FTRACE optimize on top of function tracing. config UPROBES - bool "Transparent user-space probes (EXPERIMENTAL)" - depends on UPROBE_EVENT && PERF_EVENTS - default n + def_bool n select PERCPU_RWSEM help Uprobes is the user-space counterpart to kprobes: they @@ -101,8 +99,6 @@ config UPROBES managed by the kernel and kept transparent to the probed application. ) - If in doubt, say "N". - config HAVE_64BIT_ALIGNED_ACCESS def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS help diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 015f85a..8639819 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -424,6 +424,7 @@ config UPROBE_EVENT bool "Enable uprobes-based dynamic events" depends on ARCH_SUPPORTS_UPROBES depends on MMU + depends on PERF_EVENTS select UPROBES select PROBE_EVENTS select TRACING