From patchwork Wed Nov 29 07:20:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonghong Song X-Patchwork-Id: 842480 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@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; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.b="ImK2IBIy"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ymsQ270Yxz9ryr for ; Wed, 29 Nov 2017 18:20:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752014AbdK2HUk (ORCPT ); Wed, 29 Nov 2017 02:20:40 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:45220 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751491AbdK2HUj (ORCPT ); Wed, 29 Nov 2017 02:20:39 -0500 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAT7Ip6q031970 for ; Tue, 28 Nov 2017 23:20:38 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=XL1guObxYgY8FRmN9iDqQyWwAP1fgpADCTAmI+7u5F4=; b=ImK2IBIyhEfyhwirB7kw/LIkdRK/dILV7N1gTO8J1tbhWHJXZkJq30dpr92mR7rp2d5g IQ55qnW202KM5bx5MJV0FBWfKHxDaQ2gEjsOnuO5Pr1mnMJ2AOlZesObyZlm0BtZZF7D CTVlwKYLE/mhOJzkFxI8sEoYeEP7Z2i2B3Q= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2ehk9u0kfn-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 28 Nov 2017 23:20:38 -0800 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB13.TheFacebook.com (192.168.16.23) with Microsoft SMTP Server id 14.3.361.1; Tue, 28 Nov 2017 23:20:36 -0800 Received: by devbig474.prn1.facebook.com (Postfix, from userid 128203) id 7B56FE414B3; Tue, 28 Nov 2017 23:20:36 -0800 (PST) Smtp-Origin-Hostprefix: devbig From: Yonghong Song Smtp-Origin-Hostname: devbig474.prn1.facebook.com To: , , , , , CC: Smtp-Origin-Cluster: prn1c29 Subject: [PATCH net-next 0/2] bpf/tracing: allow user space to query prog array on the same tp Date: Tue, 28 Nov 2017 23:20:34 -0800 Message-ID: <20171129072036.467246-1-yhs@fb.com> X-Mailer: git-send-email 2.9.5 X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-29_02:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit e87c6bc3852b ("bpf: permit multiple bpf attachments for a single perf event") added support to attach multiple bpf programs to a single perf event. Given a perf event (kprobe, uprobe, or kernel tracepoint), the perf ioctl interface is used to query bpf programs attached to the same trace event. The same ioctl interface is also used to attach bpf program. Patch #1 had the core implementation and patch #2 added a test case in tools bpf selftests suite. Yonghong Song (2): bpf/tracing: allow user space to query prog array on the same tp bpf/tracing: add a bpf test for new ioctl query interface include/linux/bpf.h | 4 ++ include/uapi/linux/perf_event.h | 6 ++ kernel/bpf/core.c | 24 +++++++ kernel/events/core.c | 3 + kernel/trace/bpf_trace.c | 23 +++++++ tools/include/uapi/linux/perf_event.h | 6 ++ tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/test_progs.c | 107 +++++++++++++++++++++++++++++++ 8 files changed, 174 insertions(+), 1 deletion(-) Acked-by: Alexei Starovoitov