From patchwork Mon May 2 04:10:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 8989731 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8FE159F39D for ; Mon, 2 May 2016 04:13:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71317201C7 for ; Mon, 2 May 2016 04:13:33 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 59EDE201D3 for ; Mon, 2 May 2016 04:13:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax5CR-0002Gt-SF; Mon, 02 May 2016 04:11:11 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax5CQ-0002Dm-Or for xen-devel@lists.xen.org; Mon, 02 May 2016 04:11:10 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 21/D1-14148-E53D6275; Mon, 02 May 2016 04:11:10 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRWlGSWpSXmKPExsVyMXThQd3Yy2r hBn/v6Vks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBkv+m4xFZzRr3h38xtjA+MWtS5GTg4hgYmM EqfOlHQxcnGwCMxjltj0dxYriCMh0M8q8XTdUhaQKgmBGIkJXX/YIOxaid3zjrFBdCtI/J5wi AmkQUhgMpPEjjfH2UESbAIaEk9+zQArEhGQlrj2+TIjSBGzwAlGiUUvWsGKhAXsJSa/2QW0gQ Not6rEwTNeIGFeAUeJI/NfsYKEJQTkJBa89wEJcwo4SfR93cQMsddR4umH+4wTGAUWMDKsYtQ oTi0qSy3SNTTWSyrKTM8oyU3MzNE1NDDVy00tLk5MT81JTCrWS87P3cQIDCwGINjB+G+b5yFG SQ4mJVHeycfUwoX4kvJTKjMSizPii0pzUosPMcpwcChJ8GZeAsoJFqWmp1akZeYAQxwmLcHBo yTCa3sOKM1bXJCYW5yZDpE6xWjJseX3tbVMHJ823gGS26beW8skxJKXn5cqJc5rAjJPAKQhoz QPbhwsDi8xykoJ8zICHSjEU5BalJtZgir/ilGcg1FJmLcVZApPZl4J3NZXQAcxAR2UvV4V5KC SRISUVANjtVJLJ8OnEzvsVdKYhQ7s/LVV7F/giqVP/JhnZH29p+xgfk7YftJByaKHixYyO7ra BRg7yqxkO6s1/41w2aN3fFen8m1Mvufx8+I2R86T53TXKb6KtRVY/ir87v6SqqALH25fUvd9V e5+g/mm457NNXMeFHjs+hGuvfdWj5XLgTN5PdrC73L3K7EUZyQaajEXFScCADXlwCK+AgAA X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-3.tower-206.messagelabs.com!1462162268!33724787!1 X-Originating-IP: [209.85.161.193] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5584 invoked from network); 2 May 2016 04:11:09 -0000 Received: from mail-yw0-f193.google.com (HELO mail-yw0-f193.google.com) (209.85.161.193) by server-3.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 2 May 2016 04:11:09 -0000 Received: by mail-yw0-f193.google.com with SMTP id y6so17641725ywe.0 for ; Sun, 01 May 2016 21:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aP/G4tKr641xKQqln4tKzm0kmIEm5usSF4biITTOXN0=; b=Vpnuasa7jRU11uPfP8w7aCvE2U+/1YDs6F5G/l/hxxUANc6anlW1ueQazr+gNeLpZC b7vKc/i4GNny6V+DsW8Gp67/bNnfec41GoZ1m+Um3AeoGW3NLZreQL8EIv439Nv+QsMh 2TREx3lCmxh0IhXGoFsIy05Pi/hyqk39KAPME= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aP/G4tKr641xKQqln4tKzm0kmIEm5usSF4biITTOXN0=; b=gD5Rkhmql55Ck1a5NYBPh7LlajyhyRFPw49F16ibty+9GGjSoecs6v0wOw8JcarykF 6i7QNnEaoLwNWpUlfaTmnNXizND8vXWOM7CdiWRvnQXxqtLrTK9Ep5zv2ESbHiINhMol SgpNQCAx39oOWoe70z8F6nseWXrFVkcnCJxAVk9Uhe0Qu4E0a2I8qW3XYi8Cafr+gxj7 4b2RiRhe1e72q/NapJr0DUjcHc7tzw4deVLVl5bavWyVyed/mxi7rWVwd6QcnF/LqR61 dJ/Dy0X/NaTBlygo9pmowNpFaQKkTYB3dJxOIjnmuWew/29jRc9GS4stuudaNpxMsg9Y ce3w== X-Gm-Message-State: AOPr4FVGQVHTNSgDo8RWHmXDr2cMueEZ2qCSm6ArwauRxcm8B4lUIzBCfUp2pE77DdAfxg== X-Received: by 10.129.137.129 with SMTP id z123mr20280773ywf.101.1462162268508; Sun, 01 May 2016 21:11:08 -0700 (PDT) Received: from swanson.lan (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id j3sm14334897ywj.32.2016.05.01.21.11.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 May 2016 21:11:07 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Sun, 1 May 2016 23:10:46 -0500 Message-Id: <1462162246-32413-8-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1462162246-32413-1-git-send-email-cardoe@cardoe.com> References: <1462162246-32413-1-git-send-email-cardoe@cardoe.com> Cc: Andrew Cooper , Julien Grall , Stefano Stabellini , Doug Goldstein , Jan Beulich Subject: [Xen-devel] [RFC PATCH 7/7] build: convert lock_profile to Kconfig X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID,UNPARSEABLE_RELAY,URIBL_BLACK autolearn=unavailable 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 Convert the 'lock_profile' option to Kconfig as CONFIG_LOCK_PROFILE. Signed-off-by: Doug Goldstein --- CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Andrew Cooper --- INSTALL | 1 - xen/Kconfig.debug | 6 ++++++ xen/Rules.mk | 2 -- xen/arch/arm/xen.lds.S | 2 +- xen/arch/x86/domain.c | 2 +- xen/arch/x86/xen.lds.S | 2 +- xen/common/keyhandler.c | 2 +- xen/common/spinlock.c | 10 +++++----- xen/common/sysctl.c | 2 +- xen/include/xen/spinlock.h | 4 ++-- 10 files changed, 18 insertions(+), 15 deletions(-) diff --git a/INSTALL b/INSTALL index 623887d..616a67a 100644 --- a/INSTALL +++ b/INSTALL @@ -227,7 +227,6 @@ VGABIOS_REL_DATE="dd Mon yyyy" The following variables can be used to tweak some aspects of the hypervisor build. -lock_profile=y lto=y During tools build external repos will be cloned into the source tree. diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index 4727273..5b370e8 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -28,6 +28,12 @@ config FRAME_POINTER maybe slower, but it gives very useful debugging information in case of any Xen bugs. +config LOCK_PROFILE + bool "Lock Profiiling" + default n + ---help--- + Lock Profiling + config PERF_ARRAYS bool "Performance Counter Arrays" default n diff --git a/xen/Rules.mk b/xen/Rules.mk index 7e2cb5f..3015c5b 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -3,7 +3,6 @@ # If you change any of these configuration options then you must # 'make clean' before rebuilding. # -lock_profile ?= n lto ?= n -include $(BASEDIR)/include/config/auto.conf @@ -43,7 +42,6 @@ ifneq ($(clang),y) CFLAGS += -Wa,--strip-local-absolute endif -CFLAGS-$(lock_profile) += -DLOCK_PROFILE CFLAGS-$(CONFIG_FRAME_POINTER) += -fno-omit-frame-pointer ifneq ($(max_phys_irqs),) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 1f010bd..76982b2 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -54,7 +54,7 @@ SECTIONS *(.rodata) *(.rodata.*) -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE . = ALIGN(POINTER_ALIGN); __lock_profile_start = .; *(.lockprofile.data) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 5af2cc5..978ec3a 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -251,7 +251,7 @@ struct domain *alloc_domain_struct(void) #endif -#ifndef LOCK_PROFILE +#ifndef CONFIG_LOCK_PROFILE BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE); #endif d = alloc_xenheap_pages(order, MEMF_bits(bits)); diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index b14bcd2..a43b29d 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -103,7 +103,7 @@ SECTIONS *(.ex_table.pre) __stop___pre_ex_table = .; -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE . = ALIGN(POINTER_ALIGN); __lock_profile_start = .; *(.lockprofile.data) diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 65b70ce..16de6e8 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -64,7 +64,7 @@ static struct keyhandler { KEYHANDLER('P', perfc_reset, "reset performance counters", 0), #endif -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1), KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0), #endif diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index b377bb9..017bdf3 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -85,7 +85,7 @@ void spin_debug_disable(void) #endif -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE #define LOCK_PROFILE_REL \ if (lock->profile) \ @@ -212,7 +212,7 @@ int _spin_trylock(spinlock_t *lock) if ( cmpxchg(&lock->tickets.head_tail, old.head_tail, new.head_tail) != old.head_tail ) return 0; -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE if (lock->profile) lock->profile->time_locked = NOW(); #endif @@ -227,7 +227,7 @@ int _spin_trylock(spinlock_t *lock) void _spin_barrier(spinlock_t *lock) { spinlock_tickets_t sample; -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE s_time_t block = NOW(); #endif @@ -238,7 +238,7 @@ void _spin_barrier(spinlock_t *lock) { while ( observe_head(&lock->tickets) == sample.head ) arch_lock_relax(); -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE if ( lock->profile ) { lock->profile->time_block += NOW() - block; @@ -296,7 +296,7 @@ void _spin_unlock_recursive(spinlock_t *lock) } } -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE struct lock_profile_anc { struct lock_profile_qhead *head_q; /* first head of this type */ diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 11bef0e..b4f235e 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -121,7 +121,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl) break; #endif -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE case XEN_SYSCTL_lockprof_op: ret = spinlock_profile_control(&op->u.lockprof_op); break; diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index 88b53f9..c1883bd 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -20,7 +20,7 @@ struct lock_debug { }; #define spin_debug_disable() ((void)0) #endif -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE #include @@ -144,7 +144,7 @@ typedef struct spinlock { u16 recurse_cnt:4; #define SPINLOCK_MAX_RECURSE 0xfu struct lock_debug debug; -#ifdef LOCK_PROFILE +#ifdef CONFIG_LOCK_PROFILE struct lock_profile *profile; #endif } spinlock_t;