Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b9e3d54 authored by Daniel Borkmann's avatar Daniel Borkmann
Browse files

Merge branch 'bpf-bpftool-libbpf-improvements'



Jakub Kicinski says:

====================
Set of random updates to bpftool and libbpf.  I'm preparing for
extending bpftool prog load, but there is a good number of
improvements that can be made before bpf -> bpf-next merge
helping to keep the later patch set to a manageable size as well.

First patch is a bpftool build speed improvement.  Next missing
program types are added to libbpf program type detection by section
name.  The ability to load programs from '.text' section is restored
when ELF file doesn't contain any pseudo calls.

In bpftool I remove my Author comments as unnecessary sign of vanity.
Last but not least missing option is added to bash completions and
processing of options in bash completions is improved.
====================

Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parents 509fda10 121c58be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ endif

LIBBPF = $(BPF_PATH)libbpf.a

BPFTOOL_VERSION=$(shell make --no-print-directory -sC ../../.. kernelversion)
BPFTOOL_VERSION := $(shell make --no-print-directory -sC ../../.. kernelversion)

$(LIBBPF): FORCE
	$(Q)$(MAKE) -C $(BPF_DIR) OUTPUT=$(OUTPUT) $(OUTPUT)libbpf.a FEATURES_DUMP=$(FEATURE_DUMP_EXPORT)
+21 −11
Original line number Diff line number Diff line
@@ -153,6 +153,13 @@ _bpftool()
    local cur prev words objword
    _init_completion || return

    # Deal with options
    if [[ ${words[cword]} == -* ]]; then
        local c='--version --json --pretty --bpffs'
        COMPREPLY=( $( compgen -W "$c" -- "$cur" ) )
        return 0
    fi

    # Deal with simplest keywords
    case $prev in
        help|hex|opcodes|visual)
@@ -172,20 +179,23 @@ _bpftool()
            ;;
    esac

    # Search for object and command
    local object command cmdword
    for (( cmdword=1; cmdword < ${#words[@]}-1; cmdword++ )); do
        [[ -n $object ]] && command=${words[cmdword]} && break
        [[ ${words[cmdword]} != -* ]] && object=${words[cmdword]}
    # Remove all options so completions don't have to deal with them.
    local i
    for (( i=1; i < ${#words[@]}; )); do
        if [[ ${words[i]::1} == - ]]; then
            words=( "${words[@]:0:i}" "${words[@]:i+1}" )
            [[ $i -le $cword ]] && cword=$(( cword - 1 ))
        else
            i=$(( ++i ))
        fi
    done
    cur=${words[cword]}
    prev=${words[cword - 1]}

    local object=${words[1]} command=${words[2]}

    if [[ -z $object ]]; then
    if [[ -z $object || $cword -eq 1 ]]; then
        case $cur in
            -*)
                local c='--version --json --pretty'
                COMPREPLY=( $( compgen -W "$c" -- "$cur" ) )
                return 0
                ;;
            *)
                COMPREPLY=( $( compgen -W "$( bpftool help 2>&1 | \
                    command sed \
+0 −2
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@
 * SOFTWARE.
 */

/* Author: Jakub Kicinski <kubakici@wp.pl> */

#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+1 −3
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 Netronome Systems, Inc.
 * Copyright (C) 2017-2018 Netronome Systems, Inc.
 *
 * This software is dual licensed under the GNU General License Version 2,
 * June 1991 as shown in the file COPYING in the top-level directory of this
@@ -31,8 +31,6 @@
 * SOFTWARE.
 */

/* Author: Jakub Kicinski <kubakici@wp.pl> */

#include <bfd.h>
#include <ctype.h>
#include <errno.h>
+0 −2
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@
 * SOFTWARE.
 */

/* Author: Jakub Kicinski <kubakici@wp.pl> */

#ifndef __BPF_TOOL_H
#define __BPF_TOOL_H

Loading