From nobody Fri Apr 26 11:39:03 2024 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=1610471359; cv=none; d=zohomail.com; s=zohoarc; b=Nh4j7wLOVpDdcK0kqQgAPyff/6ouRPOH0xlk3MJRTQI4yjBdKgaq25BgjCw5SWjWDlhCgEIedFaxkL57IRlluftQBz51gOCZ0uSQO/7UjYO17PcTnTmA3wlJAazZbprqdT18k3RTkIgGeuOhDcHFrpzhKKfz4FbWXlz/+Hnp4i0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610471359; 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=EvluqyvHL46TVi/zPnd39YSu+etCx0hVbco7BNEVNEA=; b=RBN2kHbMHO4RnExDUBI8o7PJtxn1SOrljRFuqLYxLcadoPUxA0dwg6vA5udrYv5ABerCElfSXslZZ21cMaN5yJbBhb+im8C6nGjUYtUaOidF7PfJP1CcXzqydP0tlMUuu2mAQTySX2z/uQcWES6HpwRrGWT/wKn8KQSzxlFXX0E= 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 1610471359992258.51849317698475; Tue, 12 Jan 2021 09:09:19 -0800 (PST) Received: from localhost ([::1]:55438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzNAU-0004KP-PA for importer@patchew.org; Tue, 12 Jan 2021 12:09:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzN0l-0002lx-Gy for qemu-devel@nongnu.org; Tue, 12 Jan 2021 11:59:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kzN0j-0007Je-UX for qemu-devel@nongnu.org; Tue, 12 Jan 2021 11:59:15 -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-512-1mtjWTyHNk2THVEMV_lmmA-1; Tue, 12 Jan 2021 11:59:09 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DFF0801B1C; Tue, 12 Jan 2021 16:59:08 +0000 (UTC) Received: from localhost (ovpn-115-99.ams2.redhat.com [10.36.115.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4CD91972B; Tue, 12 Jan 2021 16:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610470753; 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=EvluqyvHL46TVi/zPnd39YSu+etCx0hVbco7BNEVNEA=; b=bXmSyvP/0SY4o83XkpdDVAX4Y0feSJ5hA7qOfjxN5nePorjXArKJ1JDCQwESkDoUJqFDVY YvVASpahYQ0ThBBQwkyIx+3gS79VecluCNwgReDPHDFgbzbB2gkF7H3z1v3L/ha+1+QKca 9Yc3uwRqdNK8DpFpbf1yQyvFaQvELYE= X-MC-Unique: 1mtjWTyHNk2THVEMV_lmmA-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH 1/2] trace: document how to specify multiple --trace patterns Date: Tue, 12 Jan 2021 16:58:58 +0000 Message-Id: <20210112165859.225534-2-stefanha@redhat.com> In-Reply-To: <20210112165859.225534-1-stefanha@redhat.com> References: <20210112165859.225534-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, 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_LOW=-0.7, 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" It is possible to repeat the --trace option to specify multiple patterns. This may be preferrable to users who do not want to create a file with a list of patterns. Suggested-by: BALATON Zoltan Signed-off-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- docs/devel/tracing.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index 4ebf8e38ea..8777c19d14 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -22,10 +22,15 @@ events:: 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 -More than one trace event pattern can be specified by providing a file -instead:: +Multiple patterns can be specified by repeating the ``--trace`` option:: + + $ qemu --trace "kvm_*" --trace "virtio_*" ... + +When patterns are used frequently it is more convenient to store them in a +file to avoid long command-line options:: =20 $ echo "memory_region_ops_*" >/tmp/events + $ echo "kvm_*" >>/tmp/events $ qemu --trace events=3D/tmp/events ... =20 Trace events --=20 2.29.2 From nobody Fri Apr 26 11:39:03 2024 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=1610472589; cv=none; d=zohomail.com; s=zohoarc; b=QgzwRivBU+2qXtPWPD6n/weZ1ku4v1NZlK7927dBxjhnInSK7sg0IUKtXBSd9norrSJskbdepLX/N6Q8kVZaZ7twyOyDz7jE3J2jCBgJNaXth4FYPQWt7+ZodQOiSjLLTSMgiKs9WPPh2ueo7vS+6wdQlmoChMK7J6o0mNCoj4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610472589; 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=IdO0iipLxY4DLMMSegvE5TJJhUonNfMd8o/MPM8aBsc=; b=VOB8m7U3IeduHeKsFSo6gWbfuvZ59mcs6hIXVlUtERr191avEqGUh045ADbppRcCQbLBX5+Y058xqxUCK9xrUxAr+YwYhSDrKPq94GVpnlvi23DAwx4zEZb21D+8NlSDMkW+Q1N4b/HwS4nF+rDVafBuGcMfRnDdsU605LnZMbQ= 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 1610472589356650.5753649111764; Tue, 12 Jan 2021 09:29:49 -0800 (PST) Received: from localhost ([::1]:54590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzNUK-0004BU-0N for importer@patchew.org; Tue, 12 Jan 2021 12:29:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzN0u-0002sr-8J for qemu-devel@nongnu.org; Tue, 12 Jan 2021 11:59:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kzN0r-0007LT-TC for qemu-devel@nongnu.org; Tue, 12 Jan 2021 11:59:23 -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-497-sN-XV2_vPUi4S6DRObEvpw-1; Tue, 12 Jan 2021 11:59:14 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 698F31081B30; Tue, 12 Jan 2021 16:59:13 +0000 (UTC) Received: from localhost (ovpn-115-99.ams2.redhat.com [10.36.115.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C5365D762; Tue, 12 Jan 2021 16:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610470758; 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=IdO0iipLxY4DLMMSegvE5TJJhUonNfMd8o/MPM8aBsc=; b=T8MEbouAjIqzlaV+7wTK7FLPn1drFh3BaWpUnpuNESbxwp5QC0H+buqtvteHviXSDOVAtE d+JIR/oxy9ILzCvuNf7lW/f3UfdBrOlOVsQgrCO3WhEy7ciHt29oOY3ggRKdIuivk9YsOI KKa8YgC0v/KIIs6zMw19U2tkvz86v/g= X-MC-Unique: sN-XV2_vPUi4S6DRObEvpw-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH 2/2] trace: update docs with meson build information Date: Tue, 12 Jan 2021 16:58:59 +0000 Message-Id: <20210112165859.225534-3-stefanha@redhat.com> In-Reply-To: <20210112165859.225534-1-stefanha@redhat.com> References: <20210112165859.225534-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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=216.205.24.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=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 documentation still refers to the makefile and the old sub-directory layout. Meson works differently: tracetool output is placed into the builddir with mangled filenames like /trace/trace-accel_kvm.h for the accel/kvm/ trace.h definition. This meson setup also requires a manually-created accel/kvm/trace.h file that #includes the /trace/trace-accel_kvm.h file. Document this! Reported-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- docs/devel/tracing.rst | 57 +++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index 8777c19d14..b58b37175d 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -39,40 +39,51 @@ Trace events Sub-directory setup ------------------- =20 -Each directory in the source tree can declare a set of static trace events -in a local "trace-events" file. All directories which contain "trace-event= s" -files must be listed in the "trace-events-subdirs" make variable in the top -level Makefile.objs. During build, the "trace-events" file in each listed -subdirectory will be processed by the "tracetool" script to generate code = for -the trace events. +Each directory in the source tree can declare a set of trace events in a l= ocal +"trace-events" file. All directories which contain "trace-events" files mu= st be +listed in the "trace_events_subdirs" variable in the top level meson.build +file. During build, the "trace-events" file in each listed subdirectory wi= ll be +processed by the "tracetool" script to generate code for the trace events. =20 The individual "trace-events" files are merged into a "trace-events-all" f= ile, which is also installed into "/usr/share/qemu" with the name "trace-events= ". This merged file is to be used by the "simpletrace.py" script to later ana= lyse traces in the simpletrace data format. =20 -In the sub-directory the following files will be automatically generated +The following files are automatically generated in /trace/ durin= g the +build: =20 - - trace.c - the trace event state declarations - - trace.h - the trace event enums and probe functions - - trace-dtrace.h - DTrace event probe specification - - trace-dtrace.dtrace - DTrace event probe helper declaration - - trace-dtrace.o - binary DTrace provider (generated by dtrace) - - trace-ust.h - UST event probe helper declarations + - trace-.c - the trace event state declarations + - trace-.h - the trace event enums and probe functions + - trace-dtrace-.h - DTrace event probe specification + - trace-dtrace-.dtrace - DTrace event probe helper declaration + - trace-dtrace-.o - binary DTrace provider (generated by dtrace) + - trace-ust-.h - UST event probe helper declarations =20 -Source files in the sub-directory should #include the local 'trace.h' file, -without any sub-directory path prefix. eg io/channel-buffer.c would do:: +Here is the sub-directory path with '/' replaced by '_'. For exam= ple, +"accel/kvm" becomes "accel_kvm" and the final filename for "trace-= .c" +becomes "trace-accel_kvm.c". + +Source files in the source tree do not directly include generated files in +"/trace/". Instead they #include the local "trace.h" file, witho= ut +any sub-directory path prefix. eg io/channel-buffer.c would do:: =20 #include "trace.h" =20 -To access the 'io/trace.h' file. While it is possible to include a trace.h -file from outside a source file's own sub-directory, this is discouraged in -general. It is strongly preferred that all events be declared directly in -the sub-directory that uses them. The only exception is where there are so= me -shared trace events defined in the top level directory trace-events file. -The top level directory generates trace files with a filename prefix of -"trace/trace-root" instead of just "trace". This is to avoid ambiguity bet= ween -a trace.h in the current directory, vs the top level directory. +The "io/trace.h" file must be created manually with an #include of the +corresponding "trace/trace-.h" file that will be generated in the +builddir:: + + $ echo '#include "trace/trace-io.h"' >io/trace.h + +While it is possible to include a trace.h file from outside a source file'= s own +sub-directory, this is discouraged in general. It is strongly preferred th= at +all events be declared directly in the sub-directory that uses them. The o= nly +exception is where there are some shared trace events defined in the top l= evel +directory trace-events file. The top level directory generates trace files +with a filename prefix of "trace/trace-root" instead of just "trace". This= is +to avoid ambiguity between a trace.h in the current directory, vs the top = level +directory. =20 Using trace events ------------------ --=20 2.29.2