From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: [PATCH bpf-next 0/7] bpf: add perf event reading loop and move samples closer to libbpf Date: Thu, 10 May 2018 10:24:36 -0700 Message-ID: <20180510172443.17238-1-jakub.kicinski@netronome.com> Cc: oss-drivers@netronome.com, netdev@vger.kernel.org, Jakub Kicinski To: alexei.starovoitov@gmail.com, daniel@iogearbox.net Return-path: Received: from mail-qk0-f193.google.com ([209.85.220.193]:35862 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965017AbeEJRY4 (ORCPT ); Thu, 10 May 2018 13:24:56 -0400 Received: by mail-qk0-f193.google.com with SMTP id l132-v6so2177236qke.3 for ; Thu, 10 May 2018 10:24:56 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: Hi! This series started out as a follow up to the bpftool perf event dumping patches. As suggested by Daniel patch 1 makes use of PERF_SAMPLE_TIME to simplify code and improve accuracy of timestamps. Remaining patches are trying to move perf event loop into libbpf as suggested by Alexei. One user for this new function is bpftool which links with libbpf nicely, the other, unfortunately, is in samples/bpf. Remaining patches make samples/bpf link against full libbpf.a (not just a handful of objects). Once we have full power of libbpf at our disposal we can convert some of XDP samples to use libbpf loader instead of bpf_load.c. My understanding is that this is the desired direction, at least for networking code. Jakub Kicinski (7): tools: bpftool: use PERF_SAMPLE_TIME instead of reading the clock samples: bpf: rename struct bpf_map_def to avoid conflict with libbpf samples: bpf: compile and link against full libbpf tools: bpf: move the event reading loop to libbpf tools: bpf: improve comments in libbpf.h tools: bpf: don't complain about no kernel version for networking code samples: bpf: convert some XDP samples from bpf_load to libbpf samples/bpf/Makefile | 37 +++++-- samples/bpf/bpf_load.c | 10 +- samples/bpf/bpf_load.h | 4 +- samples/bpf/trace_output_user.c | 6 +- samples/bpf/xdp1_user.c | 31 ++++-- samples/bpf/xdp_adjust_tail_user.c | 36 ++++--- samples/bpf/xdp_rxq_info_user.c | 46 ++++++--- tools/bpf/bpftool/map_perf_ring.c | 83 ++++----------- tools/lib/bpf/Makefile | 2 +- tools/lib/bpf/libbpf.c | 107 ++++++++++++++++++-- tools/lib/bpf/libbpf.h | 61 ++++++----- tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/test_progs.c | 6 +- tools/testing/selftests/bpf/trace_helpers.c | 87 ++++++---------- tools/testing/selftests/bpf/trace_helpers.h | 11 +- 15 files changed, 307 insertions(+), 222 deletions(-) -- 2.17.0