Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1442532imc; Mon, 11 Mar 2019 13:59:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwU4RZKDZIqp7c+13MAsjkUet9HsHTH4NLKR0TWChkAHBzM0Z+oIvdI16crht/2VkUiwbcE X-Received: by 2002:a17:902:bf05:: with SMTP id bi5mr9616948plb.252.1552337953797; Mon, 11 Mar 2019 13:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552337953; cv=none; d=google.com; s=arc-20160816; b=MutzSQQQ8XS07sdUB0mSX/zwxC/rl0DvpJavIGH8rTql47U4bv3zDm8DnQAg7HtbOD /oL9Q3PUhifhmH+J5z0DMNclOOj0wl1dadTtvmlAZa7HHxYbZkea6Llmf62tLJLscYyo aRuBmim7+FyC4pfgmTqXA28dK5ECUz8JVu6zgbRQv8ku67oNZsvlcHn04mHWTdQfOoFE zsiQTbjA5xNgCaALauGVC/LH5JQtr+5J7x7e8IDSnetdJ531C0MlIAXHWva7roeoXMHh mZrk3i/cBgsbqLf8wS4TIT/5vWmsyzbxAEOs5xHQ7uRLKrKc+dbSlzO4nF+CiOzDhxKd sAbQ== 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:date:from:dkim-signature; bh=oTqIPcquLN0WxH7JpOcWhV3nfI5Ss1yHEcWa/CSFZrQ=; b=airWAUw1hAemuTUU2Qk+lkKFrLGH7aH5ScMt3TQqPgP52mfE1bE9KMNjYOpk4YHJ4Q UWJpjq4NhG6jRgMd43ka+lrpqFhbE+BJPsUaBM7ehKP6n2pTZk8KBnz1ypNS9ohA/6lQ FENX/tD5FUJMtb4ffgtII99hcRpSTTq3TSyyhW6SIDrP7cSYmnXpIG/kcLR8GHYifGR1 FL8UXHujazLsWOSHgXG5o38oXs0DOUlk9jacjtWzvWYNtjofSeixfi6fsBgvtrJW7sHq yeAiIZa5eqPrjdbb4E5XFC6b7ddgvysX6bb0S1MJxIpXRjn/zwk6QGVosDi5cE0EGJQb Oa0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W1B+uHOz; 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 k184si4248151pgc.117.2019.03.11.13.58.58; Mon, 11 Mar 2019 13:59:13 -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=W1B+uHOz; 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 S1728324AbfCKU51 (ORCPT + 99 others); Mon, 11 Mar 2019 16:57:27 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:42581 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbfCKU50 (ORCPT ); Mon, 11 Mar 2019 16:57:26 -0400 Received: by mail-qt1-f196.google.com with SMTP id u7so163700qtg.9; Mon, 11 Mar 2019 13:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oTqIPcquLN0WxH7JpOcWhV3nfI5Ss1yHEcWa/CSFZrQ=; b=W1B+uHOze3+y7LtTW3aOCalmIBhvcODWbzGZbNL/WfFZ+mRsUAcRRe1lmZRmGCOoML fyFC/+FuYb+5+dFbonZejq8bPWMgbVqyUGqkRRKvkJM4opKCtqYUA1dU+Xx2JniO9Vrg KmT/Yq2H6aiUzRedFcb802w7MMLpeBItf/1oeRwmjCJ32Cg5noIbwQ7wIr9vv3ms5tSr eVwXzrWikLIui0KiLbPYMCkHmum2EqsYOcoQlRrLUGn+N4Rhig1YHQTv1QtoBigRxTRr SbZaUvEgH3q1HCgqq1et3hMIP/xBRNlh2mV8JH5IpEB1Bum4WhpMmyjAREjNBJaA8OWL B95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oTqIPcquLN0WxH7JpOcWhV3nfI5Ss1yHEcWa/CSFZrQ=; b=hBm5iNrMcAnue5K5j2/jvwN+nXANxZIZEaDQKDzcDhpuw0Mz1N5ozcd7ihIhUs3GzV oSnWDvK316slwwevjBYPZOp4EjjVxyK/gjHFaqirit3duxjmRGnphE320N77Q3MhcleD IysV33ttuSDdWpXcWQRoYu9W169vn7zyFxTitczJbiUCzmoUKGs8gTEXJ+h/u2pV/V8X qP+ZR/j2stTxKEm6TCtP63Tzn09rjgLri7cFurY3214j+AcbRG96L3csQOZwajejHWUK Un7cziuvXXDgqvadVAC8t264Hzpr/X7KaVRinjYgU5WPI+acIJ2Xgm3ZYWaG4Esz5n+z 58Tw== X-Gm-Message-State: APjAAAXOfCWZ33pys1VrzoBm2mZnPqlcvkGDY5MWpw8OmveU/s8VJuBn RF9gIVPliV62Px+6BFSG/cg= X-Received: by 2002:ac8:3181:: with SMTP id h1mr17242637qte.294.1552337844812; Mon, 11 Mar 2019 13:57:24 -0700 (PDT) Received: from quaco.ghostprotocols.net ([190.15.121.82]) by smtp.gmail.com with ESMTPSA id f18sm4582177qta.64.2019.03.11.13.57.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2019 13:57:23 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 9E0B14039C; Mon, 11 Mar 2019 17:57:20 -0300 (-03) Date: Mon, 11 Mar 2019 17:57:20 -0300 To: Daniel Borkmann Cc: Arnaldo Carvalho de Melo , Alexei Starovoitov , Song Liu , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, kernel-team@fb.com, peterz@infradead.org, acme@redhat.com, jolsa@kernel.org, namhyung@kernel.org Subject: Re: [PATCH v7 perf,bpf 02/15] bpf: libbpf: introduce bpf_program__get_prog_info_linear() Message-ID: <20190311205720.GD10690@kernel.org> References: <20190307175810.249857-1-songliubraving@fb.com> <20190307175810.249857-3-songliubraving@fb.com> <20190311182631.GX10690@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Mar 11, 2019 at 09:45:49PM +0100, Daniel Borkmann escreveu: > On 03/11/2019 07:26 PM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Mar 07, 2019 at 09:57:57AM -0800, Song Liu escreveu: > >> Currently, bpf_prog_info includes 9 arrays. The user has the option to > >> fetch any combination of these arrays. However, this requires a lot of > >> handling of these arrays. This work becomes more tricky when we need to > >> store bpf_prog_info to a file, because these arrays are allocated > >> independently. > >> > >> This patch introduces struct bpf_prog_info_linear, which stores arrays > >> of bpf_prog_info in continues memory. Helper functions are introduced > >> to unify the work to get different information of bpf_prog_info. > >> Specifically, bpf_program__get_prog_info_linear() allows the user to > >> select which arrays to fetch, and handles details for the user. > >> > >> Plesae see the comments before enum bpf_prog_info_array for more details > >> and examples. > >> > >> Cc: Daniel Borkmann > >> Cc: Alexei Starovoitov > > > > Daniel, are you ok with these changes to libbpf and bpftool? Perhaps > > those should be detached from this patchkit and submitted sooner, > > eroding the size of this kit. > > > > Alternatively, if you're ok with it, please provide your Acked-by and > > I'll process as soon as I get back to it after Jiri is done reviewing. > > Overall looks okay. Are you planning to get these in for 5.1 window? If I hope so. > yes, that would be great, otherwise we might need to cherry-pick the libbpf So I'll try and grab those for my next pull req to Ingo, this week, will add your Acked-by, ok? > and bpftool ones from your tree into bpf-next as well since there's just > too much going on in this area where we'd potentially run into complex > merge conflicts. In the latter case, libbpf.map would need to be fixed up > to LIBBPF_0.0.3 as convention is that this is in line with kernel release. BTW, while running my build tests I had to add this to today's batch, should be trivial when merging, I think, ok? commit dfcbc2f2994b8a3af3605a26dc29c07ad7378bf4 Author: Arnaldo Carvalho de Melo Date: Mon Mar 11 17:07:52 2019 -0300 tools lib bpf: Fix the build by adding a missing stdarg.h include The libbpf_print_fn_t typedef uses va_list without including the header where that type is defined, stdarg.h, breaking in places where we're unlucky for that type not to be already defined by some previously included header. Noticed while building on fedora 24 cross building tools/perf to the ARC architecture using the uClibc C library: 28 fedora:24-x-ARC-uClibc : FAIL arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710 CC /tmp/build/perf/tests/llvm.o In file included from tests/llvm.c:3:0: /git/linux/tools/lib/bpf/libbpf.h:57:20: error: unknown type name 'va_list' const char *, va_list ap); ^~~~~~~ /git/linux/tools/lib/bpf/libbpf.h:59:34: error: unknown type name 'libbpf_print_fn_t' LIBBPF_API void libbpf_set_print(libbpf_print_fn_t fn); ^~~~~~~~~~~~~~~~~ mv: cannot stat '/tmp/build/perf/tests/.llvm.o.tmp': No such file or directory Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Jakub Kicinski Cc: Jiri Olsa Cc: Namhyung Kim Cc: Quentin Monnet Cc: Stanislav Fomichev Cc: Yonghong Song Fixes: a8a1f7d09cfc ("libbpf: fix libbpf_print") Link: https://lkml.kernel.org/n/tip-5270n2quu2gqz22o7itfdx00@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index b4652aa1a58a..aa1521a51687 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -10,6 +10,7 @@ #ifndef __LIBBPF_LIBBPF_H #define __LIBBPF_LIBBPF_H +#include #include #include #include