From nobody Mon Feb 9 23:00:48 2026 Delivered-To: importer@patchew.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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608158610; cv=none; d=zohomail.com; s=zohoarc; b=AC15dlnLjUimdrUPFwSgNqflAi4LZF8O/dOr+O34uR+9lLWdyrZzsydreK5oNbiUpPBVuE+5L57PKwfatBNaWmq0e+TOhMgewwJaMvVotrzJUDZ3/glARD2SQ7Y+F3vimCOQIoCKT/PYSuYZWCnWgIF877/3YW5Xabhe0mX0Xr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608158610; 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=RHtbWKrNnLqKWNmeW4kVS2g/BYQBgIgc0+Chp7Q5jgk=; b=c1IeS+ZAeOC0cGlgS1A8jS4e8R2JNQfDXiWbV8vwHDq47ierb/62MfJFUDC0dQIUELLuZ4Xla1WQ9xgAMZWXQ21Eo84Iv+K8cu+JCSlFrPdsbox9+QdiUz0aY0WOatrW/kTTlBuN3n0hURxqe182bKhv+9HIoLuF17cRLh21reA= 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 160815861091758.585578950774675; Wed, 16 Dec 2020 14:43:30 -0800 (PST) Received: from localhost ([::1]:56130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpZS5-0004wJ-Ix for importer@patchew.org; Wed, 16 Dec 2020 11:14:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpZN4-000894-UO for qemu-devel@nongnu.org; Wed, 16 Dec 2020 11:09:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kpZN2-0004fW-Af for qemu-devel@nongnu.org; Wed, 16 Dec 2020 11:09:45 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-12-gLyDFBUtMOqERtJKbLTX6g-1; Wed, 16 Dec 2020 11:09:41 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B68E3192202C; Wed, 16 Dec 2020 16:09:40 +0000 (UTC) Received: from localhost (ovpn-115-151.ams2.redhat.com [10.36.115.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BDEB1E5; Wed, 16 Dec 2020 16:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608134983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RHtbWKrNnLqKWNmeW4kVS2g/BYQBgIgc0+Chp7Q5jgk=; b=IbHCui1lOqw3coWbvNnRf6Kdzmy8XteJCFMVlkdYCH7g58mV3+vS4gsSFqd6X2uHaiBgt/ XlzMEIxnQv3hwG5pdshom0t1QffHnK4Sb2/zk8dgK/f5IGngxez4ea/bHNDAp5k5enlcT0 1crn7gQ8xXcIjgkP7ztXOenvPpiKHTo= X-MC-Unique: gLyDFBUtMOqERtJKbLTX6g-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH v2 3/3] trace: recommend "log" backend for getting started with tracing Date: Wed, 16 Dec 2020 16:09:23 +0000 Message-Id: <20201216160923.722894-4-stefanha@redhat.com> In-Reply-To: <20201216160923.722894-1-stefanha@redhat.com> References: <20201216160923.722894-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=stefanha@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The "simple" backend is actually more complicated to use than the "log" backend. Update the quickstart documentation to feature the "log" backend instead of the "simple" backend. Suggested-by: Peter Maydell Signed-off-by: Stefan Hajnoczi Reviewed-by: Peter Maydell --- docs/devel/tracing.rst | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index 76cc1b24fa..e60058bf55 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -11,22 +11,22 @@ for debugging, profiling, and observing execution. Quickstart =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -1. Build with the 'simple' trace backend:: +Enable tracing of ``memory_region_ops_read`` and ``memory_region_ops_write= `` +events:: =20 - ./configure --enable-trace-backends=3Dsimple - make + $ qemu --trace "memory_region_ops_*" ... + ... + 719585@1608130130.441188:memory_region_ops_read cpu 0 mr 0x562fdfbb382= 0 addr 0x3cc value 0x67 size 1 + 719585@1608130130.441190:memory_region_ops_write cpu 0 mr 0x562fdfbd2f= 00 addr 0x3d4 value 0x70e size 2 =20 -2. Create a file with the events you want to trace:: +This output comes from the "log" trace backend that is enabled by default = when +``./configure --enable-trace-backends=3DBACKENDS`` was not explicitly spec= ified. =20 - echo memory_region_ops_read >/tmp/events +More than one trace event pattern can be specified by providing a file +instead:: =20 -3. Run the virtual machine to produce a trace file:: - - qemu --trace events=3D/tmp/events ... # your normal QEMU invocation - -4. Pretty-print the binary trace file:: - - ./scripts/simpletrace.py trace-events-all trace-* # Override * with QE= MU + $ echo "memory_region_ops_*" >/tmp/events + $ qemu --trace events=3D/tmp/events ... =20 Trace events =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -195,7 +195,7 @@ script. =20 The trace backends are chosen at configure time:: =20 - ./configure --enable-trace-backends=3Dsimple + ./configure --enable-trace-backends=3Dsimple,dtrace =20 For a list of supported trace backends, try ./configure --help or see belo= w. If multiple backends are enabled, the trace is sent to them all. @@ -227,10 +227,11 @@ uses DPRINTF(). Simpletrace ----------- =20 -The "simple" backend supports common use cases and comes as part of the QE= MU -source tree. It may not be as powerful as platform-specific or third-party -trace backends but it is portable. This is the recommended trace backend -unless you have specific needs for more advanced backends. +The "simple" backend writes binary trace logs to a file from a thread, mak= ing +it lower overhead than the "log" backend. A Python API is available for wr= iting +offline trace file analysis scripts. It may not be as powerful as +platform-specific or third-party trace backends but it is portable and has= no +special library dependencies. =20 Monitor commands ~~~~~~~~~~~~~~~~ --=20 2.29.2