From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910AbbJTPhv (ORCPT ); Tue, 20 Oct 2015 11:37:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51617 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbbJTPhs (ORCPT ); Tue, 20 Oct 2015 11:37:48 -0400 Subject: Re: [PATCH] tools lib traceevent: update KVM plugin To: Steven Rostedt References: <1443695293-31127-1-git-send-email-pbonzini@redhat.com> <56181F25.2070402@redhat.com> <20151020143244.GG4400@redhat.com> <20151020104459.7e7f7e77@gandalf.local.home> <56265B70.1000206@redhat.com> <20151020112648.4d323069@gandalf.local.home> Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, acme@kernel.org From: Paolo Bonzini X-Enigmail-Draft-Status: N1110 Message-ID: <56265FC7.9050409@redhat.com> Date: Tue, 20 Oct 2015 17:37:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151020112648.4d323069@gandalf.local.home> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/10/2015 17:26, Steven Rostedt wrote: > > > > What happens if you run new perf on an older kernel. Is this new plugin > > > > going to be screwed up? Plugins should be backward compatible. > > > > If you run new perf on older kernel, the new plugin will print the > > "role" field (see kvm_mmu_print_role) slightly incorrectly. That said, > > the existing plugin was _also_ printing the role in a wildly wrong > > format, like 2.6.35 vintage; the glevels field was removed by commit > > 5b7e0102ae74, "KVM: MMU: Replace role.glevels with role.cr4_pae", in > > April 2010. > > Can we add a check if glevels field exists, and do the old format if it > does? I'm very strict on making sure event-parse works with all > incarnations of kernels. Note that this is not a glevels _tracepoint_ field. The tracepoint field is "role" and it is a 64-bit integer. The plugin interprets the bitfields of that integer, and the position/meaning of the bitfields has changed. I guess I could use the mmu_valid_gen field as a proxy (it was introduced after glevels was removed), and only provide the "very old" (up to 2.6.34) and "new" (4.2+) formats. The "old" format (2.6.35-4.1) was never implemented in the plugin; it may well remain that way. However, it frankly seems a bit academic. The parsing _will_ work, apart from printing a nonsensical role just like it has always done for the past four years. Paolo