From patchwork Fri Jul 5 08:40:10 2024 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: 810350 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1507506wru; Fri, 5 Jul 2024 01:41:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNOTvUKzFyXhvNeVkb91Vy1ffzFpiVE78zlnXFx2g7CzWDhUZNLCVAhjdid8xistAx2xqIjKdRIWpbcyfYgL+z X-Google-Smtp-Source: AGHT+IGBsfaMNHpmOIjvD6OquFNk19hJejDxFor4Xh33AWPAiLYZcjFS5upWiJiH/Fh64Ssegc/U X-Received: by 2002:ad4:5cac:0:b0:6b0:8fa9:6cac with SMTP id 6a1803df08f44-6b5ed194ef3mr45134006d6.57.1720168892200; Fri, 05 Jul 2024 01:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720168892; cv=none; d=google.com; s=arc-20160816; b=C3UTDNF83yiN8iS2oAOvTNVgjjLHBItuC2IsLc/sb+v8PixMF7kesGbLFc1aAQRuYe pm2P4PR/X5aaRXa0hh/9kgIL39vnJuIj8KaE2jbsdPRGH4h8723V/eMw1MCqy6L7BxPe u1uppdmnSz73QMI/7Cft2jlQhv953z/v0PZAN2XWfhacdCK+KbWfdieZPpboBVhm8G5y ZAB9CNqN9Ub4Y3zmEMCRpY1jpaLLcNpMcchIuLroLpca9FjQ3WAicWcmZ3YSks7s4Ito iCDD/TjHRzmOrKlXvPN+lOe2iKbwjVZbmHcRZesC0q8gYzWEJ/0Ha/kUDNuy4qaHeorK M/LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=lFrU6v/HY4VIQITgassfFHdNS/uhlHYlsqE77XfqPZs=; fh=fOmDb3LWEc8YYk2jJaPNBibuO+xI4aDvcJfVffKo+VU=; b=BoWhfcYpCdoDrOKgbbokmWeG3XoiQjD19XcFwGY6mzQpxvzGHyi7JmLE0ehPTI41cM FLgQ+ub2SwXrXqUE/7NWucMNWbFhfTcA0rgI+3iYH0B3/wCZxNM0ze6Ary4SELYc2cFg 2ktL2/8x1j3N+9U5hSfRrtGZ5DeVDk5LR9DufFTa8ejs6kK9XOP8CFfIefONRR355rSC xY+sbA+Avu/OMWIHjiDmzHVhtG1oFWS/pZIgkDDPJALvF+BEXCIpQF+zsRkyFdsUbrfW HWA3ZmE3BPWH9dd+sFmvWeVXZILQWaufMUjjOr5Sl1kykWwebzsXAWD+2sHAP3SB+zMD U8Xw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AzkkqL45; 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=pass (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 6a1803df08f44-6b5e4dd5d09si45757986d6.106.2024.07.05.01.41.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2024 01:41:32 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=AzkkqL45; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPeV1-0008Q9-3O; Fri, 05 Jul 2024 04:40:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPeUy-0008Oz-Lt for qemu-devel@nongnu.org; Fri, 05 Jul 2024 04:40:56 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPeUv-0003Ay-6s for qemu-devel@nongnu.org; Fri, 05 Jul 2024 04:40:56 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-58b447c513aso1603325a12.2 for ; Fri, 05 Jul 2024 01:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720168850; x=1720773650; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lFrU6v/HY4VIQITgassfFHdNS/uhlHYlsqE77XfqPZs=; b=AzkkqL450gSHHsGVLbtLqWdfec+mJ03Lhh673oDIwb8ypGeUDu8dBt+148Zd99sy5j 4mvM6Vi+xIZc1rya7pJ9fR3p4xbn5FD6w+iXuB9nzBjbCGhWEQ2fmdDsbnxsf6biHZ+3 B85HTqa+YAxRSj6YsdKYFdht55i9R+ZAPnBb+qZbhrcIKgDKruV/QWOrpyylfx9ekCSP pAPjHg7OzZE4BncJdw/HWwdu1rt8uak/S5FQL76sFPpjGadNuDYYUiS2LHpqGmF0Zwn2 hZKRBJEok2eiaXCRF4/1OW1oozmBYzZn1vJvbZ/W0oEyNKGXOn4r3yte2bSI6FFsAuqh +BEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720168850; x=1720773650; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lFrU6v/HY4VIQITgassfFHdNS/uhlHYlsqE77XfqPZs=; b=AXaFWGVwFp48+n9RkUEp9kSoaH7jEgSlpHB9X19nknDd391Wj4OwaUgw5oxPFdn3kW kSUM/j+H95Dql94DKoHbrfR9SvoEcImJKoSmieC9CdwfLHsLnyIseZvvkMMmsAh/Koda XmCqle2ZtaddZ2EB6X3LiNiC7iKKA40O1e8vvK9RzWO0REKPp5KkC3TACAVsh71CdJaJ +xxByx5QL5ZEQWcR4C8jjMh+xNJwSiJhVAClzBsmUoovJncAuCCWI31nyUxbjqABvf/S 4O7YdKVhKrEhKn2cRPkmLLMA3P5QCflZpZn6RtD/o7bHe/FASejdQ5MdJYbpJRC7YSUU WKdA== X-Gm-Message-State: AOJu0Yy/zf2AN84Z5rU+nARZZIq3rv4MIQiw9wT+ZNyXH+2iEfoM2XJ0 DPyMswFyfGjzE3AIBChj5OGOAZoj0oiiuwBar49LGET9vr3q8jTgJ4e7zt859KY= X-Received: by 2002:a05:6402:278e:b0:58b:fd23:7065 with SMTP id 4fb4d7f45d1cf-58e5aec8d0amr2298950a12.16.1720168850164; Fri, 05 Jul 2024 01:40:50 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-58ad8730dcfsm5113394a12.7.2024.07.05.01.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 01:40:49 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F102B5F92B; Fri, 5 Jul 2024 09:40:47 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Beraldo Leal , David Hildenbrand , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Alexandre Iooss , Thomas Huth , Mahmoud Mandour , Peter Maydell , qemu-arm@nongnu.org, Aleksandar Rikalo , Mads Ynddal , Yanan Wang , Eduardo Habkost , Peter Xu , Richard Henderson , Marcel Apfelbaum , Paul Burton , Stefan Hajnoczi , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Subject: [PATCH v2 03/40] tracepoints: move physmem trace points Date: Fri, 5 Jul 2024 09:40:10 +0100 Message-Id: <20240705084047.857176-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240705084047.857176-1-alex.bennee@linaro.org> References: <20240705084047.857176-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org They don't need to be in the global trace-events file and can have a local trace header. Also add address_space_map tracepoint for tracking mapping behaviour. Message-Id: <20240628124258.832466-5-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - dropped qatomic_set which came from another patch --- system/physmem.c | 4 +++- system/trace-events | 6 ++++++ trace-events | 5 ----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index 261196cde0..14aa025d41 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -53,7 +53,7 @@ #include "sysemu/hostmem.h" #include "sysemu/hw_accel.h" #include "sysemu/xen-mapcache.h" -#include "trace/trace-root.h" +#include "trace.h" #ifdef CONFIG_FALLOCATE_PUNCH_HOLE #include @@ -3193,6 +3193,8 @@ void *address_space_map(AddressSpace *as, MemoryRegion *mr; FlatView *fv; + trace_address_space_map(as, addr, len, is_write, *(uint32_t *) &attrs); + if (len == 0) { return NULL; } diff --git a/system/trace-events b/system/trace-events index 69c9044151..2ed1d59b1f 100644 --- a/system/trace-events +++ b/system/trace-events @@ -21,6 +21,12 @@ flatview_destroy(void *view, void *root) "%p (root %p)" flatview_destroy_rcu(void *view, void *root) "%p (root %p)" global_dirty_changed(unsigned int bitmask) "bitmask 0x%"PRIx32 +# physmem.c +address_space_map(void *as, uint64_t addr, uint64_t len, bool is_write, uint32_t attrs) "as:%p addr 0x%"PRIx64":%"PRIx64" write:%d attrs:0x%x" +find_ram_offset(uint64_t size, uint64_t offset) "size: 0x%" PRIx64 " @ 0x%" PRIx64 +find_ram_offset_loop(uint64_t size, uint64_t candidate, uint64_t offset, uint64_t next, uint64_t mingap) "trying size: 0x%" PRIx64 " @ 0x%" PRIx64 ", offset: 0x%" PRIx64" next: 0x%" PRIx64 " mingap: 0x%" PRIx64 +ram_block_discard_range(const char *rbname, void *hva, size_t length, bool need_madvise, bool need_fallocate, int ret) "%s@%p + 0x%zx: madvise: %d fallocate: %d ret: %d" + # cpus.c vm_stop_flush_all(int ret) "ret %d" diff --git a/trace-events b/trace-events index dd318ed1af..9cb96f64c4 100644 --- a/trace-events +++ b/trace-events @@ -37,11 +37,6 @@ dma_complete(void *dbs, int ret, void *cb) "dbs=%p ret=%d cb=%p" dma_blk_cb(void *dbs, int ret) "dbs=%p ret=%d" dma_map_wait(void *dbs) "dbs=%p" -# exec.c -find_ram_offset(uint64_t size, uint64_t offset) "size: 0x%" PRIx64 " @ 0x%" PRIx64 -find_ram_offset_loop(uint64_t size, uint64_t candidate, uint64_t offset, uint64_t next, uint64_t mingap) "trying size: 0x%" PRIx64 " @ 0x%" PRIx64 ", offset: 0x%" PRIx64" next: 0x%" PRIx64 " mingap: 0x%" PRIx64 -ram_block_discard_range(const char *rbname, void *hva, size_t length, bool need_madvise, bool need_fallocate, int ret) "%s@%p + 0x%zx: madvise: %d fallocate: %d ret: %d" - # job.c job_state_transition(void *job, int ret, const char *legal, const char *s0, const char *s1) "job %p (ret: %d) attempting %s transition (%s-->%s)" job_apply_verb(void *job, const char *state, const char *verb, const char *legal) "job %p in state %s; applying verb %s (%s)"