Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752443AbdHBOSn (ORCPT ); Wed, 2 Aug 2017 10:18:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:35310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbdHBOSl (ORCPT ); Wed, 2 Aug 2017 10:18:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E315922BE2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Wed, 2 Aug 2017 11:18:37 -0300 From: Arnaldo Carvalho de Melo To: "Michael S. Tsirkin" Cc: Ingo Molnar , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Adrian Hunter , David Ahern , Jason Wang , Jiri Olsa , Namhyung Kim , Wang Nan Subject: Re: [PATCH 16/18] tools include uapi: Grab a copy of linux/vhost.h Message-ID: <20170802141837.GG12201@kernel.org> References: <20170801195645.16986-1-acme@kernel.org> <20170801195645.16986-17-acme@kernel.org> <20170802001802-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170802001802-mutt-send-email-mst@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3071 Lines: 74 Em Wed, Aug 02, 2017 at 12:19:18AM +0300, Michael S. Tsirkin escreveu: > On Tue, Aug 01, 2017 at 04:56:43PM -0300, Arnaldo Carvalho de Melo wrote: > > From: Arnaldo Carvalho de Melo > > > > We will use it to generate tables for beautifying ioctl's 'cmd' arg. > > > > Cc: Adrian Hunter > > Cc: David Ahern > > Cc: Jason Wang > > Cc: Jiri Olsa > > Cc: "Michael S. Tsirkin" > > Cc: Namhyung Kim > > Cc: Wang Nan > > Link: http://lkml.kernel.org/n/tip-nxwpq34hu6te1m2ra5m7o8n9@git.kernel.org > > Signed-off-by: Arnaldo Carvalho de Melo > > Is this what tools/perf always does? Isn't there a way > to reuse the single header? So, that is how we did it at first, we tried to use files from the kernel from tools/ directly, and it worked most of the time. Shortest summary: We don't want to add to the workload of kernel developers, they don't have to care about tools/, if they don't want to. There are other reasons, but this is the main one, please take a look at these others in some other patches in this series, first the one that uses the files in the commit in this message: ----- commit ec6dd85f6e39bf516f4420d62270380b96bbee57 Author: Arnaldo Carvalho de Melo Date: Mon Jul 31 17:34:47 2017 -0300 perf trace beautify ioctl: Beautify vhost virtio ioctl's 'cmd' arg Also trying a new approach, using a copy of uapi/linux/vhost.h we auto generate the string tables, then include it in the ioctl cmd beautifier. This way either the KVM developers will add the new commands to the tools/ copy, like is happening with other areas of tools/include/ (bpf.h comes to mind), or we'll be notified when building perf that our copy drifted. E.g., doing syswide tracing grepping for the newly beautified VHOST ioctls: # perf trace -e ioctl 2>&1 | grep VHOST 3873.064 ( 0.099 ms): qemu-system-x8/21238 ioctl(fd: 27, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dffe0) = 0 3873.168 ( 0.019 ms): qemu-system-x8/21238 ioctl(fd: 27, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dffe0) = 0 3873.226 ( 0.006 ms): qemu-system-x8/21238 ioctl(fd: 27, cmd: VHOST_GET_VRING_BASE, arg: 0x7fff053dff60) = 0 ----- And on the cover letter for this patch series: ----- Using the current scheme of having tools/ copies of kernel headers we'll make sure tooling stays working when changes are made to the kernel ABI headers and will be notified when they get changed, reducing the time for 'perf trace' to support new ABIs and allowing the tools/perf/ codebase to have the definitions it needs to build in dozens of distros/versions, as routinely tested using containers for, at this time, 47 environments. ----- tools/perf/check-headers.sh does these tests: cd tools/perf ./check-headers.sh This is done everytime perf gets built. - Arnaldo