From patchwork Wed Mar 29 18:16:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Schmoll X-Patchwork-Id: 9652231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 19700602C8 for ; Wed, 29 Mar 2017 18:18:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03B8328520 for ; Wed, 29 Mar 2017 18:18:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E84F22851F; Wed, 29 Mar 2017 18:18:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 7ABDD2851F for ; Wed, 29 Mar 2017 18:18:50 +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 1ctI8n-0007p0-M5; Wed, 29 Mar 2017 18:16:17 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ctI8m-0007ou-Cl for xen-devel@lists.xenproject.org; Wed, 29 Mar 2017 18:16:16 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id 74/BF-04817-FE9FBD85; Wed, 29 Mar 2017 18:16:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42K5GNpwWPf9z9s RBmd28lh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBnLXl1nLfjHU9F7/jhTA+Mfri5GLg4hgemM Eot7/zODOCwCl1gk7u59zAjiSAi8Y5FYfeUHkMMJ5MRIPL18lw3Crpb42/eYBcQWEtCU+NLdx QgxaimTxIMfbcwgCTYBA4nZKy+C2SICShL3Vk1mArGZBVwkuuY1gw0SFjCSOLCoA2wQi4CqxN k5fawgNq+AncTio2uhFstL7Gq7yDqBkW8BI8MqRo3i1KKy1CJdIzO9pKLM9IyS3MTMHF1DAzO 93NTi4sT01JzEpGK95PzcTYzAYGEAgh2MZxYEHmKU5GBSEuU9YXg7QogvKT+lMiOxOCO+qDQn tfgQowwHh5IE74UfQDnBotT01Iq0zBxg2MKkJTh4lER4rUDSvMUFibnFmekQqVOMxhwPTu16w 8Txqf/wGyYhlrz8vFQpcd75IKUCIKUZpXlwg2DxdIlRVkqYlxHoNCGegtSi3MwSVPlXjOIcjE rCvItApvBk5pXA7XsFdAoT0CniNrdATilJREhJNTBqRe85X9Wj0fSn0dVVpkbjtlHDn8adpYu Z1J/e4llzXobn3l82uSWG63/daaxqsHWxzooxqSmYcEert21+xwOmtIebPy091MO1+C9/rpn0 AqWlO5Mumrgte9vxqsw2U2H2QfXOJa2cm6qDG9fwV+QejHz0N+85q9HS44I9sgkffP2TJaoyZ JRYijMSDbWYi4oTAQLBiM6iAgAA X-Env-Sender: eggi.innovations@gmail.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1490811375!60905179!1 X-Originating-IP: [209.85.128.195] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5367 invoked from network); 29 Mar 2017 18:16:15 -0000 Received: from mail-wr0-f195.google.com (HELO mail-wr0-f195.google.com) (209.85.128.195) by server-15.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 29 Mar 2017 18:16:15 -0000 Received: by mail-wr0-f195.google.com with SMTP id k6so4025445wre.3 for ; Wed, 29 Mar 2017 11:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Apr3jeU19d7vDMQqoEGE6TEb3p9/LP2LIo24VTs1INw=; b=mlj47wzYI5crz/H79wetQFmYQvlnw1roYeh4eMWOf1TSuwyi9C+lEZXfZudnOwvmJF IP+aS7u593zzIFd/ahYzc0g6hsDf2OmNQCDqBV4LE9w0hhoezSaC6NgcnKyX3wgR0COj jDXr95sFgIkY4TWiRkia47HyDMM3AawI+khzkTgG3yxRwCK17+4oaEZnBk6VvjqEdMU2 55eE0c+GgmiReEVzQP7k1eEn3rev2D0kpOE/0cAgVAdeSqkMFeOpav5zIdRw3oawk8Ha pt7lp7T1Zxzpc3p35u9Pge7XgLSVAVehsuhDwmIlmX7eZcfj7kjEnRIHPv2E9LjDDmIr O4WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Apr3jeU19d7vDMQqoEGE6TEb3p9/LP2LIo24VTs1INw=; b=iYvum5fFq0qDHaRpGvJW4uIsyUOa5jsxK3yiEfWX5CDPKaZQj87a8/SL5ZnliWabR2 bKm0z7fwH2ocs95hkR+8/Dmwt3ONM+b0PsbeKPkp2zHIAVbY+O0NlheTI+rdSMyuVVDa d6PBt5T+C98PBl1tIR1/018R9x/XiZjAhUf/+J9sOj4ZbcRxnIeSYdIXJOVJXh4r5gc7 B53S8VG4CW03EUA4WssFllbSbC5mYWIbr8abFhGZd+Kw02//YAXNEblGxs7GUCE3Km9U pmU6lc2w0Zr0Z6Xie4j2+jgJTvQpj7QMaVyDSNSAgsX5JxYHUBlkn5HgexKW5S34d9aB NznQ== X-Gm-Message-State: AFeK/H0VHMyI/2al0rM/vjk0x81ixyhAL5bLbRPDq9Ki3MPkmxf5wvux9DQ7KeAf6c2Vow== X-Received: by 10.223.163.144 with SMTP id l16mr1854883wrb.138.1490811374757; Wed, 29 Mar 2017 11:16:14 -0700 (PDT) Received: from debian.jacobs-university.de (firewallix.jacobs-university.de. [212.201.44.247]) by smtp.gmail.com with ESMTPSA id q188sm76477wmd.3.2017.03.29.11.16.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 11:16:14 -0700 (PDT) From: Felix Schmoll To: xen-devel@lists.xenproject.org Date: Wed, 29 Mar 2017 20:16:02 +0200 Message-Id: <20170329181602.1107-1-eggi.innovations@gmail.com> X-Mailer: git-send-email 2.11.0 Cc: wei.liu2@citrix.com, Felix Schmoll Subject: [Xen-devel] [PATCH] Enable compiling with gcc tracing 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-Virus-Scanned: ClamAV using ClamSMTP Make minimal adjustments in order to enable the compilation of the xen source-code with gcc-6's -fsanitize-coverage=trace-pc option. Due to a bug in Xen's build-system the flag for the compiler has to be handed in via the command line, i.e. for compiling one would use: make CC= This is an experimental patch as in a final version you would not want all files to be compiled with this option by default. Signed-off-by: Felix Schmoll --- xen/Rules.mk | 1 + xen/common/kernel.c | 2 ++ xen/include/xen/hypercall.h | 2 ++ 3 files changed, 5 insertions(+) diff --git a/xen/Rules.mk b/xen/Rules.mk index 77bcd44922..254cc4381e 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -46,6 +46,7 @@ else CFLAGS += -O2 -fomit-frame-pointer endif +CFLAGS += -fsanitize-coverage=trace-pc CFLAGS += -nostdinc -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 84618715dc..77b22effb3 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -238,6 +238,8 @@ void __init do_initcalls(void) # define DO(fn) long do_##fn +void __sanitizer_cov_trace_pc(void) { return; } + #endif /* diff --git a/xen/include/xen/hypercall.h b/xen/include/xen/hypercall.h index cc99aea57d..12517b5e90 100644 --- a/xen/include/xen/hypercall.h +++ b/xen/include/xen/hypercall.h @@ -19,6 +19,8 @@ #include #include +extern void __sanitizer_cov_trace_pc(void); + extern long do_sched_op( int cmd,