From nobody Tue Feb 10 05:39:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1578758072; cv=none; d=zohomail.com; s=zohoarc; b=ZnQQFYnt4T27Prr5Cs59p0Qk+no5k7IeBjMM80HQwhb/po+okzQ+EVKUUIF2Kt9oD9YCJNm4bcXnQgmv9O9k/JPJBHlgpQpGKHZbOf6O9BpKRCdr3lnpwgWky5R0ebLEIBANN0YbjLAW6NeNpo49qclWv7IwgrZNp1YTRYkDARs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578758072; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=1/lKxsciY3Q/0Hk3Gy+dzeylRUQkMUy0Hoi3s6427fg=; b=bFXSgYHlvzTlPcJX0kECDBQqKNPVkCrqDQxQI2kNxN5cSod3dOxvEITohVLOM3NCnVcqt0t0HJHbU25Om+Jflzqo+ueYG8mvYKzVLua5HJmFTb29gfTPPeULsmg6oGH3rf2p7MYjuZYZut9NO6Hyj+kbAxEbREcFxzCnX4/SLO0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578758072619475.84140661160484; Sat, 11 Jan 2020 07:54:32 -0800 (PST) Received: from localhost ([::1]:58562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iqJ5q-0002PX-UH for importer@patchew.org; Sat, 11 Jan 2020 10:54:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41175) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iqJ0o-0004Ev-2h for qemu-devel@nongnu.org; Sat, 11 Jan 2020 10:49:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iqJ0m-0003yn-JF for qemu-devel@nongnu.org; Sat, 11 Jan 2020 10:49:17 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:50480 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iqJ0m-0003uP-Bk for qemu-devel@nongnu.org; Sat, 11 Jan 2020 10:49:16 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 22BE91A1FDA; Sat, 11 Jan 2020 16:49:14 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 0AF161A1187; Sat, 11 Jan 2020 16:49:14 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PATCH v4 17/19] configure: Detect kcov support and introduce CONFIG_KCOV Date: Sat, 11 Jan 2020 16:40:39 +0100 Message-Id: <1578757241-29583-18-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578757241-29583-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1578757241-29583-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic kcov is kernel code coverage tracing tool. It requires kernel 4.4+ compiled with certain kernel options. Its interface consists of three ioctls. This patch checks if kcov support is present on build machine, and stores the result in variable CONFIG_KCOV, meant to be used in linux-user code related to the support for above mentioned ioctls. Signed-off-by: Aleksandar Markovic --- configure | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure b/configure index 940bf9e..dbdba8f 100755 --- a/configure +++ b/configure @@ -4752,6 +4752,24 @@ if compile_prog "" "" ; then syncfs=3Dyes fi =20 +# check for kcov support (kernel must be 4.4+, compiled with certain optio= ns) +kcov=3Dno +cat > $TMPC << EOF +#include + +int main(void) +{ + ioctl(-1, KCOV_ENABLE, NULL); + ioctl(-1, KCOV_DISABLE, NULL); + ioctl(-1, KCOV_INIT_TRACE, NULL); + + return 0; +} +EOF +if compile_prog "" "" ; then + kcov=3Dyes +fi + # Check we have a new enough version of sphinx-build has_sphinx_build() { # This is a bit awkward but works: create a trivial document and @@ -6874,6 +6892,9 @@ fi if test "$syncfs" =3D "yes" ; then echo "CONFIG_SYNCFS=3Dy" >> $config_host_mak fi +if test "$kcov" =3D "yes" ; then + echo "CONFIG_KCOV=3Dy" >> $config_host_mak +fi if test "$inotify" =3D "yes" ; then echo "CONFIG_INOTIFY=3Dy" >> $config_host_mak fi --=20 2.7.4