From nobody Tue Oct 22 23:38:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1729262726; cv=none; d=zohomail.com; s=zohoarc; b=Iq0V2aVbzfDHTvFMSueG8IFJ4zpWUNrXpI8YMW7nx8g7jkwl/4VBJvHb/0PxMIbOrN408w1F9RKaqEoDd+XZP1L7mbtOoLQ87fdQKZgy2CEt04g07NtCFeE6hI5pOAHNADat8IQl1h4QqD4TPJMpxld/t14jN9DEdu6cF4vp9Kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1729262726; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eqvcMv9fdiTSg98pEWDzr99aw1UQnXlSysZyeqn3YP0=; b=Wy+z5jX2whHNPZq9zeFeGn4zfBBvHyVxv9Isb9Kl+HECfIjMNF/9Y6Q4ym1G/Ff8PHuTQmGL2ehtjmOZFWslGQhGoc8nuQevOFY1zKMCMx/t+BVMnY0EEVLcXAEDFmUoqW5droUXPJ0dV1+W5ItgK9lLKOhq/OBnqmd4ySdk8fM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1729262726221436.0662801139092; Fri, 18 Oct 2024 07:45:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1oDe-0001Vd-Qy; Fri, 18 Oct 2024 10:44:47 -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 1t1oDT-000195-P3 for qemu-devel@nongnu.org; Fri, 18 Oct 2024 10:44:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1oDP-0002ea-4j for qemu-devel@nongnu.org; Fri, 18 Oct 2024 10:44:32 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-182-zs-JDimKPuGzeB2y-OFXgw-1; Fri, 18 Oct 2024 10:44:29 -0400 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7b14fc05206so285409285a.2 for ; Fri, 18 Oct 2024 07:44:29 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b156f8b2cdsm75435785a.8.2024.10.18.07.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 07:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729262670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=eqvcMv9fdiTSg98pEWDzr99aw1UQnXlSysZyeqn3YP0=; b=MGj0a7zhqMskipJ6VESncYNfu5w1J5nLdktf5sm0HKhx0FwF3j/CdOB5zugbRUI6MkdSwo fqnNCXohOlfGVPaGhq/I58YK2tvkA98tA0rjcN11qPUh2vQv6zqoCkAv9H89xFagsnjguC QYTv3HnbjaO2rRoRFQ/rCVLD2e+lWUI= X-MC-Unique: zs-JDimKPuGzeB2y-OFXgw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729262668; x=1729867468; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eqvcMv9fdiTSg98pEWDzr99aw1UQnXlSysZyeqn3YP0=; b=LxeSbPCruFZfZgKVE+QauqzCdAYZWHWk4i25ZxFf5ClixFxh25sVEQfUPjz7bhKsv+ X8LUUeTLHxuzHpvWhI2ndGdTJ48OtGBPyyCGw9TZB0/r92zYfC9agTSaMKQK9bLx6tmU tEKjPr/HOn13pD8x1xIbMVigLBHsT80ye/GgFNsnQilJ/h2KZWI4QJPKfgGAkfSAI6S1 MaRXJqc+NShNOgsZdqyj7ObUoyJAIhTf7t307fS/UO+jCp21FzhMD7/h+C5ywSowyiWf vr2hnkbNbVvXy5WuaEigmB3y8aYAJTLXkHr5b3cQi5DMa9NEBg9kH5l3hfb4RbDnjXVI itaA== X-Gm-Message-State: AOJu0Yy8qaEGct1MMN8bysnwzEQN3h9sp2O0oJfJDITkiG0WWKJMhxEc M2eimM+Sclt63VHlBdhiflUPmsICXvPon49EQwE7qkOhq88yqZyfPTMhWTrgCKWvwYhniXcbawh lQZ4CYzpj30OkIwgMQ6daILIuyLVyzfS+4NPMxPniRUiAkV/gXP5rxaqSU/ASlSm9A0W64zpv8R IQCqc7WxvTLywFQ8dwT7QJf74ZIbH5sm34nA== X-Received: by 2002:a05:620a:29d3:b0:7af:cdf9:8c30 with SMTP id af79cd13be357-7b157b7c7c1mr343680585a.37.1729262668357; Fri, 18 Oct 2024 07:44:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBNiWxcnCjx9+YuVNWKg30Dw+MMqWOzctQKULgyC0zAnuB3EzZp+1fJjOWO5S+ypHGRjFOOA== X-Received: by 2002:a05:620a:29d3:b0:7af:cdf9:8c30 with SMTP id af79cd13be357-7b157b7c7c1mr343676785a.37.1729262667924; Fri, 18 Oct 2024 07:44:27 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: peterx@redhat.com, Laurent Vivier , Fabiano Rosas Subject: [PATCH] Migration: Add trace points for vmstate handler insertion/removal Date: Fri, 18 Oct 2024 10:44:26 -0400 Message-ID: <20241018144426.826802-1-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.016, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1729262727658116600 Content-Type: text/plain; charset="utf-8" SaveStateEntry has lots of magics internally, on alias_id, get_id() being able to overwrite the original idstr, compat fields, ID_ANY, and so on. It may not be always clear that what all these fields are being registered for some device we care. Add trace points for SaveStateEntry insertions/removals, so that we know what was being registered. For insertions, we dump everything that might be useful. For removal, only section_id is needed because that's the unique identifier for an SeveStateEntry. Cc: Laurent Vivier Cc: Fabiano Rosas Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas --- migration/savevm.c | 7 +++++++ migration/trace-events | 2 ++ 2 files changed, 9 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index e796436979..57f058bd40 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -718,6 +718,11 @@ static void savevm_state_handler_insert(SaveStateEntry= *nse) =20 assert(priority <=3D MIG_PRI_MAX); =20 + trace_vmstate_handler_insert( + nse->idstr, nse->instance_id, nse->alias_id, nse->version_id, + nse->section_id, nse->compat ? nse->compat->idstr : NULL, + nse->compat ? nse->compat->instance_id : 0); + /* * This should never happen otherwise migration will probably fail * silently somewhere because we can be wrongly applying one @@ -754,6 +759,8 @@ static void savevm_state_handler_remove(SaveStateEntry = *se) SaveStateEntry *next; MigrationPriority priority =3D save_state_priority(se); =20 + trace_vmstate_handler_remove(se->section_id); + if (se =3D=3D savevm_state.handler_pri_head[priority]) { next =3D QTAILQ_NEXT(se, entry); if (next !=3D NULL && save_state_priority(next) =3D=3D priority) { diff --git a/migration/trace-events b/migration/trace-events index 0638183056..3411f2f699 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -50,6 +50,8 @@ vmstate_load(const char *idstr, const char *vmsd_name) "%= s, %s" vmstate_downtime_save(const char *type, const char *idstr, uint32_t instan= ce_id, int64_t downtime) "type=3D%s idstr=3D%s instance_id=3D%d downtime=3D= %"PRIi64 vmstate_downtime_load(const char *type, const char *idstr, uint32_t instan= ce_id, int64_t downtime) "type=3D%s idstr=3D%s instance_id=3D%d downtime=3D= %"PRIi64 vmstate_downtime_checkpoint(const char *checkpoint) "%s" +vmstate_handler_insert(char *idstr, uint32_t instance_id, int alias_id, in= t version_id, int section_id, char *compat_idstr, int compat_instance_id) "= id=3D%s instance_id=3D%"PRIu32" alias_id=3D%d version_id=3D%d section_id=3D= %d compat_id=3D%s compat_instance_id=3D%d" +vmstate_handler_remove(int section_id) "section_id=3D%d" postcopy_pause_incoming(void) "" postcopy_pause_incoming_continued(void) "" postcopy_page_req_sync(void *host_addr) "sync page req %p" --=20 2.45.0