[lkml]   [2017]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 16/18] tools include uapi: Grab a copy of linux/vhost.h
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:
> > 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

E.g., doing syswide tracing grepping for the newly beautified VHOST

# perf trace -e ioctl 2>&1 | grep VHOST
3873.064 ( 0.099 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dffe0) = 0
3873.168 ( 0.019 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dffe0) = 0
3873.226 ( 0.006 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, 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/ does these tests:

cd tools/perf

This is done everytime perf gets built.

- Arnaldo

 \ /
  Last update: 2017-08-02 16:19    [W:0.076 / U:28.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site