From nobody Mon Apr 29 18:39:05 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1559211545; cv=none; d=zoho.com; s=zohoarc; b=I/IcH8BRnDlDVBi8VbLFswdvwktAj8tT4vttRdaVdWNL4DVKRqh/vaaV/qQw3RFF7OuJSsOFjp38RdJnmTqjhKlQC5/SfI2X6nraKKwmRwfK/9iv6SUgYxId2zKvvL1Vc8q4irOK1JnoEw3yJBT0RhyuyDD+ipV8zTagWAomD+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559211545; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=s9Ve//xIjThKX618gN/prsausYo3PBAlpN8ksAn93BE=; b=AqzS/5JAc+dBuCch2Ra37UTV1Qs5W3FsWXTVwLCL64qE4vEvXbY33RrDUra79lCwADoqMppMs66HYkX/sLA+1d9cjU9u5OCJyGCPDPk7JMv8WduelWUXT0bUidqPabbIJeLXNnm+92AR6ux1qEKqbQMSUoH2s5mNAOCDlGGGk6M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1559211545336442.21367483371193; Thu, 30 May 2019 03:19:05 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hWI7j-0001SQ-7f; Thu, 30 May 2019 10:17:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hWI7h-0001SL-KL for xen-devel@lists.xenproject.org; Thu, 30 May 2019 10:17:25 +0000 Received: from mxnavi-mail.mxnavi.com (unknown [116.90.87.199]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1b6ef9b8-82c4-11e9-9d33-73645005e1c7; Thu, 30 May 2019 10:17:21 +0000 (UTC) Received: from localhost.localdomain (61.161.186.150) by mxnavi-mail.mxnavi.com (116.90.87.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Thu, 30 May 2019 18:15:07 +0800 X-Inumbo-ID: 1b6ef9b8-82c4-11e9-9d33-73645005e1c7 From: Baodong Chen To: Date: Thu, 30 May 2019 18:17:12 +0800 Message-ID: <1559211432-30973-1-git-send-email-chenbaodong@mxnavi.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [61.161.186.150] X-ClientProxiedBy: mxnavi-mail.mxnavi.com (116.90.87.199) To mxnavi-mail.mxnavi.com (116.90.87.199) Subject: [Xen-devel] [PATCH] xen: make tracebuffer configurable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Baodong Chen Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Default: enabled. Can be disabled for smaller code footprint. Signed-off-by: Baodong Chen --- xen/common/Kconfig | 6 ++++++ xen/common/Makefile | 2 +- xen/include/xen/trace.h | 18 +++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index c838506..3a6eec8 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -368,4 +368,10 @@ config DOM0_MEM =20 Leave empty if you are not sure what to specify. =20 +config HAS_TRACEBUFFER + bool "Enable/Disable tracebuffer" + default y + ---help--- + Enable or disable tracebuffer function. + endmenu diff --git a/xen/common/Makefile b/xen/common/Makefile index bca48e6..86c5bf9 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -56,7 +56,7 @@ obj-y +=3D sysctl.o obj-y +=3D tasklet.o obj-y +=3D time.o obj-y +=3D timer.o -obj-y +=3D trace.o +obj-$(CONFIG_HAS_TRACEBUFFER) +=3D trace.o obj-y +=3D version.o obj-y +=3D virtual_region.o obj-y +=3D vm_event.o diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h index 12966ea..fb1a2bc 100644 --- a/xen/include/xen/trace.h +++ b/xen/include/xen/trace.h @@ -21,12 +21,14 @@ #ifndef __XEN_TRACE_H__ #define __XEN_TRACE_H__ =20 -extern int tb_init_done; =20 #include #include #include =20 +#ifdef CONFIG_HAS_TRACEBUFFER + +extern int tb_init_done; /* Used to initialise trace buffer functionality */ void init_trace_bufs(void); =20 @@ -47,6 +49,20 @@ static inline void trace_var(u32 event, int cycles, int = extra, void __trace_hypercall(uint32_t event, unsigned long op, const xen_ulong_t *args); =20 +#else +#define tb_init_done (0) +static inline void init_trace_bufs(void) {} +static inline int tb_control(struct xen_sysctl_tbuf_op *tbc) { return -ENO= SYS; } + +static inline int trace_will_trace_event(u32 event) { return 0; } +static inline void trace_var(u32 event, int cycles, int extra, + const void *extra_data) {} +static inline void __trace_var(u32 event, bool_t cycles, unsigned int extr= a, + const void *extra_data) {} +static inline void __trace_hypercall(uint32_t event, unsigned long op, + const xen_ulong_t *args) {} +#endif + /* Convenience macros for calling the trace function. */ #define TRACE_0D(_e) \ do { \ --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel