Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1612351imc; Mon, 11 Mar 2019 18:46:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyceicJbgENR15qHK31kmXmd3d8x+KkDC8K4fJqAhr/Hq3eejBwYRrerjfatsf5O1O6cFIV X-Received: by 2002:a65:4bcc:: with SMTP id p12mr11888033pgr.187.1552355200671; Mon, 11 Mar 2019 18:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552355200; cv=none; d=google.com; s=arc-20160816; b=KjfYk5OGJYbNUBwhy/gWIE9qeV579/ykZ4rwNIDkA3AEDj12+Tdv7B8jyZTUVC9GIq xVoebPF2qKrVH1PnVhOAjZypBluuSJOAndJFZMI/ZNihCi/zVDwTyiYbM/PJebXa7/05 fNmGteuLGPuj9vZVWh1n7AOn77Br28KrPBGNkttOwOs6GZqGN80y1n9c1X7XqFGK8DJe GZx8fWfCjQfUbeEcRieYreo7gNLt/Jd/R1bUkUu6GSWWCG0AEJJvhIyJQU4s5giRj4cH qKGFwLEW+cKvJkcgCN2Cnx1vJRmpFElBiGOGkG/fVzAQhYyMygHB2yOIIH37horEAKHQ 4MoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TfkFOI9Syjr0HfQxSUDH8FDRCp9ri4E/0CE66t2/jTs=; b=Id3gMlf5i4b+zpiudZPJyQqVc6D4iokqG3uCqXWrwVQvv2XbqoKmZoXW/hRbWDe1aa fm0+XtjF5wijYCV59s495oVWCoeebSMxcU3ocpQNaINFJX7aXT3kB9GT6cxDTBfio7vm yN/n7s05M1f0pN8zrjvVRggM9ZYspoj3FFl9cY9ASnZZf4OIh5rmHYgzFm2T/9sfWbVW F8MYEdBLMtM4wh+Ng8EOLxGLhE49MfCXNjAYUoftPa8UIrcgBnXDK0HbppOsMivsAGUI 8y/2LBP9I7C5jZOxHgZTXb+4kiQ2WoRJfT/dmZ/QHF/nBtMfDvt0kad8OXlXwX0fP7sP m2jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eiuA49yf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si3032221ply.103.2019.03.11.18.46.24; Mon, 11 Mar 2019 18:46:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eiuA49yf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbfCLBpc (ORCPT + 99 others); Mon, 11 Mar 2019 21:45:32 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34030 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfCLBpb (ORCPT ); Mon, 11 Mar 2019 21:45:31 -0400 Received: by mail-pf1-f195.google.com with SMTP id u9so615011pfn.1; Mon, 11 Mar 2019 18:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TfkFOI9Syjr0HfQxSUDH8FDRCp9ri4E/0CE66t2/jTs=; b=eiuA49yf4iOB/MdhyItJu1hP8sM7PPoPi67M77GHGuIAUWisGp7zWOusep9INVq8Wv OxuVW+OIAbCdb+YTQ2KdYmtpemFmDFolx0bA3N2dpKYFRiw872+gUG+GkjAOXwS8aLeC FWIeFKkD60zsYB8AQ7j7ZGDfAtCMudu0811IWYgdZtHDhYO2EgFneG4xnm8aIrSOLEXF GU8c6zE2falkoT9+YliqDuyhw9HTpX22Jb/MkmZ2RoIz9kCnYAefV8DFX9gwe0xrw4Zd Vvknz/FXORMZwi2S1VE0NEagn8/UXBTYVMWI6Y/Bt/ofMG/h+Ix9CVgBNUDty8Erdgdp jt/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TfkFOI9Syjr0HfQxSUDH8FDRCp9ri4E/0CE66t2/jTs=; b=Xhgz/rsiaZXZa4MdgVzW8oL0KSOP2+g51gPfbGfDpJ1kCW3MLH3tnasdroCW0nvnVs kEtQcFvBaNDPITOC+YmAbtd4OwPcsYuZnBltJiq8lihaH2RmbEaH9IUfCaV1vRMutV0/ D0vuenJGF4Rqr+VYBL1M/XCnTHCbhVJlQYVWeR64BNvKB8RCfX5AE2zo1e5kjnYbzmeE r4nBhakPWHCqi5fq9vZkt4akSdxzONSWIWvjNur849klO2be4bPkkyTxBTy5unSH9gX9 Roc5+9zAJbgkGQBW6U78Uiv9gYmvvUlyYhExbKfYE3MXZzbV2H0M3A3Li5qNrMjDcgzE H48g== X-Gm-Message-State: APjAAAXGjF+Y5J6A84O+U65G1xurxLzdo+CNmcQHC6T68d62YpnX8w4F 4nnBEL38vTcMRr2QTiiMOmc= X-Received: by 2002:a17:902:9a01:: with SMTP id v1mr31774767plp.34.1552355130187; Mon, 11 Mar 2019 18:45:30 -0700 (PDT) Received: from ast-mbp ([2620:10d:c090:200::2:263e]) by smtp.gmail.com with ESMTPSA id b65sm15496395pfm.127.2019.03.11.18.45.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 18:45:29 -0700 (PDT) Date: Mon, 11 Mar 2019 18:45:24 -0700 From: Alexei Starovoitov To: Steven Rostedt Cc: Joel Fernandes , Daniel Colascione , Karim Yaghmour , Geert Uytterhoeven , Greg KH , LKML , Andrew Morton , Alexei Starovoitov , atish patra , Dan Williams , Dietmar Eggemann , Guenter Roeck , Jonathan Corbet , Kees Cook , Android Kernel Team , "open list:DOCUMENTATION" , "open list:KERNEL SELFTEST FRAMEWORK" , linux-trace-devel@vger.kernel.org, Manoj Rao , Masahiro Yamada , Masami Hiramatsu , Qais Yousef , Randy Dunlap , Shuah Khan , Yonghong Song Subject: Re: [PATCH v4 1/2] Provide in-kernel headers for making it easy to extend the kernel Message-ID: <20190312014522.jfxg3pdav2piuaqs@ast-mbp> References: <20190309071648.GE3882@kroah.com> <20190309121141.GA30173@kroah.com> <3e84e1ef-e266-e983-5874-6c26ac7f38b8@opersys.com> <20190311193612.4f09bf11@oasis.local.home> <20190312003912.GA170478@google.com> <20190311212823.60684182@oasis.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190311212823.60684182@oasis.local.home> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 11, 2019 at 09:28:23PM -0400, Steven Rostedt wrote: > On Mon, 11 Mar 2019 20:39:12 -0400 > Joel Fernandes wrote: > > > I think even though the kernel-headers can't have information about all data > > structures, they do already contain a lot of data structure definitions we > > need already. And anything needed can/should arguably be moved to include/ if > > they are really needed for kernel extension by something "external" to the > > kernel such as kernel modules or eBPF, right? > > That's not my worry. I would like to be able to easily walk data > structures from within the kernel, without having to do a lot of work > in userspace to get that information. The kprobe_events could then be > passed type casts or such to access data fields of arguments to > functions and such. > > > > > In any case, such a solution such as what Steve suggested, still cannot do > > what we can with headers - such as build kernel modules on the fly using the > > C-compiler without any auto-generation of C code from any debug artifiacts. > > Think systemtap working with the module-backend without any need for > > linux-headers package on the file system. So such a solution would still be a > > bit orthogonal in scope to what this proposed solution can solve IMO. > > > > With the information I would like to have, it would be trivial to read > the data to create the header files needed for modules. what you're asking for we already have. It's called BTF. pahole takes vmlinux dwarf and convert it into ~1Mbyte of BTF that includes all kernel types. With gzip it can be compressed further if necessary. We also have a prototype to generate all_vmlinux_types.h from BTF. But it's not a substitute for kernel headers. We've had a long discussion during last LPC regarding this: http://vger.kernel.org/lpc-bpf2018.html#session-2 tldr: many tracing use cases will be solved with BTF, but kernel headers are here to stay.