Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1236ybh; Tue, 21 Jul 2020 14:43:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDFmOGvHpVVPs2CQ3p0MdOKWwZxhdsOPQip0Nu+h7Ilbnia46K3+/JorNyv6A0ilGIU5fq X-Received: by 2002:a50:d513:: with SMTP id u19mr26929880edi.241.1595367803944; Tue, 21 Jul 2020 14:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595367803; cv=none; d=google.com; s=arc-20160816; b=nSmi5dX3OBsNc12UPj3JyGbjDqVEJTi1wqhnJTmwqmrWGem+vjTiOkJZJBRBTE43MS TMwHooBvhXe5h/AJg9AUbLOZLfjSTTDDSjRixw3QosWRJ0iH090E278A1gtU3NEFCWoN 1CRhBkaw/Gs6sOkd3s30HKT0EcqLInZyoCbYYFgEQQQ1cLoMYQsbo/IxlCFHkDgRB0bl 1bBHXeHmN5ilXi3MZpnsqF9qGosGDVUo3u/87jDQvyJiMHPh8NOU4PtVZyhQDk+TtNiD KgPVhayw22TCqfz+wjiiYRXAK+96sOiTapZsbVpabs5+ffHAjnhVt6FfYnQq/Gz7hy5k FqpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ZPQba0OMujV/1y6r2sJE2iwMspMtRvMsHRgUNfI8weU=; b=1FwQt82YVSstCsfFbcCw4soX33bO5wFtBU1yf9AApQMZXRZBgVlNK+hWe47KiBxmy2 nhMTyRtOluRsHC+vO1SBXXKNkzryXoYVnbaxUn11Q5K60NW2QTzvImrmNiLAXaNQCvBc MBdqQfnUIsK2uyeCYyGqTCWI5GYPsWPaEPZEhXRfRMNvqDYEtl1qNg1qeurIMNCQ2YTc q5yvyZ3KbbH6juO1FHu99dOfz728ZfFedaM89UZQS0u+xhnrbhoM7tO/SyuHSAku5gSQ 1v5ZTny9WdE3GnOmYCU8IvCqmJMXZO/dSgF9QYA2Dws86FUNvV5L4ixSMbTpgqh7LVMz MpXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si11943039edx.588.2020.07.21.14.43.01; Tue, 21 Jul 2020 14:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731054AbgGUVmg (ORCPT + 99 others); Tue, 21 Jul 2020 17:42:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:58840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbgGUVmg (ORCPT ); Tue, 21 Jul 2020 17:42:36 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4231420709; Tue, 21 Jul 2020 21:42:35 +0000 (UTC) Date: Tue, 21 Jul 2020 17:42:33 -0400 From: Steven Rostedt To: Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH 6/7] KVM: x86: Use common definition for kvm_nested_vmexit tracepoint Message-ID: <20200721174233.411fba7b@oasis.local.home> In-Reply-To: <20200721193130.GH22083@linux.intel.com> References: <20200718063854.16017-1-sean.j.christopherson@intel.com> <20200718063854.16017-7-sean.j.christopherson@intel.com> <87365mqgcg.fsf@vitty.brq.redhat.com> <20200721002717.GC20375@linux.intel.com> <87imehotp1.fsf@vitty.brq.redhat.com> <20200721193130.GH22083@linux.intel.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 Jul 2020 12:31:30 -0700 Sean Christopherson wrote: > +Steve > > Background: KVM has two tracepoints that effectively trace the same thing > (VM-Exit vs. nested VM-Exit), but use completely different formatting and > nomenclature for each of the existing tracepoints. I want to add a common > macro to create the tracepoints so that they capture the exact same info > and report it with the exact same format. But that means breaking the > "ABI" for one of the tracepoints, e.g. trace-cmd barfs on the rename of > exit_code to exit_reason. Feel free to update it. > > Was there ever a verdict on whether or not tracepoints are considered ABI > and thus must retain backwards compatibility? > > If not, what's the proper way to upstream changes to trace-cmd? > There's a kvm plugin in the libtraceevent code. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/lib/traceevent/plugins/plugin_kvm.c This overrides how the events are read. In the callback handler (e.g. kvm_nested_vmexit_handle()), you can test if "rip" is there or not. If it is not, you can do something different. For example: struct tep_format_field *field; field = tep_find_any_field(event, "rip"); if (field) { tep_print_num_field(s, "rip %llx ", event, "rip", record, 1) [..] } else { /* do something new */ } You can test if fields exist and have the plugins do different things depending on the format of an event. This is what I do in case an event changes in the future. -- Steve