From patchwork Tue Jul 3 10:14:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 140938 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp980448ljj; Tue, 3 Jul 2018 03:21:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeafAXLM+faU95ssrvwPc+ww0V+aKduWlA1geYW5RWqQrlBsDt91g9SGwYI8U+vZx68UoDp X-Received: by 2002:a0c:96eb:: with SMTP id b40-v6mr660967qvd.235.1530613283926; Tue, 03 Jul 2018 03:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530613283; cv=none; d=google.com; s=arc-20160816; b=HNa/pkl8RUEB/Dpe6mFbbcgdKvyz7yFiNs+j41NKmyWgBUK7gwyhL8Gi3OJOv8Da0r VuwpshezYudXL1PWRCA1KekzVa70qsrh/1MxxTqs5hsaloOfG0xvE9F39Kyrvuhin31V wbVU33P67EAlLFb6sE04eUtCYPi7zlRUn1gpCl+Il6Fvltck4m5TCjD50TccVcK55g5G JY0eLi12eFLHw4CjOM6EcKmMyRWR9O+tx+T4u2eBmOtKWhfVBID02C79VuaGhWZc4XKE EuMvOGqkK6usY6HN93Qaw4JFUe/vavPbLWRDG1FB+X5JtQeCgKZK/n8ClYVdmuS983HL 7O4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=26jHJcKVZxrJ3kF/okCbHv+dP0VTbKpXYEPZSYP8zmE=; b=Qy3SO7tTmb2PVPopSQfjjFdXM4LPpHkjlJLUakAbZTfDYp70iP4LS1QWp+XEMPeglf pyIH60NSUGexDyvyrSpw3at+uJGZrmPQzj3znwRV69kVaQqQxARDImqhFdCf6r3VvTKX 1zVE731XFFGLrVcFeDhCJKngL8IuD1nKOdjTmqeMK970EAhQf7bg3IBB7raHhhNPlzfl pEJfnpq1hASf9MSCcoVlXi0JRRz88fkuGan8LLfveBUYlqCBYs0tFhqwytNPjhpmkKql 2tTS6OLuxVuRS4OdyDJUg7YTnVIghiL42ZHfuQe8bO/tLBZ/3t/v0Wc2N+FCwzWRpwfd iQWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LyC7JrWd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d39-v6si941409qkh.36.2018.07.03.03.21.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 03 Jul 2018 03:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LyC7JrWd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faIR1-0002mZ-Bp for patch@linaro.org; Tue, 03 Jul 2018 06:21:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faIKp-0006r5-6w for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faIKm-0008So-1U for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:59 -0400 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:33251) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1faIKl-0008SH-QC for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:55 -0400 Received: by mail-wr0-x235.google.com with SMTP id k7-v6so1371274wrq.0 for ; Tue, 03 Jul 2018 03:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=26jHJcKVZxrJ3kF/okCbHv+dP0VTbKpXYEPZSYP8zmE=; b=LyC7JrWdRKWgk/bIlifu6Yuwgnd2EGeHICkF/xAK6+oY/mX84kUCeAZ8NVbP6t46/K hWKuevwX6QXVvXuVqpgOuqZNFCGOEP2paJUSDYlt3CKY2S5J94ukVMFhTgoSI18D6lWg NhoSKyYBe5EwwVeu5GGlslKNJXht2wTBdFQHM= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=26jHJcKVZxrJ3kF/okCbHv+dP0VTbKpXYEPZSYP8zmE=; b=SxJRXosjzOgOMkx5R6jPH6i3oHpvMB3oxTGWEiOf5x1MiSFzmJRYMrc5rcZIG+s7Al 4J99cRQx/JCAHKwq3V6Q3KSOndnrCNZlWV3tG33JSwpGnbIwRLub2us0ThI8yq+6arcZ juZl2KIOvPraXrr0TE925xfRvjjNo+2YPSjbUdBrXM53oEAgpJYbLquWajxkPvSASHNx qT3ASnNWGeORoWKV5upd0mdoP9v8NBtUdaCN7hqzvgxMk7/CGwKDUHORk82J4LxF/ZhH hcUgUU40m8a2+3IFTTPlRr0mKf9Bi6whxiR286b1qTELW0yHYL4iJSmgbEXjqQE73Sxc ZGxQ== X-Gm-Message-State: APt69E3P1mKF/vsqPBDRO/OUMVavTcW91n9eAFElSX5xrqbgeGo5wH75 Dcz0QCaB0HDqaAck0ij+epdAmw== X-Received: by 2002:adf:f5c3:: with SMTP id k3-v6mr16524343wrp.219.1530612894757; Tue, 03 Jul 2018 03:14:54 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id s12-v6sm956382wrr.43.2018.07.03.03.14.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Jul 2018 03:14:51 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 57BBF3E0775; Tue, 3 Jul 2018 11:14:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 3 Jul 2018 11:14:34 +0100 Message-Id: <20180703101444.23778-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180703101444.23778-1-alex.bennee@linaro.org> References: <20180703101444.23778-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::235 Subject: [Qemu-devel] [PULL 10/20] linux-user: add gcov support to preexit_cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: agraf@suse.de, =?utf-8?q?Alex_Benn=C3=A9e?= , Riku Voipio , richard.henderson@linaro.org, qemu-devel@nongnu.org, f4bug@amsat.org, cota@braap.org, famz@redhat.com, aurelien@aurel32.net, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As we don't always take the normal exit path when running a guest we can skip the normal exit destructors where gcov normally dumps it's info. The GCC manual suggests long running programs use __gcov_dump() to flush out the coverage state periodically so we use that here. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.17.1 diff --git a/linux-user/exit.c b/linux-user/exit.c index aed8713fae..14e94e28fa 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -19,10 +19,17 @@ #include "qemu/osdep.h" #include "qemu.h" +#ifdef CONFIG_GCOV +extern void __gcov_dump(void); +#endif + void preexit_cleanup(CPUArchState *env, int code) { #ifdef TARGET_GPROF _mcleanup(); +#endif +#ifdef CONFIG_GCOV + __gcov_dump(); #endif gdb_exit(env, code); }