From patchwork Mon Apr 23 06:59:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Olsa X-Patchwork-Id: 902795 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40Ty5m0ygNz9s0x for ; Mon, 23 Apr 2018 17:00:28 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754176AbeDWG7b (ORCPT ); Mon, 23 Apr 2018 02:59:31 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55522 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751535AbeDWG73 (ORCPT ); Mon, 23 Apr 2018 02:59:29 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ACAF9427097F; Mon, 23 Apr 2018 06:59:28 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.247]) by smtp.corp.redhat.com (Postfix) with ESMTP id A503F2166BAE; Mon, 23 Apr 2018 06:59:27 +0000 (UTC) From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann Cc: lkml , netdev@vger.kernel.org, Quentin Monnet Subject: [PATCH 0/3] bpf: Store/dump license string for loaded program Date: Mon, 23 Apr 2018 08:59:24 +0200 Message-Id: <20180423065927.23127-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 23 Apr 2018 06:59:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 23 Apr 2018 06:59:28 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@kernel.org' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org hi, sending the change to store and dump the license info for loaded BPF programs. It's important for us get the license info, when investigating on screwed up machine. Adding change to bpftool to dump the license via: # bpftool prog list 1: kprobe name func_begin tag 59bef35a42fda602 license GPL loaded_at Apr 22/15:46 uid 0 xlated 272B not jited memlock 4096B map_ids 1 # bpftool prog show --json [{"id":1,"type":"kprobe","name":"fun ... ,"license":"GPL", ... ] Also available at: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/license thanks, jirka --- Jiri Olsa (3): bpf: Store license string for loaded program tools bpf: Sync bpf.h uapi header tools bpftool: Display license in prog show/list include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 3 +++ kernel/bpf/core.c | 1 + kernel/bpf/syscall.c | 7 ++++++- tools/bpf/bpftool/prog.c | 4 ++++ tools/include/uapi/linux/bpf.h | 4 ++++ 6 files changed, 19 insertions(+), 1 deletion(-)