From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1818C433C1 for ; Mon, 22 Mar 2021 12:05:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9B7A60240 for ; Mon, 22 Mar 2021 12:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9B7A60240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOJIp-0003QV-PF for qemu-devel@archiver.kernel.org; Mon, 22 Mar 2021 08:04:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOJHu-0002zK-AV for qemu-devel@nongnu.org; Mon, 22 Mar 2021 08:04:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOJHr-0002kI-NB for qemu-devel@nongnu.org; Mon, 22 Mar 2021 08:04:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616414638; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=QtplmnR9ZwVmTpOtQTRUgc3Lv447otPaozVxZv0xSpo=; b=FmeojcETJv8cpySly49WGsHjSz9cjDCXXC/MltWHR2a8FBDvJuxdZe2mlfl7USHTDe6KUt jvr/6bNfzyeC+tL5578BMU4ourp8l/uUZxr7+im4jZHZFECXMuOJylEeq5gycXgikDzjRe WlG4/j+cs58L/WzLcinyTRnN3oPinVI= 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-13-e7UTYLnDPJKshNj0pFOkzw-1; Mon, 22 Mar 2021 08:03:54 -0400 X-MC-Unique: e7UTYLnDPJKshNj0pFOkzw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A8B884E20A for ; Mon, 22 Mar 2021 12:03:53 +0000 (UTC) Received: from redhat.com (ovpn-112-245.ams2.redhat.com [10.36.112.245]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAD0017D7E; Mon, 22 Mar 2021 12:03:45 +0000 (UTC) Date: Mon, 22 Mar 2021 12:03:42 +0000 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Gerd Hoffmann Subject: Re: [PATCH v3 0/8] [RfC] fix tracing for modules Message-ID: References: <20210121125028.3247190-1-kraxel@redhat.com> <20210203163202.GF241524@stefanha-x1.localdomain> <20210222151332.vea6cszd4pwtkeno@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: <20210222151332.vea6cszd4pwtkeno@sirius.home.kraxel.org> User-Agent: Mutt/2.0.5 (2021-01-21) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=216.205.24.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, 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: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Cc: "Dr. David Alan Gilbert" , Markus Armbruster , Stefan Hajnoczi , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, Feb 22, 2021 at 04:13:32PM +0100, Gerd Hoffmann wrote: > Hi, > > > > TODO: > > > Enabling modular tracepoints via -trace cmd line doesn't work yet. > > > Guess we need to store the list somewhere for later re-processing. > > > Error handling is tricky, specifically the "tracepoint doesn't exist" > > > error. Suggestions / ideas are welcome. > > > > Two ideas: > > > > Global trace event name list > > ---------------------------- > > Build *some* global information about all trace events, including > > modules, into the main QEMU binary. For example, generate an array of > > all trace event names so QEMU can always print an error if a > > non-existent trace event name is used. (This is similar to the > > trace-events-all file, which is a global list of all trace events.) > > > > Module name prefixes > > -------------------- > > Allow an optional module/group prefix like qxl:my_trace_event. When the > > user says: > > > > --trace qxl:my_trace_event > > > > QEMU knows that this trace event belongs to the "qxl" module/group. It > > will not attempt to load it until the qxl module registers itself. > > > > If "my_trace_event" doesn't exist in the qxl module: > > 1. If the qxl module is not loaded we don't hit an error. Nevermind. > > 2. When the qxl module is loaded pending events are resolved and an > > error is printed. > > Finally found the time to look at this again... > > So, we already have a "group". Which is basically the sub-directory of > the trace-events file right now, and it seems to be mostly a build system > thing. We get many small lists instead of one huge, but there seems to > be no other effect. We could change that though, by giving each group > an (optional?) prefix. > > There also is a probe prefix, apparently used by dtrace only. Not sure > how to deal with that. It prefix is qemu--. > Giving qemu modules its own dtrace prefix looks sensible to me. That > would probably something like "qemu-module-". The prefix is used by the systemtap backend. It lets us define friendly probes, scoped for each QEMU emulator target. eg a trace point "dma_map_wait" gets mapped to probes in many .stp files, once per target, because we need to match based on the executable path: probe qemu.system.x86_64.dma_map_wait = process("/usr/libexec/qemu-system-x86_64").mark("dma_map_wait") probe qemu.system.x86_64.dma_map_wait = process("/usr/libexec/qemu-system-ppc64").mark("dma_map_wait") probe qemu.system.x86_64.dma_map_wait = process("/usr/libexec/qemu-system-aarch64").mark("dma_map_wait") there is nothing here that reqiures us to change the prefix for a module - we can carry on using the same systemtap probe name whether modules are used or not. Currently we kind of unofficially have a convention that the name of a trace point should reflect its functional area. So all QXL related probes have a name prefix "qxl_". We could make that explicit, by having the trace-events files support a group, IOW instead of qxl_destroy_primary(int qid) "%d" qxl_enter_vga_mode(int qid) "%d" qxl_exit_vga_mode(int qid) "%d" We could say that a dot separates the group from the probe name, and thus have qxl.destroy_primary(int qid) "%d" qxl.enter_vga_mode(int qid) "%d" qxl.exit_vga_mode(int qid) "%d" this would be backwards compatible, as we can turn the "." back into a "_" for all existing trace backends, except stp. NB this is all tagential to use of modules at a build system /runtime level. I think this explicit grouping of probes would make sense for everything, to make the naming convention explicit instead of implicit. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|