From nobody Mon Feb 9 17:59:01 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=1612194897; cv=none; d=zohomail.com; s=zohoarc; b=OW6b+HuDqutVQpmVs3jjQuYth2iK0+IZDu+H5LakVc58hqEbR3ZgSpMGlT1Rb6+r5Szsa5iNHW/osLsxrcG4PMyI5PRkvRHabiHeZSpSRtQIrVhf9NzjHcZ1fndBYPcYvs0wRpEJZVRkEko2idDp0E0NRmSiddrSxF62/xNkhtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612194897; 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=DqFcCLW9C4ba9+5x0bgEYXuonX7NMi1Ae5/v7kAMNnY=; b=S0WFnk19pnYPPMhIE7AN9/m3bMBjBB2mMrlJZm7ZDExUtkVv1W+lV7jjM7uRq3/fXj++T12NAvWLipNsefeqnbRpnqm/f7tpekKMJlL8Y+2piodon6hcFESJNRVKdapN6g1EbGsGbO2fQCE6S30K09YpFI6Bf5JCe4DcxkcLZOQ= 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 1612194897887844.4882945934544; Mon, 1 Feb 2021 07:54:57 -0800 (PST) Received: from localhost ([::1]:59444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6bXU-0007Jd-LK for importer@patchew.org; Mon, 01 Feb 2021 10:54:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bSx-0001cz-3G for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:50:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50151) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6bSt-00082q-Rv for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:50:14 -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-469-xLFdWpTcP827LMVNOvAecA-1; Mon, 01 Feb 2021 10:50:07 -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 8336615AA90; Mon, 1 Feb 2021 15:48:09 +0000 (UTC) Received: from localhost (ovpn-115-140.ams2.redhat.com [10.36.115.140]) by smtp.corp.redhat.com (Postfix) with ESMTP id 257915D6BA; Mon, 1 Feb 2021 15:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612194610; 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=DqFcCLW9C4ba9+5x0bgEYXuonX7NMi1Ae5/v7kAMNnY=; b=MpK5b9K0ig2qeChBAZmkKFXk/OgMd9N09e380fXeEjqhSr+NLI3VaW+5zo9Z4FEpFHBlEL 3irOpt+BZd/kZQXp+j/2tsU/6jIP4f3LfimyICcWf18Cj7EvMxkv63uAIW1yjvNIR9AChQ 685vz4N/vksNuQ9qJGEp1LJj0U13ZG4= X-MC-Unique: xLFdWpTcP827LMVNOvAecA-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL 11/11] trace: update docs with meson build information Date: Mon, 1 Feb 2021 15:47:03 +0000 Message-Id: <20210201154703.180022-12-stefanha@redhat.com> In-Reply-To: <20210201154703.180022-1-stefanha@redhat.com> References: <20210201154703.180022-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: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.351, 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 , Eduardo Habkost , qemu-block@nongnu.org, Markus Armbruster , Stefan Hajnoczi , Cleber Rosa , Paolo Bonzini 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 Message-id: 20210112165859.225534-3-stefanha@redhat.com 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 e8f9b82c5e..ba83954899 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