From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Subject: Re: [PATCH bpf-next v2 1/2] trace_helpers.c: Add helpers to poll multiple perf FDs for events Date: Tue, 05 Jun 2018 11:22:01 +0200 Message-ID: <87k1rdfv0m.fsf@toke.dk> References: <152813003609.3465.618891361534945522.stgit@alrua-kau> <20180604152324.6e1115a2@cakuba.netronome.com> <2626942d-664b-f569-1926-d5a8ac5314b9@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: netdev@vger.kernel.org, Alexei Starovoitov To: Daniel Borkmann , Jakub Kicinski Return-path: Received: from mail.toke.dk ([52.28.52.200]:58011 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbeFEJV4 (ORCPT ); Tue, 5 Jun 2018 05:21:56 -0400 In-Reply-To: <2626942d-664b-f569-1926-d5a8ac5314b9@iogearbox.net> Sender: netdev-owner@vger.kernel.org List-ID: Daniel Borkmann writes: > On 06/05/2018 12:26 AM, Jakub Kicinski wrote: >> On Mon, 04 Jun 2018 18:33:56 +0200, Toke H=C3=B8iland-J=C3=B8rgensen wro= te: >>> This adds two new helper functions to trace_helpers that supports polli= ng >>> multiple perf file descriptors for events. These are used to the XDP >>> perf_event_output example, which needs to work with one perf fd per CPU. >>> >>> Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen >>=20 >> Did you take a look at tools/bpf/bpftool/map_perf_ring.c ? >>=20 >> I think the ability to poll multiple FDs could be generally useful and >> therefore better add it to libbpf.c than >> tools/testing/selftests/bpf/trace_helpers.c? I'm not 100% sure myself... > > I think for it to land in libbpf this code needs to be more generalized > as it is right now and allowing for more flexibility like pinning RB > processing threads to CPUs, poll handling, etc. Hmm, so how about we leave it in trace_helpers.c for now? I don't necessarily mind working on an addition to libbpf at some point, but don't have time to do so short term...