From nobody Tue Feb 10 13:18:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1575555591; cv=none; d=zohomail.com; s=zohoarc; b=W5RlIbcGGaP0CLA0qCwaLljf4uPTNkJ1T494qxEE+UORMUIYvmKlvALk0hHiQGrow3mcim42d6gWXkiveV72zGnmcGrTPbssKqNrVFWdBlvikAeR6nJ6+lJJ8aef6Aep053y6++/Kn04PHUhpbxTCWK1m8q+UcKFMQH04G5tdIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575555591; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AwS6rtyEJKyLkwzf8eig7lEH4N3AqTO23sBKCr3rUB4=; b=lL/E1Jhn6Xjzr+34rF9mpTGr14DRJEIY8UOoz9yPDD8c4vRqWewz7FY69wBKo6dOzEFlkLrHq8Z52bYJRmAUG13HevjaVCyb8ugb0IDnB/AvgdZi0M/kYetHjJOPRucZtoorjr5Ddy4U+U/2HVBmpR/r3xfamJqvqJR8UGV16Vs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1575555591307471.1713643888014; Thu, 5 Dec 2019 06:19:51 -0800 (PST) Received: from localhost ([::1]:55076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icryv-0003pC-L8 for importer@patchew.org; Thu, 05 Dec 2019 09:19:49 -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) 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) 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-Google-Smtp-Source: APXvYqxdZQiBR/wTXpkxm7aGqIElK/gMI6of//oXsbN9ZEzJh3oZ9pqYMfwlwJFuNI4BsWc8BTYk1g== X-Received: by 2002:adf:afc2:: with SMTP id y2mr9867264wrd.254.1575548722558; Thu, 05 Dec 2019 04:25:22 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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=C3=A9e Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson --- v2 - don't both with ascii conversion --- linux-user/mmap.c | 10 ++-------- linux-user/trace-events | 3 +++ 2 files changed, 5 insertions(+), 8 deletions(-) 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" =20 //#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; =20 -#ifdef DEBUG_MMAP - printf("mprotect: start=3D0x" TARGET_ABI_FMT_lx - "len=3D0x" TARGET_ABI_FMT_lx " prot=3D%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); =20 if ((start & ~TARGET_PAGE_MASK) !=3D 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=3D%p s= ignal %d" user_host_signal(void *env, int host_sig, int target_sig) "env=3D%p signal= %d (target %d(" user_queue_signal(void *env, int target_sig) "env=3D%p signal %d" user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_p= sw_addr) "env=3D%p frame psw.addr 0x%"PRIx64 " current psw.addr 0x%"PRIx64 + +# mmap.c +target_mprotect(uint64_t start, uint64_t len, int flags) "start=3D0x%"PRIx= 64 " len=3D0x%"PRIx64 " prot=3D0x%x" --=20 2.20.1