Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp700807imm; Mon, 2 Jul 2018 21:08:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKsfmkgWOZp6JJw3k3bO3vQHwKkqNlHYSx9xEC3vweArAnXj2vMsTlRb91tR6ra/7/QxWKb X-Received: by 2002:a17:902:be0b:: with SMTP id r11-v6mr29293454pls.182.1530590912681; Mon, 02 Jul 2018 21:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530590912; cv=none; d=google.com; s=arc-20160816; b=s9E0CxGieNoV1KyO3st+HXcEQqv+Qt4o7Wabj8BAczQgtRkwqGPMS11la7D5he0YKA V9bS2TwsLnXkT5P+IXbIbPILDy6Mm3w2ylIlFhuUSGuiYA2qLY226s7DSBdY0qlqjE+j pVrBZuuvZ3xjFjj3m8RQidcks7LvMsrBXcG35uCwtWzfriZ05fzkEf1HfA5ouKBcTni/ ag0CbiiV//R5sR3hzj+MGww32x+Q+4u8l5+vf24ymYttEfj4rxzNhocMGKAgbVEufTiR dFmrFtptmol+h8g1jhKlwihs2p1JpYPiSwsvlIyU50+6nuIWc/7edw0Hz+LqY2kJRrnP useg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=x9mWv3XaCSB7qLRtEOA3YyIdHfZf5rVW7mfGGhZ+w1w=; b=HbTj0CB/XKIk/eLynazr6d3vA8ALvim9NTK38m5KCYfo06kAxAxYDak5sdXqP5Q46Z h/CaIl8kup/jerljn8gKoXbJhDka4F7lEkpWzDRpWmiYwrr+FXEZy0WZ3BbmPxup+p+m ZagTu6LuFaqqKSAOvKJtHQ68BKVxW0SmmQh2+AcXUfKCWzZyBaFH0o3WySl/cWmc95qo wE6CnU1E9m52vu2nuQdo0MLGHdIDkmbMfXwXubP1gaQJV5fRM1BNo5R35xkiO6b6XaxI lGuiWGN169P2y5VXxSpPRiujjWgEKP2uI0Cte0EMeQItp4806pD5CpjzZkOknQVAWyCC m5iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=xoWVzDSD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10-v6si171550pgo.412.2018.07.02.21.08.18; Mon, 02 Jul 2018 21:08:32 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=xoWVzDSD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753734AbeGCEHg (ORCPT + 99 others); Tue, 3 Jul 2018 00:07:36 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:39914 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753485AbeGCEHe (ORCPT ); Tue, 3 Jul 2018 00:07:34 -0400 Received: by mail-qt0-f193.google.com with SMTP id q12-v6so480221qtp.6 for ; Mon, 02 Jul 2018 21:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=x9mWv3XaCSB7qLRtEOA3YyIdHfZf5rVW7mfGGhZ+w1w=; b=xoWVzDSDu/2nUKjjq3Cqn9kE80EZXGMr2GVT/A87H/uJWp60v1lNXioq6UN4isSgQW LGE3lwfQl4isreP/gNWbdhaa5Yf3vqvhN8myXwYUcGSZU3IXx8WAK/nDurATL0wJYuBs CKI9sx9NDchsVS8v5zglaJC+MLNpjv0LrsFb1GR/tau527kHLE7bxos/DsVfiCIjQuVH IUkuzaGWgJnCNJRRT1Khj5zZf0kWyKW7nZ6B8ygzOdIizhkt/d8xFX/5u2Ekjs9tzu+f 1ytOyYN/Myv+VPMikkItQPicN6fmQTdB5UoOdcXV7ZApSFcPfRhau0mdG0eU+wh0YFa3 Yxvw== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=x9mWv3XaCSB7qLRtEOA3YyIdHfZf5rVW7mfGGhZ+w1w=; b=RCTAPNzOkKBuTeBx5oPXrYNpZ9a+L3i+rtmh0Q2fZTB2LPQRG1ppURoMy9CHTWZ6ou JzjM9M3V+5VBBu+3/wihz6dw2ATTVItlFVG5nHWQWV0+nrJL9QVQ5ikAklkWcckdTtkp JXOq6u2G7MaX5Bgz124Z6ro7irA+glGTpdhvCxv8jcQ6vXeUS6p+khlq/lyorK4ShDSN 2LV8FSIQoOuoxG8YUcSXhbPhH511PgoVkLh9cnh9Te6IvtTmBl/JvpzoV4Z6bjCllL7y uezbB1tQ0GLgygU7ZxtuzvcpMmq7sWUqOdej/C084PR722HOIPN84zTWK13HiuIzwU5A OUlA== X-Gm-Message-State: APt69E0Gf7g+AxZLLx8Sn/jTjeP+IUEWFOlaBfNWFK8jwgQJf3rgLveK M/dK19vipsTwoocYA/ObnnEZVw== X-Received: by 2002:aed:3bd2:: with SMTP id s18-v6mr10333247qte.324.1530590853731; Mon, 02 Jul 2018 21:07:33 -0700 (PDT) Received: from cakuba.netronome.com ([75.53.12.129]) by smtp.gmail.com with ESMTPSA id m31-v6sm125363qte.82.2018.07.02.21.07.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 21:07:33 -0700 (PDT) Date: Mon, 2 Jul 2018 21:07:29 -0700 From: Jakub Kicinski To: Okash Khawaja Cc: Daniel Borkmann , Martin KaFai Lau , Alexei Starovoitov , Yonghong Song , "Quentin Monnet" , "David S. Miller" , , , , Song Liu Subject: Re: [PATCH bpf-next v2 1/3] bpf: btf: export btf types and name by offset from lib Message-ID: <20180702210729.69cfb63d@cakuba.netronome.com> In-Reply-To: <20180702191324.476855192@fb.com> References: <20180702183913.669030439@fb.com> <20180702191324.476855192@fb.com> Organization: Netronome Systems, Ltd. 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, 2 Jul 2018 11:39:14 -0700, Okash Khawaja wrote: > --- a/tools/lib/bpf/btf.h > +++ b/tools/lib/bpf/btf.h > @@ -17,6 +17,9 @@ void btf__free(struct btf *btf); > struct btf *btf__new(uint8_t *data, uint32_t size, btf_print_fn_t err_log); > int32_t btf__find_by_name(const struct btf *btf, const char *type_name); > int64_t btf__resolve_size(const struct btf *btf, uint32_t type_id); > +int32_t btf__resolve_type(const struct btf *btf, uint32_t type_id); > int btf__fd(const struct btf *btf); > +const char *btf__name_by_offset(const struct btf *btf, uint32_t offset); > +const struct btf_type *btf__type_by_id(const struct btf *btf, uint32_t type_id); Why is BTF code using stdint types? libbpf used to follow the kernel coding style AFA int types go.