From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B3C8C00144 for ; Mon, 1 Aug 2022 23:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbiHAX1H (ORCPT ); Mon, 1 Aug 2022 19:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230362AbiHAX1G (ORCPT ); Mon, 1 Aug 2022 19:27:06 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA1641C90B for ; Mon, 1 Aug 2022 16:27:05 -0700 (PDT) Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 271NFbQO013012 for ; Mon, 1 Aug 2022 16:27:05 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=facebook; bh=l+2+aAXIhGOiuHKPZ7gIFD7IrMlEzH+m0etJk18VbnU=; b=HrIrHTw3I64x1qHQd2/foueWUbABggPI8cGm9A9YSro0WKSlsPYWt/t2+tPGo4chhGli 4Sztguyd0NHNmj9ZcBMw7EdO1Lp7jgD1UX7x3H3oizYp/tguPPndJ0f0hiSEKs/3dh9k QHFoJcBGz1UtMpe9OnEkLsoYQkxBjaL95Fs= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3hn0pjymhv-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 01 Aug 2022 16:27:05 -0700 Received: from twshared14818.18.frc3.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:11d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 1 Aug 2022 16:27:04 -0700 Received: by devbig931.frc1.facebook.com (Postfix, from userid 460691) id C01B162953E3; Mon, 1 Aug 2022 16:26:53 -0700 (PDT) From: Kui-Feng Lee To: , , , , , CC: Kui-Feng Lee Subject: [PATCH bpf-next v2 0/3] Parameterize task iterators. Date: Mon, 1 Aug 2022 16:26:46 -0700 Message-ID: <20220801232649.2306614-1-kuifeng@fb.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: XlkJIv0Tsa8N5FTknCBf0Ys0Nrk1STgV X-Proofpoint-GUID: XlkJIv0Tsa8N5FTknCBf0Ys0Nrk1STgV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-01_12,2022-08-01_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Allow creating an iterator that loops through resources of one task/threa= d. People could only create iterators to loop through all resources of files, vma, and tasks in the system, even though they were interested in = only the resources of a specific task or process. Passing the addintional parameters, people can now create an iterator to go through all resources or only the resources of a task. Major Changes: - Add new parameters in bpf_iter_link_info to indicate to go through all tasks or to go through a specific task. - Change the implementations of BPF iterators of vma, files, and tasks to allow going through only the resources of a specific task. - Provide the arguments of parameterized task iterators in bpf_link_info. Kui-Feng Lee (3): bpf: Parameterize task iterators. bpf: Handle bpf_link_info for the parameterized task BPF iterators. selftests/bpf: Test parameterized task BPF iterators. include/linux/bpf.h | 4 + include/uapi/linux/bpf.h | 27 ++++ kernel/bpf/task_iter.c | 103 ++++++++++--- tools/include/uapi/linux/bpf.h | 27 ++++ .../selftests/bpf/prog_tests/bpf_iter.c | 143 +++++++++++++++--- .../selftests/bpf/prog_tests/btf_dump.c | 2 +- .../selftests/bpf/progs/bpf_iter_task.c | 9 ++ .../selftests/bpf/progs/bpf_iter_task_file.c | 7 + .../selftests/bpf/progs/bpf_iter_task_vma.c | 6 +- 9 files changed, 282 insertions(+), 46 deletions(-) --=20 2.30.2