From patchwork Thu Nov 28 19:46:03 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: 180465 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp646083ile; Thu, 28 Nov 2019 13:41:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzW3Qnzv4F+EghN8+FSEFbRrO9zKQ6SnfZ/cYO5ocOF0U3G0WTr1OqklzKcZLLtSD4jw4Vz X-Received: by 2002:a17:906:411:: with SMTP id d17mr56415962eja.299.1574977303093; Thu, 28 Nov 2019 13:41:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574977303; cv=none; d=google.com; s=arc-20160816; b=KQSoo/dZ2PjrqxBI5eA6++do9QJwJZLUmsZATZCoA7GXfsmZN+zRBxh+cNmXdC66VU KxmbJPm7PYIFafGM5wR0VsYp6H9pcPmdoa5GUR1pKZMc4UNT3luWEL/CrJVEL0K/TVpI /O3qD+Vc1jO1UvkWlHAQ+33ruwbYQcd49Iap2O9N/iK1ZjsxDiw8Z7B+Ci0+QnHbbQ9z IdYvBbF6LVxwbm3Dx/CUIBncJ2LryrKYOQHY4xRGMYq+d/1+bYpnXb6MQ6QZa4QTb7NT umwepsV2+LKj5wgje7I3FADrTCLCkwHgw8VOJoJMS8vgn9ia7ciC6JnT5JF9R32HeiIy KOcA== 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=IGkE42M4Q3eQbdw5NzOuWOoq/KgXpAh9fYfQ2Axv8vw=; b=Rlmwal6HFf9rX53682FF3gEtlaBambhnXiZSyec9m4K1A3ANuuDBAXZHhDcYsP455/ OH+4nytODbrM9DuJjzgzVNzMrUeLDvQ0SEu7UPXPG0wdLpPJZgQUBx/Lli9HJ6/XclH1 nBkBDDm7m8RMrcTXfQYlo6KMwLrvi4U5jh5Gnv8Mg0kvVAR8AZHj+jvjK8sUaVDM2aJe plfFOsddvle03WBeLaWfgBPzs30Vm0q9QFRKdnBVvkRuH5iw0hNUC/9Rc8IoZpJsQkQa Po/dUqPkZfR6XOphsMaveXI/phvqCqIEsN3V3CQbgPhEO59LXrwjDbNB3y9G1tolPXD0 vcNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=t5CELZuy; 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 i2si3597841edn.239.2019.11.28.13.41.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Nov 2019 13:41:43 -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=t5CELZuy; 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]:53422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaRXf-0001dA-29 for patch@linaro.org; Thu, 28 Nov 2019 16:41:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49050) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaPpP-0005c5-Ra for qemu-devel@nongnu.org; Thu, 28 Nov 2019 14:51:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaPk4-0005J9-IQ for qemu-devel@nongnu.org; Thu, 28 Nov 2019 14:46:23 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:40346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iaPk0-00057J-Qc for qemu-devel@nongnu.org; Thu, 28 Nov 2019 14:46:19 -0500 Received: by mail-wr1-x444.google.com with SMTP id c14so7825079wrn.7 for ; Thu, 28 Nov 2019 11:46:14 -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=IGkE42M4Q3eQbdw5NzOuWOoq/KgXpAh9fYfQ2Axv8vw=; b=t5CELZuy5IsnSKVq33/vHd6UsAbIp+WNKtT/fV6zNifx6sXJzyMpnMpwLBdlrYGI7P Jc8h0ZR0o30ZgS64CpEajP24pPnCUCNR079/oMc56yejh3RtOhpu8LPJZlWFk35yr49P 8yO2L5QUmUg1RpGjcBElMpfRy0YeHjwtZxBjZekgHiE8JBHXHGwkJnh8PNBhOOc8kNP5 BWnS46LIdOHUN9FjMov7Kwbj/R0pckcADMxrFE1Azp6vWsVQe+fdc4BNCvI0qy8ltwhy 9hw+Tuk50kr//ovJbkyyhkcT2zVlDMQrB8x0Eqpq0mOdsRCAkjaXoDZa1lmMcRNYUlj0 P8Og== 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=IGkE42M4Q3eQbdw5NzOuWOoq/KgXpAh9fYfQ2Axv8vw=; b=DrI9ateNLqJfbPAtCHq1Q08xvQgAxYkrf4dfN6rT0IyITUDE5I9j59bUhnXQ80UESw iv4Njn+2eBRo7MzXTZ3S4R/TLFovHblgje+/4T2yYwGblOgLVljZ27MZMZ7opb+RWLEh mZ4CfvfREiZJz/L8+YfXcjwUD5g4qH3PoAtWr4+8OQyMfHx+Z0ATUwqStc74K9kFDMFd FuaaU1c/+izxrWhJlWStXBvA8FsZvRQsneswrQUCf/KA2xEb+wZdJATQ6yvsXmtKYjZL UWpxlgtFg6UfQgG8eeY50eFOlJae0MnRDXSQVG38nG8B8RTvI9VMjxlFna31f9Xssayk Tbpg== X-Gm-Message-State: APjAAAWKM8IzoUA8fElq+9PEYJuJ43MEgzcSC1H+3bTlnfDFgGJmT55E zR+L0Z/U5HrMkdVQdCUTDRggpA== X-Received: by 2002:a5d:6886:: with SMTP id h6mr32189927wru.154.1574970372552; Thu, 28 Nov 2019 11:46:12 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r6sm11550494wrv.40.2019.11.28.11.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 11:46:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E20F51FF92; Thu, 28 Nov 2019 19:46:03 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 5/5] linux-user: convert target_munmap debug to a tracepoint Date: Thu, 28 Nov 2019 19:46:03 +0000 Message-Id: <20191128194603.24818-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191128194603.24818-1-alex.bennee@linaro.org> References: <20191128194603.24818-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::444 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: Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , 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 --- linux-user/mmap.c | 9 ++------- linux-user/trace-events | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/linux-user/mmap.c b/linux-user/mmap.c index c2755fcba1f..137aa3eb95f 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; @@ -639,11 +637,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 774280cefbd..bd897add252 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, char *flags) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=%s" target_mmap(uint64_t start, uint64_t len, char *pflags, char *mflags, int fd, uint64_t offset) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=%s flags=%s 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