From patchwork Thu Dec 5 12:25:16 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: 180885 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2020985ile; Thu, 5 Dec 2019 06:11:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzdh4tgb8Vqae7smyrOe+GIphoZUETGlXgQ1jpPKqdo38gyz6BgcIEj6rMgbBOOy4PstzP5 X-Received: by 2002:a0c:8061:: with SMTP id 88mr7710253qva.62.1575555064975; Thu, 05 Dec 2019 06:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575555064; cv=none; d=google.com; s=arc-20160816; b=gxd1GHKptBmmznhnek5buO3lC10IJmLebVk+Ygdm0DERrV0dBaQQeu5pH3PzVLLIJH wNhLLqf3zHqk3JpqiUFx3Okjqe5o9ew2H73S+yQXKtCBSQtYfN6THZ7jkwJceyid/nSd SvflnngkcH9HYO+X1ZgYcyi02lBZMsutHQD646MPpftI5u7fjJ9F7AogiS/bkU3RZigJ Zp65VW4VTj07aG26kpGq/yl0CIbTcndE7UBPtp0MarIVVTcrSlJY4PKglGWaDBUVE2eY tfsrqpYuY95dt/oElA5ZC7VQGANZ60kZRZ5nFTon5LUTQqVohx+QrwE7OD8gcTtxk0jz hbIw== 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=LlKAQUU8BKqjO5SGyRq373lXLOzaiq/UNvhXOUrnIRc=; b=lpb4trDANT+QUXKbpAwqbokoAfHurl0zXtXEi2bC/CMo8u+i/39pEQIcRWFiHA/QOh YwntwkXq0i7xn5DPRNYDgebttTJWtat6kp2+qmmw87jBz0FAFKLzVGlySotoMXXbru5Y 65bkflihaX8DP8QjocRmQkwa4GwLg/Bb8v/Uzgqf0WkSCXrUUizGPL1d8ULbfOnmP9Wj vvRwfGlSlwUbZYlkZ10kaC92zOkm+DTPlFYYIO6iv0BLFy7wefd41crQg3u0C3gQlFRZ PrC2lIb7AADGGqrqwRhyHo9Khc936LkpIpOqLXe/DSeeep6G4Wn7WZ5yfC6g09XbqbW3 +9mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PnkFp6iw; 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 y16si6459795qka.107.2019.12.05.06.11.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Dec 2019 06:11:04 -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=PnkFp6iw; 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]:54944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icrqR-0005bC-Hr for patch@linaro.org; Thu, 05 Dec 2019 09:11:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36642) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icrnW-0001z4-AA for qemu-devel@nongnu.org; Thu, 05 Dec 2019 09:08:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icrnU-0006Mr-Uh for qemu-devel@nongnu.org; Thu, 05 Dec 2019 09:08:01 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:46823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icrnU-0006Es-L3 for qemu-devel@nongnu.org; Thu, 05 Dec 2019 09:08:00 -0500 Received: by mail-wr1-x442.google.com with SMTP id z7so3696269wrl.13 for ; Thu, 05 Dec 2019 06:08:00 -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=LlKAQUU8BKqjO5SGyRq373lXLOzaiq/UNvhXOUrnIRc=; b=PnkFp6iwJHjJz5h4WFjkI0alqjBMd1+8kTpKE8H0jcyRQIY8Xu9PxjqlShj/GfZxOJ AR1UgiQfnS+hSiz3S98XmqRggV5a1ht7JN7ZrJJ2lu4zLshalRb9WTNIatbQM+GL10y6 miuyiQLVClhZWSZz6AeiWN3udkVhLFC46yTuCeFgDTz/IXPgpUQgp49X920SJ4ac2+o7 HYYqeYCOkzw3DiIeIuCDEOlT9Xk2lj2NvwBHaiU4Vkg2/ElUjfbc5fVbepyjZJ63fZvI gUxTgW0uhov6oOxlxlD/QswX3eBzeqK8R/LXhdok4rr/4a0pePK+mp6TfVUJdu+YL+wS z5rA== 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=LlKAQUU8BKqjO5SGyRq373lXLOzaiq/UNvhXOUrnIRc=; b=iI/RonqgHwVdnEn1dOGrTQfb2+q6laKxeK6Rrjqb3OtJ8c87D6JdkfSv7St6a2qxXt qnY+vFAI8pM4IPy1pwSz5OZqXFUfsDGv7kPQaAFyVcxpEjfG1MWdB7l5OZ3vnaLQiwts bFO4lpjJZSds4KYzYaQBN7aB9oV8k5B1Fw1ASxpu7I7KTQC75xf/LKhcJbwGTC5EAoDr SPgSR/Zg01texl4WeQI2TzB72m+7XtGm61e0Bi+l9KpJi37kOYtMQZiEt9ESLMrbcDiV CU1Q9tMFS8iFV/10hmt78YcA5LOaITva82yhoo9eT0WbQMU/TO4t16wRLP8GzL/kfKPj mx2A== X-Gm-Message-State: APjAAAXxjuMCxgoxyK/nVw3f8QHqrWJHgq8Rvs3Dfe/vjGB1MjBwPMPl oVSFg5Ls5Au01ayzHImU8R/lOfZPuXg= X-Received: by 2002:adf:f581:: with SMTP id f1mr10237571wro.264.1575548727599; Thu, 05 Dec 2019 04:25:27 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u10sm10125668wmd.1.2019.12.05.04.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 04:25:23 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7EB841FF92; Thu, 5 Dec 2019 12:25:18 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 5/6] linux-user: convert target_munmap debug to a tracepoint Date: Thu, 5 Dec 2019 12:25:16 +0000 Message-Id: <20191205122518.10010-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191205122518.10010-1-alex.bennee@linaro.org> References: <20191205122518.10010-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::442 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?= , 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 --- linux-user/mmap.c | 9 ++------- linux-user/trace-events | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) -- 2.20.1 Reviewed-by: Laurent Vivier 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