From patchwork Thu Dec 5 12:25:12 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: 180888 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2034327ile; Thu, 5 Dec 2019 06:21:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzcMpD0ay+1ECvcWcSKU2dm0yHftR/cllpffrDfzZnEGK/EC7eDfGX8Ayk8qs9MCIsJVJAu X-Received: by 2002:ac8:687:: with SMTP id f7mr7187080qth.390.1575555670245; Thu, 05 Dec 2019 06:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575555670; cv=none; d=google.com; s=arc-20160816; b=cDHfGWBVk92PgPW1WEVUXmNm4mDiWCIhOBMLAejYqp6ZzLsbrXZksvtsHNM2o+x2Hh I6QuiAYU+Ol38WPNfJtatHNIdx75K1TQ4lPwTQGikDRJ3MiEyohEflox6SejI4f1TLE6 KRtH2AWHfvbKx12Z4FauQlzoRnM4TnRCOr+IBLnEyzXqz1ZPDtDFsp1zGiFVTttz6+5V x82CUasDM4PIc6NCtbi6kCIudlui660nNmGx31byrBTMBNsKnOWx78xaoW3N+IKT5rMf nRtkI3AShbDdNW/sURAPiLkEE3EjczvHq246bZuNB7snG293cQ2u/GuLr0PjFMD9hvPs 2BBw== 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=AwS6rtyEJKyLkwzf8eig7lEH4N3AqTO23sBKCr3rUB4=; b=0m69X0vCM2JLyl9GobyZK2aCszg7ZPQ+8mIONyGd1QePRrty10KZJ+g7ZZn1FVYAbR Zy5BHtT78UpNgWGrafwYRQ9zBKdZgDtBIKYzUOma5mbaSNe0y3ErfUI7N8C95EG/2SkR TqB3zrnjyYqT/LaPB0dsObkErpxi3VNk5umrfluELIZy8xKBTafx2Z/mA1A9gXK/pAs2 C4DBXm0A9cs/EiAqFEysVpnT4MIHNJvg49jVX1K8IvF1Pu/fo0kkF6IhNsU5EDTyaRtI Mo5SXzejF8NjU34qNWGXvQ0g+phy5LV5DMNZ20Lv0JTjt76WlhYNSNBXzdALOIqu1NT2 +pEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GITKPgtu; 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 cz4si6055889qvb.146.2019.12.05.06.21.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Dec 2019 06:21:10 -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=GITKPgtu; 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]:55108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ics0D-0005ZQ-6p for patch@linaro.org; Thu, 05 Dec 2019 09:21:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56383) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icret-0002Sg-HN for qemu-devel@nongnu.org; Thu, 05 Dec 2019 08:59:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icres-0000Gv-77 for qemu-devel@nongnu.org; Thu, 05 Dec 2019 08:59:07 -0500 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:33008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icrer-0000A8-Re for qemu-devel@nongnu.org; Thu, 05 Dec 2019 08:59:06 -0500 Received: by mail-lf1-x12a.google.com with SMTP id n25so2606890lfl.0 for ; Thu, 05 Dec 2019 05:59:05 -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=AwS6rtyEJKyLkwzf8eig7lEH4N3AqTO23sBKCr3rUB4=; b=GITKPgtuLZtNwgUUIhehuyF0ahpDGuPSz0cQmbKFCVOXRMdjSlFOyyAfSX4/UzDFob NpoQRzy86EHaeywxWcKxQYH24mHynOyXcm7VF3Y/B6JvANnxFSo3x5Mu21yKW7uEpygH VYsaWvR7+WjV+QBel0CUGZ3ozbBAeUpKpBdWLe1/SQXCBZ7tO6DUS5ZU+EFeVRXze8oh 41CQeNvxCScQaMznoPHB9YMVY6oukYaKIfNZnCYJ2eUcN5/P4uzCn8LThp/I9a0WwIU3 K7P/PVgr0qcwbJRfuPWohIHAowL4cR6dvryjFIbEK47XOqd1MoDz6h0e/hL5FipJ9K8l F3/Q== 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=AwS6rtyEJKyLkwzf8eig7lEH4N3AqTO23sBKCr3rUB4=; b=r9DA9WL6W+iJVFvMSh+r0auIYdsPPjvHh03rSpS1Y5sftjasoKE5qK9mINyv6cXbvt EAHRv7PGNVbwvryhc/lqJVWh8hPnYeqNqcVMXV3zaxNBDh2S8VnJTZd/WxoJNRZ+VI8D WmVBQKcVmveHzRdziZm+VEciG3tUxzEMcUCd05SVfOUXVqRbo40RqSKOyGd/FPIBPmBr EC3ptcVtQPIDUuIzkdwS5r1J7Xo33tFbCLT1oRzriWnKs+KfNN8qiuVKqUBjFT+i/BTk ZKdEACmyabWMMdBxBHVewvGQtEAJLZy1NvlhTSjUKpUjREPHbADRtS6PqO8yz9fhiJjL pFuA== X-Gm-Message-State: APjAAAXKM30mxpb8redoTJiUt3kJUdIovNGdaPe1JFsGhYmSJfLb5a1m wAagjhSbmeX8ve/x9HIlVR3vFucNpyY= X-Received: by 2002:adf:afc2:: with SMTP id y2mr9867264wrd.254.1575548722558; Thu, 05 Dec 2019 04:25:22 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m7sm5054986wma.39.2019.12.05.04.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 04:25:18 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 255881FF8C; 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 1/6] linux-user: convert target_mprotect debug to tracepoint Date: Thu, 5 Dec 2019 12:25:12 +0000 Message-Id: <20191205122518.10010-2-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::12a 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" It is a pain to re-compile when you need to debug and tracepoints are a fairly low impact way to instrument QEMU. Signed-off-by: Alex Bennée --- v2 - don't both with ascii conversion --- linux-user/mmap.c | 10 ++-------- linux-user/trace-events | 3 +++ 2 files changed, 5 insertions(+), 8 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 46a6e3a761a..26a83e74069 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -17,7 +17,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" - +#include "trace.h" #include "qemu.h" //#define DEBUG_MMAP @@ -66,13 +66,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot) abi_ulong end, host_start, host_end, addr; int prot1, ret; -#ifdef DEBUG_MMAP - printf("mprotect: start=0x" TARGET_ABI_FMT_lx - "len=0x" TARGET_ABI_FMT_lx " prot=%c%c%c\n", start, len, - prot & PROT_READ ? 'r' : '-', - prot & PROT_WRITE ? 'w' : '-', - prot & PROT_EXEC ? 'x' : '-'); -#endif + trace_target_mprotect(start, len, prot); if ((start & ~TARGET_PAGE_MASK) != 0) return -TARGET_EINVAL; diff --git a/linux-user/trace-events b/linux-user/trace-events index 6df234bbb67..8419243de4e 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -11,3 +11,6 @@ user_handle_signal(void *env, int target_sig) "env=%p signal %d" user_host_signal(void *env, int host_sig, int target_sig) "env=%p signal %d (target %d(" user_queue_signal(void *env, int target_sig) "env=%p signal %d" user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_psw_addr) "env=%p frame psw.addr 0x%"PRIx64 " current psw.addr 0x%"PRIx64 + +# mmap.c +target_mprotect(uint64_t start, uint64_t len, int flags) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x"