Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2596864imc; Tue, 12 Mar 2019 18:20:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeenIvi5GZa/WQpAYA5v8auW8CK4ffsyicQUc7jlSBFLJrDilEUPidR6GFVDDrTImZKx93 X-Received: by 2002:a17:902:9a88:: with SMTP id w8mr42998097plp.8.1552440052579; Tue, 12 Mar 2019 18:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552440052; cv=none; d=google.com; s=arc-20160816; b=BM4WGhI1GYAU8xNf8xIDV+saD5Q2fT1/tHBvNCxUaXYoaWemiqhXzR9ftQReDZOL4J cEM8PKOX5HAojP5btOGV4AMFUOquq5328QL2W+Fzx4dRmhFPQ9PJJz6eLV02hRPtxE1C xXee6zKAlcUPxPXtD+95nI57bJs0oSauxBS33PTVR+TTJNIqPb2AZYDT4LHVydAyTDdm PzhDfsMFXLGhhRIzYyxcnUWNct84iQl6eal2G3harsVa6/ZCrqX7/eJfDSsu4DQfRlkP CSFjv17IEYlkHsfLThBO3ky+JoErwI0enCag6anfXw5LJr9gOre/SpIu+u0LrbodSCO9 +3yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=I2D3MoXyOv9k8lRE6gz1CaOCQ5TKXBSIIusHnklpz04=; b=EeJ0S1XcEtA9om0iQ8V6lH2bxnh8y/qFpgKx8ntg9/8bJ6aWMQLvfO1/H4SCUi9/5M JpfKajjXkV4sUhUzbG23sXmSfuKfujB9EZ/Sx8tMl71aDKjNg55lNt9sznnwBuPNrr/l A9izfzhjZIvvgi0QQ1qdRZG/h34kCtgAeHwPAB0MeUeTUoFWL0IjIZ1XTX/biX/j57iN tDcGsUqEFGbwVWGQBSxKBlqFqitvRzrNMkOE0VgxuYn3KhAHRGSGBPupNr78mw8d1VzE BxD2Y0c4kmK2GMJHoUYqqUwkcfy0IkW5VUI4GEUQhO3U20JDHEVN4ICubWgpdjTSqRul 9uhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2FUb4f4e; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j97si9764391plb.292.2019.03.12.18.20.36; Tue, 12 Mar 2019 18:20:52 -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=@kernel.org header.s=default header.b=2FUb4f4e; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726747AbfCMBSx (ORCPT + 99 others); Tue, 12 Mar 2019 21:18:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:33996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfCMBSx (ORCPT ); Tue, 12 Mar 2019 21:18:53 -0400 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F11BD2171F; Wed, 13 Mar 2019 01:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552439931; bh=RgwH5rsy0vHUZudERZYU4v2QMra3BIv3Y4JztssEOfI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=2FUb4f4eniif1ed390uE14DJr2XNeFbFI6ozTKH6nUU2Okzjs4mKdxuxVM2Hlc8DY cn6dnyAn05FsLCL2LwlZDgSPBnssJe05KU05Z5tCIGPGTSowoI3pWW96NwOPI43dLE MpkhFhAQJWDVW7jRv29shlEtDY7RyqAN/uiGmCrc= Date: Wed, 13 Mar 2019 10:18:43 +0900 From: Masami Hiramatsu To: Joel Fernandes Cc: Steven Rostedt , 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: <20190313101843.800dd8d6a9babb635580ebdc@kernel.org> In-Reply-To: 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> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 Mar 2019 18:38:49 -0700 Joel Fernandes wrote: > 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. What kind of macros would you concern? > 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. But the eBPF is based on kprobe-events. What kind of usage would you expected? (with macros??) Thank you, -- Masami Hiramatsu