From patchwork Thu Dec 19 10:49:29 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: 182090 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp317529iln; Thu, 19 Dec 2019 02:59:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwc1+WphwBfJ0ZK4TqApdqHXwfYLmSPfl7rrRqAGdZ/dbSBtErj+6KnLSMoKNUvwDQXgJgg X-Received: by 2002:a05:6214:982:: with SMTP id dt2mr6656340qvb.174.1576753190936; Thu, 19 Dec 2019 02:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753190; cv=none; d=google.com; s=arc-20160816; b=d06IMBM8yF2OHK53uEqCochuVOTgbJcZqvn313YdK0ZTu0zC1TD/TztdegZO4T7QzY x49sHF+A69v/SREboptxGtPl4XB3CetYAVXOiSj2Zjcvtv50PywJqiaHEnXaqagUxOce DLMMVkzpZ9AQlPQ9NkFLHPoEyeor3KkL2aelEqjz8bfiO1MgToHJzEJvXxlRHBZvizb5 uMDUW5L9BgGbqum/UzJdX7e47OIEfQ/jMEKKURNrtRTINMAlowQ9s2h4YckS/82xK8iX ZaGbVkYmUqL+Nz5RTqGunCVWdnJJe184VrMHzIpgeyAlfPX/2fQD483IPppdtg3huOYC dyow== 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=vwsTQPLMkDuqXqnHi4Oibs2v+97DJuoFfknErpqUpNE=; b=YvdG5I/MSo20lPj2hrdO2mHCteWTUNyUfGcyAllF/Jw4VR/80JNRvAzx+29e5YHhhQ DuhA2g1k4hZTPr+jYM1NZAoVUDCjoEYVqcGZJd1k886pjd/5MQAO94WoRQZCGQVu1kRU yfZ8H9cNv2PVb+dQdG7fxKiQe/G3mCEY7JnYb6+TD+u4r4OMSWc/XuiSHPFz/dCp/mPK G0l+Qwme+uJBhX7OHJqtxlgTk2G3SfwbFba7kZ1lz+GcVpxps35AHbM9xHlGlIHqAFvl IBffhS5VctcVUi16Myw5bLfWIpbMVQOud16qBl768ksKG0cJLAz6gFkiq8odF0hdBslj vmTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Af9MJSlw; 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 p6si2867204qtq.354.2019.12.19.02.59.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:59:50 -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=Af9MJSlw; 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]:38968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtX3-00042K-R7 for patch@linaro.org; Thu, 19 Dec 2019 05:59:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56551) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWa-0003i9-7I for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWY-0000eQ-NE for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:19 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:45671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWY-0000VY-F5 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:18 -0500 Received: by mail-wr1-x433.google.com with SMTP id j42so5479467wrj.12 for ; Thu, 19 Dec 2019 02:59:18 -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=vwsTQPLMkDuqXqnHi4Oibs2v+97DJuoFfknErpqUpNE=; b=Af9MJSlwmcFM1EyaVAjOHCcP/0vc/RH8OufuqYNjr+v2PEiw92eL/9YcIkadDD7Ecc 1h66rs5r/VGb0d6uV3foNFneNrrizUXCxJD9FuHje+VelPLuQLMbUsnahZutIQ1EGbdx knOTwHpLSVrlrO6eDPm5Ha10a5DrvBVsV5lkNZe4xS7lFlFJBNXLKp1MVD12QBpqVcKD 6u01T4ZtrrZXmwkn6WFETBMtwY4QrdkchxzJVGvcht5D07RMimy2rBkzb46qMZSQ3xs2 m1AMlgxUjnxtetxF6rfFi3zFt2363OqpBM7KymSR5Zvowa6/+zXC86mq+ISlAdVb4AHs Gxgg== 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=vwsTQPLMkDuqXqnHi4Oibs2v+97DJuoFfknErpqUpNE=; b=st2iEteRYDY1clSdNfGD6eSZo8tol8+jWCSQ0MLhGUv/KUm/WW3J4f5hiee57Q3hAN YQNe3ldRCrhszVX5+wcAzuNELDw2nbzVfOzxhClKbVsPUCwz9LcRMPsn4F+vhr4WmHH0 tYZ0wKP6izdzNNzy8N7KRWeU8kLoEFy+RecpBy/UsvXnhzy0bI8UnRo7xHJ1RUmHxzOg y05XaEjqRy9rOCO4McdmU1oGQgENi29wbicWrTjXu4howGPEyUYw8wS2jm1uRZWn6WM2 rakPIea3ehMgB7b4RfOen7zBRMTp8AyyxIqrErYPZiHLb9mBDjP23OxOtWVIZNV0kyRC 04iQ== X-Gm-Message-State: APjAAAUVaKtZB562e5ZXGQbGGx8Kf8B9Ta38EXlypiL5f6sDedFw3XfO u+y2UbkGf74JMX29u/ByDwk4+Q== X-Received: by 2002:a5d:55d1:: with SMTP id i17mr8496917wrw.165.1576753156608; Thu, 19 Dec 2019 02:59:16 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f1sm5962764wru.6.2019.12.19.02.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5C5DF1FFAA; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 20/25] linux-user: convert target_mmap debug to tracepoint Date: Thu, 19 Dec 2019 10:49:29 +0000 Message-Id: <20191219104934.866-21-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::433 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" 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 Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191205122518.10010-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 26a83e74069..f4f10deaeac 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -363,32 +363,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, abi_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len; mmap_lock(); -#ifdef DEBUG_MMAP - { - printf("mmap: start=0x" TARGET_ABI_FMT_lx - " len=0x" TARGET_ABI_FMT_lx " prot=%c%c%c flags=", - start, len, - prot & PROT_READ ? 'r' : '-', - prot & PROT_WRITE ? 'w' : '-', - prot & PROT_EXEC ? 'x' : '-'); - if (flags & MAP_FIXED) - printf("MAP_FIXED "); - if (flags & MAP_ANONYMOUS) - printf("MAP_ANON "); - switch(flags & MAP_TYPE) { - case MAP_PRIVATE: - printf("MAP_PRIVATE "); - break; - case MAP_SHARED: - printf("MAP_SHARED "); - break; - default: - printf("[MAP_TYPE=0x%x] ", flags & MAP_TYPE); - break; - } - printf("fd=%d offset=" TARGET_ABI_FMT_lx "\n", fd, offset); - } -#endif + trace_target_mmap(start, len, prot, flags, fd, offset); if (!len) { errno = EINVAL; diff --git a/linux-user/trace-events b/linux-user/trace-events index 8419243de4e..8d8d4c3c68c 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -14,3 +14,4 @@ user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_psw_add # mmap.c 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