From patchwork Mon Sep 4 01:01:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Tao X-Patchwork-Id: 13373388 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 8C13DC83F2D for ; Mon, 4 Sep 2023 01:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350105AbjIDBCA (ORCPT ); Sun, 3 Sep 2023 21:02:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350071AbjIDBB7 (ORCPT ); Sun, 3 Sep 2023 21:01:59 -0400 Received: from out203-205-221-210.mail.qq.com (out203-205-221-210.mail.qq.com [203.205.221.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BA20ED for ; Sun, 3 Sep 2023 18:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1693789312; bh=TB5AzkK7BN11nl5AAqPvegLlqHhbbgXPppq8dVRYyGk=; h=From:To:Cc:Subject:Date; b=H/frfDkLoDJ22Ssoz/+NRxF4uUDmRvT6dmbMOYOtDAs3kKJ4HMAbJV7+KcdD7Osc3 6QW+WFFS6/bjimFIPN3zlpULOZUPtACQ1vyW0ZOT9xq3skU+blHKHeIV4QnX+fK0FL gbJ2J6Y/1RifMMk0uoetX23BAahF/Z3JvYL2FuQ8= Received: from RT-NUC.. ([39.156.73.12]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 6E8B05F; Mon, 04 Sep 2023 09:01:46 +0800 X-QQ-mid: xmsmtpt1693789306t6uqnk9ls Message-ID: X-QQ-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com, andrii@kernel.org, daniel@iogearbox.net, sdf@google.com Cc: Rong Tao , Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , Maxime Coquelin , Alexandre Torgue , Yafang Shao , bpf@vger.kernel.org (open list:BPF [GENERAL] (Safe Dynamic Programs and Tools)), linux-kernel@vger.kernel.org (open list), linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-stm32@st-md-mailman.stormreply.com (moderated list:ARM/STM32 ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:ARM/STM32 ARCHITECTURE) Subject: [PATCH bpf-next v10 0/2] selftests/bpf: Optimize kallsyms cache Date: Mon, 4 Sep 2023 09:01:19 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Rong Tao We need to optimize the kallsyms cache, including optimizations for the number of symbols limit, and, some test cases add new kernel symbols (such as testmods) and we need to refresh kallsyms (reload or refresh). Rong Tao (2): selftests/bpf: trace_helpers.c: optimize kallsyms cache selftests/bpf: trace_helpers.c: Add a global ksyms initialization mutex samples/bpf/Makefile | 4 + .../selftests/bpf/prog_tests/fill_link_info.c | 9 +- .../prog_tests/kprobe_multi_testmod_test.c | 24 ++- tools/testing/selftests/bpf/trace_helpers.c | 141 +++++++++++++----- tools/testing/selftests/bpf/trace_helpers.h | 10 +- 5 files changed, 141 insertions(+), 47 deletions(-)