From patchwork Thu Dec 19 10:49:32 2019 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: 182096 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp326862iln; Thu, 19 Dec 2019 03:07:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyxd0Kqpy7yemRb1bH/EW1NKfgRz0f3ekAwSFuKLQhOZXKoAXIcJrMWrWr43ndgLkYs0hrG X-Received: by 2002:ac8:3364:: with SMTP id u33mr6464902qta.267.1576753638216; Thu, 19 Dec 2019 03:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753638; cv=none; d=google.com; s=arc-20160816; b=CIN60GDABIah+UHDa1RFmHAKL4k/iW/VnrJNLlRkaXV+nkaTZvvkVkjfcew8MhNApx eHUyWToT+sLeWfYftpqVWcS3zKkmsCHgfdP7MRb4gZtUB0/yEJh9e1bcQHYdAcNEn+f4 qSghI9CkpMp2i/kFCpo6b/Nu9h1dQiAWZYj7tEuZ6VRQ5OUZJi/mBc4fdhiyRYXqDqjE 0aEEOrLxtMfGH7rNED8OEEYAzp+6z6EJi9TfBsTrV5xFPpSXx0lnEPqR+qdjpK81ZK4K dHkgsQUPSyeEULd5u2VarpLcJ04fUMyDNg8EH+iF8l1+NTS/7lSzblu7fUgIDiwWaFD0 25XQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=92sA2vbfB/cZD8466MabdWOfrm8v8VCFN2q7tL8ddlM=; b=wFInaqv6QDrgTSBfEEJci0Wb6pkpTsHtgIXlOYyJj4dZQmahoTueth8lJlsjP6BNuS DtVDlyyNKRDeQcK/b5B/iaxNKJk2xoXlkEpI63Lv5bBRy6CzwDOU36Dt1NS9nr5y0LsM nvlBdxaHFLInmNwumBCb/rYeQhtqAiyg0tleqWGQGZGgiRRUKDVkpTtzuL05KrrYEI3S 9RaI86oKqgsUKTK4j1SJTYKbXtj0ri5du/6dLB35K2MqKcg0baKW5XkbVxyLLfJVe68a eCmaNDvo9WS7kXIddKQpZwbpT0CYifshAvM07ikHAvEU2TkktFCOlbp+dpwgydT1ZDNp u3qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JK8dcoWi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id s20si3290650qkg.56.2019.12.19.03.07.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:07:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JK8dcoWi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:39162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihteH-0005tR-Hn for patch@linaro.org; Thu, 19 Dec 2019 06:07:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWf-0003s7-92 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWe-00018X-0P for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:25 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:35812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWd-00013X-ON for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:23 -0500 Received: by mail-wr1-x42b.google.com with SMTP id g17so5523689wro.2 for ; Thu, 19 Dec 2019 02:59:23 -0800 (PST) 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=92sA2vbfB/cZD8466MabdWOfrm8v8VCFN2q7tL8ddlM=; b=JK8dcoWiDUSE8AbuT1VALJD6l/4fKv23JilB72zO83jaR3QDJUprvr7DKHmC7575Hn 3flvoJiI3WJGLr0MmE9aiw6y7q3X/ChYU3fWlid0FP14piFy4LS7s0fNKv7/jI94zTLB 5iqHpEgSRkqh+ZyHna4HtCbB+svihH8QCGnr5g8j1/5b/sK+9i7RYhfC9f4iXFzxjpop XQtD9u7Wk7DPa6lK5K4ltHLsbdx/0a0EZfssg9jj6lWNf0E14/NV/ZfxkuIJi+zfS3Y8 gMpi5h0HmVqnD7tB2IKa4LnfOfXPBAfIFwo2eOgc74gsy4GOwh+KejtK4DH+AzibwUZx t0rA== 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=92sA2vbfB/cZD8466MabdWOfrm8v8VCFN2q7tL8ddlM=; b=fZh8Cv8bqxt+1Ah7onCsF0rnuvpVeO7E5ogXG3SwkBXR/NWDjcefZA0GAopqC0l1x+ a0A5BfgHYytFIVqOvX/Pe/AhxlR06101kkoY79W5xCxYtaV+ZmeTqhWf8qBBpoG8d+ik jg2tDNTLHdy7xd7xtRzDNFsXBMlcmrXZ6YYSOH+zIVQgJWV81tyRGwxutgG5LteYjDy8 RZHnQyE3C+VNEsgsrhZbzq43f8vcR0hFvDmeBewNpT7LLx0sjiUsUFTRNthmxtBD8R1u VhfZ5q1g8G0Uk07RUxYIdsvfJilmmvpVjn1EE4S1wys83FkY6Wjydqp5UamTsq90QS0p JWyg== X-Gm-Message-State: APjAAAWTQuDcahEepBOPtmIfGVDalRsbsQIKYYM8j7pOm5yMjDHODbwR /GI9+qO/xS2PynhAaTFJi0/OeA== X-Received: by 2002:a5d:534b:: with SMTP id t11mr8920179wrv.120.1576753162550; Thu, 19 Dec 2019 02:59:22 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a1sm5699879wmj.40.2019.12.19.02.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:19 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A574E1FFAE; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 23/25] linux-user: convert target_munmap debug to a tracepoint Date: Thu, 19 Dec 2019 10:49:32 +0000 Message-Id: <20191219104934.866-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-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:4864:20::42b 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: Richard Henderson , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the final bit of DEBUG_MMAP to a tracepoint and remove the last remanents of the #ifdef hackery. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191205122518.10010-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 3d90fa459ca..8685f02e7e9 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -21,8 +21,6 @@ #include "exec/log.h" #include "qemu.h" -//#define DEBUG_MMAP - static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER; static __thread int mmap_lock_count; @@ -597,11 +595,8 @@ int target_munmap(abi_ulong start, abi_ulong len) abi_ulong end, real_start, real_end, addr; int prot, ret; -#ifdef DEBUG_MMAP - printf("munmap: start=0x" TARGET_ABI_FMT_lx " len=0x" - TARGET_ABI_FMT_lx "\n", - start, len); -#endif + trace_target_munmap(start, len); + if (start & ~TARGET_PAGE_MASK) return -TARGET_EINVAL; len = TARGET_PAGE_ALIGN(len); diff --git a/linux-user/trace-events b/linux-user/trace-events index 6d6aeef7b52..f6de1b8befc 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -16,3 +16,4 @@ user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_psw_add target_mprotect(uint64_t start, uint64_t len, int flags) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x" target_mmap(uint64_t start, uint64_t len, int pflags, int mflags, int fd, uint64_t offset) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x flags=0x%x fd=%d offset=0x%"PRIx64 target_mmap_complete(uint64_t retaddr) "retaddr=0x%"PRIx64 +target_munmap(uint64_t start, uint64_t len) "start=0x%"PRIx64" len=0x%"PRIx64