Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1608613imc; Mon, 11 Mar 2019 18:39:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfIeoxdLb0mOPGTkKKcWqErayZwrXXrP1CoKP2p1k9Tsa7u2W++wkLyW/dkHUTCFdXoxmq X-Received: by 2002:a17:902:e113:: with SMTP id cc19mr37740107plb.179.1552354779190; Mon, 11 Mar 2019 18:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552354779; cv=none; d=google.com; s=arc-20160816; b=w8pNksjc/oBT2odOGolmO8+DGX+P34xkV96VQl38mxxmXCGwBX3X2IGfNKgerEQgRn qnCha148pfMXU4Hv6jOEx10hmMkcGJkxG2Ljk5fWGfRcfGpPYJSaNThsEJWhzXO65dum ub/Lblh9yMEs3qJwA3pzdvAZhTlOi6BzYwvnFty1b5AghhJ6z24yTjYH85hIMcE29T48 f5sz/GBSYzs4dIG9sCBcMheJgo74uSewl2nEILrJ+D80vduF5wZmXQzjur6AZLRNd7t8 6rMooqwVPc9+oUfGy/VEI2SOW7Eiw2pa4auFuu1jt4HXxc44FAqzL1BqAEDg4KOAO151 JRTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HBZnBBRZF0aLfxcwwEv9vKZUR9S58Xw6VP7CJ7jv6AE=; b=Uv5Qt2pPbEu5Z+IimjAWbr7oczwcDmwcU9lcIIdIHJgbFblad2+dj57KmXt/wcUriq xmaUdSfcxkTwP9Ymkm3rlJdyvfiZPj3KCONtBDfVR6oVKAk4ePZR/5vs/z8rqVVBLa/S 4s1jesd9cLn2H/juE8Maf+ZnL87h9zM792jShCXSXaDrEObipAtBOfv7XGBJ1l2ABnfm uxT1y5ciKFyf9wigdWi34LaX2hS/TQ6EdEEfUyCbqIlFVsre5pPwyH0EEHGIEXMpvXs8 weAYlemGyfM3AURFrNEn3NXk53b/aJOvYnHsg3xJdtCn0A8wZoG4rVDE2ADraIXcXdEd G7Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=k7eUGz8M; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21si6727815pll.437.2019.03.11.18.39.23; Mon, 11 Mar 2019 18:39:39 -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=@google.com header.s=20161025 header.b=k7eUGz8M; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbfCLBjD (ORCPT + 99 others); Mon, 11 Mar 2019 21:39:03 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:43922 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbfCLBjD (ORCPT ); Mon, 11 Mar 2019 21:39:03 -0400 Received: by mail-qk1-f194.google.com with SMTP id s26so499348qkm.10 for ; Mon, 11 Mar 2019 18:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HBZnBBRZF0aLfxcwwEv9vKZUR9S58Xw6VP7CJ7jv6AE=; b=k7eUGz8MMFIl5qWLHfu9QVq8W5YLH22rwBpuI72b90BbmMeHxIiPG+BjVy0BhjdiDu RB4ZWLXoPwrFtNlBynOfm86eZ4xkpXJAH/f56W5JDjk4/Z0RAd5g8+toZvn/Ggz7dIU6 I7Rkt7yXkoaOpPEmcmIL8GWw49mhJduFS8UxGgguWTlVzcnYqbUsbsMi67dn8+mnAU4w 1XYCAQPMA26wKuMyhs5C3Ct193/3Zuyi2pfkzREBLincMllKXof6MyO3A3PfRlFnouxc B5a/toaBabQcir7pcdgJoCiWWnLrsmVEPgT7vvNo0heYK/BYwLGHfN1jApGINjLd+LC0 2O5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HBZnBBRZF0aLfxcwwEv9vKZUR9S58Xw6VP7CJ7jv6AE=; b=rwz1NqamztG9H60rqU/68T5dDMW8BiTj2J/mewPBjIwNhEe/MHdaFDqWupp8ftLGQB VrXr+fc16/0dY7TEc81ZiIfDTQ+VvAzbLJow3fr9Zb2l8AHHnMLeTEPaP7Msf7z7cBY9 2IdFnZYif/z5ztygXDYKu0gL7U+6JA9WWS/hLA2SUpWx0IuVSJdRfUzpsCkL0Jt6cQ2G wQSmCDtdECjDR2w9IdRMJpL/JSAyyPNMAcCSk6ju9z+CTKPJILMzVHZb0SH9E2nDWyMW YWCFzGVdEaLXpxp8bSw+dZHxG/mTn+O+zW9b6mY6Fy4yCvF2uhUbvYzg2dbtOCglN4GE DVjA== X-Gm-Message-State: APjAAAWvkkTqa1H8AJ1a9ekFk9pjU+lrsSVRnokaoOekwApmjA85GHLV RXkbc2ku3mdHI4JOezfIDY8V+gTDJu05xGIndEzOWQ== X-Received: by 2002:a37:ef19:: with SMTP id j25mr3463022qkk.176.1552354741560; Mon, 11 Mar 2019 18:39:01 -0700 (PDT) MIME-Version: 1.0 References: <20190308140251.GC25768@kroah.com> <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> In-Reply-To: <20190311212823.60684182@oasis.local.home> From: Joel Fernandes Date: Mon, 11 Mar 2019 18:38:49 -0700 Message-ID: Subject: Re: [PATCH v4 1/2] Provide in-kernel headers for making it easy to extend the kernel 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 Content-Type: text/plain; charset="UTF-8" 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 6:28 PM 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. Ok. > > 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. But there are macros and other #define things too. We lose all of them and can't recreate them from just DWARF (AFAIK). Including include/generated/autoconf.h which #defines the CONFIG options. For that we either need headers, or full kernel's sources with build artifacts. I do see a use case for the debug info you are talking about as you mentioned for the kprobe_events argument list types, and I already thought about it. But it does not seem to work for all the use cases I am referring to here. thanks, - Joel