From patchwork Mon Jul 2 14:30:11 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: 937939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="TBu6tz+O"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41K8sH4B6Zz9s4Z for ; Tue, 3 Jul 2018 00:34:27 +1000 (AEST) Received: from localhost ([::1]:33155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzuL-0007ka-6B for incoming@patchwork.ozlabs.org; Mon, 02 Jul 2018 10:34:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzqe-0005Sw-3K for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzqb-0000W1-Gj for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:36 -0400 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:39181) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzqb-0000VN-9y for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:33 -0400 Received: by mail-wm0-x22d.google.com with SMTP id p11-v6so8929310wmc.4 for ; Mon, 02 Jul 2018 07:30:33 -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=kmxmf7D1wRCQMWlrMFFuqjwqqZgMGx8Sce56K/tkabU=; b=TBu6tz+OV2KL8SVgqyWsna790wz7u92IzWgn3wma2pJFRb3ct5D5CPgsA1fZE45Yi/ 5EIhx1y7pqDHd6Nbq/D6ilMh9N/Iprb5sOmMESd86Q6HAmO+oo2lXc7xK4fb+mjywU2E UaJny/bYuv4L+sLtOAessSroKmXVuQfLeNRQI= 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=kmxmf7D1wRCQMWlrMFFuqjwqqZgMGx8Sce56K/tkabU=; b=gMWhPeN9WiUuXVwtaNt1tsIuA/DgCm0klpEeY6D9Cx2tZLyY7s3rFo527PikSmugkf 4vV0/9q3z6tR/9YTQzWv6wAIasEmw+J2FDbU5awPPEkfsF4MjhDvIUvVfOjzXPj0tQjU hXquJckhC32ZkpPwjOY9HyAZaLGfebPNlT1p0RyoegdExFUoPJ7yQhwdu7nrVLgIHlNO JsN4vAC/iS01E+oXHiizeGGdnEIx2g2Cm+r2jiNvR0bptHC8EqLr+np5EHZdxKHlmIBt 3bZrJSuH5igNPjFnciaduGtfkYmnXMw5WdbbqUAKnsAuT9AkIKwcsrzMgl+CU+gd+TBD gt8A== X-Gm-Message-State: APt69E2XDkb/6+S/h8+tuA8T6/o2cQZvI6aL1jqG3DLguO8dRDd+qexS xS6v9go81sUb4U2wUZSiVEzwjA== X-Google-Smtp-Source: AAOMgpcOBm1inLGW7vGSS6cufA/x5Ff6prmqXAaBDu9vS6tlhRxpRcZHHUwhGqTCy0wVrjQbtkrL2A== X-Received: by 2002:a1c:1414:: with SMTP id 20-v6mr8016738wmu.119.1530541832243; Mon, 02 Jul 2018 07:30:32 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id i14-v6sm14089301wro.11.2018.07.02.07.30.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 07:30:28 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 894643E0930; Mon, 2 Jul 2018 15:30:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Mon, 2 Jul 2018 15:30:11 +0100 Message-Id: <20180702143021.18864-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180702143021.18864-1-alex.bennee@linaro.org> References: <20180702143021.18864-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:c09::22d Subject: [Qemu-devel] [PATCH v3 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: pbonzini@redhat.com, Riku Voipio , =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.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é --- linux-user/exit.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); }