From patchwork Tue Apr 5 16:08:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guillermo E. Martinez" X-Patchwork-Id: 52640 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C72DA3870C27 for ; Tue, 5 Apr 2022 16:08:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C72DA3870C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649174936; bh=z+diYYNjndX8JAuyKEtAFQTSfrUtiRbd4CTQtFxYcMo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=G+FyIlm8Sk1NzlWtvA7zO98I/OlTaINUb50aRMnAj/JSbIsMFyhpdpfeHqci0TbkN ndzZpHS184NFfl7EA5uEScPghyXOQBuZ4eUvpZ85tjBUSFjHdbiWwytsSRHupXJmBj Szt1+acVGJuIQXGthCpp7Ycgrg8xRB+/5hpfHc+w= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id BBA253858C50 for ; Tue, 5 Apr 2022 16:08:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BBA253858C50 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 235Fm0AX006378 for ; Tue, 5 Apr 2022 16:08:49 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6d31eka5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 05 Apr 2022 16:08:49 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 235G0e0A003782 for ; Tue, 5 Apr 2022 16:08:47 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3f6cx3qa7e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 05 Apr 2022 16:08:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KM1l6onWxlcqHe/i3rzBo/lDoa5TlfUEXhJOjXIXmsLuder2eYH85SB/2YFLB3PaY+FDxNKa/UQQ+K2qqWTEoQ/oh62Rb8gTkWGC7Er/yeuxKhzEWWX2495F9feubpu6anxduHBg/vW8ezYd4u0Wjs1bnRsP72W99P3H1edTKIRmDD8ww5RSslV+QN+2Wlh+VStdnpLKsOr9RUCbQMjBzVqvXC4+oze4Sw/sGDyBBJCACQI7Cr2RP23pOWg7TVgMGmcD9Ug+WTxyXZ7+cF1cH91qyu+NB2UwvGHiveZg4YaiUQ0ODpQB9nlzGEmUbS1CsREukB4SUgZTd/UQCi5Cig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z+diYYNjndX8JAuyKEtAFQTSfrUtiRbd4CTQtFxYcMo=; b=joeAwqPEp8bocdOGdbU0u6IxOW44ykqa578zzgjZuMA8Gm2tYeHu2BlxsTUnOUj/Z+r9KolyK4aYnEKQHN6eTCv68O/wheeshqX4MtsEB5iSJ5b+7q/GwDlnK1jdS8154tXAVdbP+NHbuWK98V8X3yT0tYFKYw1ap+k+HCYrs+mu7c2El6aBITlHsjINmpJYOFof/9u8MV4+Z/YS06tiLgHqmjcuwKQTMaNeyfRarar/D7GjV6PSItn4k/2dm83WyW7ouaQCAV4nl18HRZ8pcJD71/hIAByr7j38ftdn6T+jTRN0pFyO9+GONZ6ryT/AdScDHsSNK8ja5a+c4MVd/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) by PH7PR10MB5723.namprd10.prod.outlook.com (2603:10b6:510:127::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Tue, 5 Apr 2022 16:08:45 +0000 Received: from MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::28aa:6d3b:680b:3cb5]) by MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::28aa:6d3b:680b:3cb5%9]) with mapi id 15.20.5123.031; Tue, 5 Apr 2022 16:08:44 +0000 To: libabigail@sourceware.org Subject: [PATCH] ctf-reader: Improves performance to read CTF information from Linux kernel Date: Tue, 5 Apr 2022 11:08:33 -0500 Message-Id: <20220405160833.1179590-1-guillermo.e.martinez@oracle.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SA0PR11CA0162.namprd11.prod.outlook.com (2603:10b6:806:1bb::17) To MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f079afb-e5e5-4215-8883-08da171e8ecf X-MS-TrafficTypeDiagnostic: PH7PR10MB5723:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sqRaUr9RA9EIuS14MUx0VNlWrMIKQypJiwZw7wDkJNPoJwbbFr4ux0s0fV3T2S3iD11pjZ+0C07p8rQPHSRTSNB90QT7gTsdCoSRcAX37LJrpwdSxOqF1/Tym9Z/m2BotvOxxe+Zxs9YgjCYP4HyuKV3xLn1lKaNVAlzm2RVpwv4AsNb1x18JssexjgxTDYRENdgK5Piriy2pMAfYa/9LXMgMHIKMeDiFAo+oBS5Oq/7uiOglSlbPu/TMiNr2ldQiukXMjGqxad5dJ7d++R9X7kPJemGHM1v5JJ9M7bMttHXswrO2qa+rypTZkBh2bwPFWaFTiT8nJuNNxZDvWiJodfZplA9QK6yOC5F/ZzhkczHZ8jZw8rFHHiYXltYVRkgPNehNMG1lHf9WO7YiQr4gkpjEjB2pLpjOY7BbS+6S1PlSLMwNIQT0MIWTLoM4U+RejIJ7UeQu/R8zgfGSIF+FSwKVnOVzETxqPOMahy2Jw8azC2rsRiRsF29Nee1Ii/K1kupeyUJf4w3ei4wW23XxXRZLcUd0xkDCewJe/PkABaweqpIXYOgmfAt5OP3M+ursHeSY7XVmlQnJuT1IOuqP2FltC0236lb9WqH99UjfB0BIOseoTW2wU0uzLcmSRiUljqnXe6bkI6Q1Csp08ogc0Ea6WIuKJwMSxVNXMXDE3qnH/y+2UiXuqLdoPUoUJlQgSu7ScTwVu8SO2sb1Wx6y5pQtJf4FFM3kqyTWLGUnKM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR10MB1407.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(38100700002)(86362001)(8936002)(508600001)(316002)(66946007)(66556008)(6916009)(66476007)(8676002)(4326008)(83380400001)(6486002)(5660300002)(966005)(6512007)(107886003)(103116003)(52116002)(2616005)(2906002)(6666004)(1076003)(6506007)(186003)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: sMVAWLXrrxnl1FP7rGA8mbdPT5Yh3iju2Ns2dySbkDS07GRgngATcolnkx4RvBKGZMZH4ltJ0A2yHX3UY3MHV6w3Ok7qwecFq2pcwz9AnZAQYYVGky6HtCQ7Sv/FxVCE/9IsIcvK/tKgnkCZH6G++mabb78ad1N8pcEz17NJFqpK3UXDhssjOTmKSWU45ONAYzeJ4jxtVJ/cGhfAwAcQnzZgiTW0L4iK/LloU+rX2+MWqbCYpnn4rDxKO9uOVSI3me9zxVSZ4FCJmsQeA5kP2U4KYKJlUebbydUEHCieUcwF9V1Kt0fSCIcKiTF1OVCGG8YXgEHdS2bTCCM4Uo0TQQK6SIKyaM+5sTCC+GfjR8aaP6JmEUqSNDABWuALFr9oduir9rJf5QAMVPhDQkMFDL8H7yx/tSMxbVy4kbxgoPqoyeKVxlENPLDgZ0eLGzT9+jP5BQv9IDq13qOhvwXdokRDGsaJzli25VaZf3nGT7qAHplL5SP+412QUOAQGNO2cq5L0d3lq1JJ6ptIlmiPLM4lLGq2T3cU/5+RZOu+fWGZMJvl9IBlyQjCOOU9plJBCG2HpdWAvxHYvksRbMUHxf9QzJW+40NJoAvhU+DlXRH1odG4UjUzrGDTIb7iEIzHtxpubM7emQ4D37bOhHoQkpUMLhAwrHv/5u+RU9uVXXoF6IsQ8Nie4kmXmVatYRdjuuXZ2itllVnoEAFM70FYWHbSWuKsELDlEgeU0OiveFQ9zsScmjPlwCt5kIO30B7i3chNLyIRrYYhtskQtRF40OkxEqp1QIn9lJNUY2MlddkW1oLF9Mu6b1ZJfCGPEo6jHL7LDCLE/ZSDGierHoWCdS0xdATVSyG++o+UQXSL6IrEtXWVX2dU4X2eG/wstjZFMf0yDwQy2iKe61wiQPZenB6tBeR1jbFUqZxlDZ8oqyqMiCSeoM6erSVlRmC9/2OcvYYg3E3Yfq7jKRDgh/BI2EDJArmY5bE26E2m6MYKuw5s7gTq5DPSoF6jwgwRnf0p+whdyBY+5Nn5Yq/qRbGH+CMMzFrRGcDeTSbzih9g3NaHWYWjpXNtMUWxcNcv/FOK8wqEoBH5rdv7dTpCZu63lAInvltlMTrEyRsniXl//vkv1hIHQH44sIAkOYv1ZTh830Df4rPPHZPYcLRQu3QE1hd/F8bkibjysRNC4938Fp+c2La1vHpHLdj82wn05Ij/kQdfVXr8N5PekZkMVMPxhUCN/2y+rpIm5p7ZR5h5vHHZ/OAKadMO6H4seGHjX/zehdeQBRLNZc6N1BzLXJNi8MQ1NRSmLZoT1FnJg1N1oQJVhaMN4ZxzXlHHXCk5+xgEN6L3pCmm5F7uo4fRnwuDYP3zU6TBY4QTX9BBGbTjbxVZ/+mBuHn1ilng1LmxCUtMzV/OVNzNiQKxejoqYTMR1fPXR9fKH42x7OE29sea1q4JzwBnW8hQS6AxABe8+2KL/hfGCN5p5QFIjZC08yxPoT9F1eopZ2MnQVz+qdoNHIXFFTcAHLIEzbgnlFbmV3rKqfSjC67BlnB/e33uGU9mfeaIA2oftZ7VK16GKRJaicZtkBuUzy6zD2cuuV/FOlNekBmFbZ7nqNkq2vLVTTkOXAvr8E+yxbpIEfK6TI5KHh6+iiUcKhIEzE/yy8IQHqbnsbFXMXt+u5Ckl0cOKMbNtaahymZ9/r6yNash5hNQjOwppeKYNwmq28jZlJkjNGDSmXFjU85zp7lh2+0JGbceESfqrwZ4VrgIEY6w+vG0w8pHfODDqk0ktL9GyJ6Nefmq0urBseyh X-MS-Exchange-AntiSpam-MessageData-1: LGSyoXBEqVtqOQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f079afb-e5e5-4215-8883-08da171e8ecf X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1407.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2022 16:08:44.1269 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oh9MjCVJpclK+hEKVBCpPAEtOb02gDAtLv4Va+f1UEpdxmqiDXgybL0gh3dk7hCaNcjnPGzslNxYEr6iA8NidQ5MKm0duAwGVsrD8ujClEc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB5723 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-05_04:2022-04-04, 2022-04-05 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204050091 X-Proofpoint-GUID: -9OxEUByaEuMcfPuHlBwxU_URVDwyfNW X-Proofpoint-ORIG-GUID: -9OxEUByaEuMcfPuHlBwxU_URVDwyfNW X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Guillermo E. Martinez via Libabigail" From: "Guillermo E. Martinez" Reply-To: "Guillermo E. Martinez" Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello libabigail team, This patch is meant to improves the performance to extract CTF information from Linux kernel, it depends of: https://sourceware.org/pipermail/libabigail/2022q1/004262.html Feedback will be welcomed and appreciated as ever!, Kind regards, Guillermo The _same_ ctf archive is being open/close several times by vmlinux corpus and for each kernel module belongs to a group, it's hight time consuming during ctf extraction info from Linux kernel. So, this patch improves the performance up to 300% (from ~2m:50s to ~50s), storing a cached `ctf_archive_t' pointer from vmlinux (the main_corpus_from_current_group) using the new `open_vmlinux_ctf_archive' function, and since this ctf archive file contains the information for kernel modules as well, then it's reused by each module to be processed in the group by ctf reader using `set_vmlinux_ctf_archive' function. Doing so, `read_context::ctfa` member should be updated if corpus origin is `CTF_ORIGIN', otherwise it must contain a valid address, and `ctf_close' must be called after processing all group's members, that is in `reader_context' destructor. * include/abg-ctf-reader.h (ctf_reader::{open_vmlinux_ctf_archive, vmlinux_ctf_archive,set_vmlinux_ctf_archive}): Add new functions. * src/abg-ctf-reader.cc (read_context::~read_context): Add destructor. (ctf_reader::read_corpus): Adjust `ctf archive' if corpus origin is `CTF_ORIGIN'. * src/abg-tools-utils.cc (get_binary_paths_from_kernel_dist): Use new `open_vmlinux_ctf_archive' and `set_vmlinux_ctf_archive' to store a cached `ctf_archive_t' type gather from vmlinux and be reused by the rest of kernel modules. Signed-off-by: Guillermo E. Martinez --- include/abg-ctf-reader.h | 11 ++++++-- src/abg-ctf-reader.cc | 56 +++++++++++++++++++++++++++++----------- src/abg-tools-utils.cc | 14 ++++++---- 3 files changed, 59 insertions(+), 22 deletions(-) diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h index 827d1bc2..09bf4020 100644 --- a/include/abg-ctf-reader.h +++ b/include/abg-ctf-reader.h @@ -49,8 +49,15 @@ reset_read_context(read_context_sptr &ctxt, const std::string& elf_path, ir::environment* environment); void -set_vmlinux_ctfa_path(read_context& ctxt, - const string& filename); +open_vmlinux_ctf_archive(read_context& ctxt, + const string& vmlinux_ctfa_path); +ctf_archive_t * +vmlinux_ctf_archive(read_context& ctxt); + +void +set_vmlinux_ctf_archive(read_context& ctxt, + void *ctfa); + std::string dic_type_key(ctf_dict_t *dic, ctf_id_t ctf_type); } // end namespace ctf_reader diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc index b9b3d939..5efa6fc7 100644 --- a/src/abg-ctf-reader.cc +++ b/src/abg-ctf-reader.cc @@ -58,10 +58,6 @@ public: /// be read from the file then this is NULL. ctf_archive_t *ctfa; - /// The name of the vmlinux file from which the CTF archive got - /// extracted. - string vmlinux_ctfa_path_; - /// A map associating CTF type ids with libabigail IR types. This /// is used to reuse already generated types. std::map types_map; @@ -213,10 +209,14 @@ public: elf_fd = -1; is_elf_exec = false; ctfa = NULL; - vmlinux_ctfa_path_ = ""; symtab.reset(); cur_corpus_group_.reset(); } + + ~read_context() + { + ctf_close(ctfa); + } }; // end class read_context. /// Forward reference, needed because several of the process_ctf_* @@ -1332,9 +1332,7 @@ read_corpus(read_context *ctxt, elf_reader::status &status) } int errp; - if (corp->get_origin() == corpus::LINUX_KERNEL_BINARY_ORIGIN) - ctxt->ctfa = ctf_arc_open(ctxt->vmlinux_ctfa_path_.c_str(), &errp); - else + if (corp->get_origin() == corpus::CTF_ORIGIN) /* Build the ctfa from the contents of the relevant ELF sections, and process the CTF archive in the read context, if any. Information about the types, variables, functions, etc contained @@ -1353,7 +1351,6 @@ read_corpus(read_context *ctxt, elf_reader::status &status) ctxt->cur_corpus_->sort_variables(); /* Cleanup and return. */ - ctf_close(ctxt->ctfa); close_elf_handler(ctxt); return corp; } @@ -1383,7 +1380,7 @@ set_read_context_corpus_group(read_context& ctxt, { ctxt.cur_corpus_group_ = group; } -// + /// Read a corpus and add it to a given @ref corpus_group. /// /// @param ctxt the reading context to consider. @@ -1436,18 +1433,47 @@ reset_read_context(read_context_sptr &ctxt, ctxt->initialize(elf_path, environment); } -/// Set the @ref filename being assigned to the current read context. +/// Open CTF archive in a read context for a given path. /// /// @param ctxt the read_context to consider. /// -/// @param filename the @ref vmlinux CTFA filename to set. +/// @param vmlinux_ctfa_path the vmlinux CTFA filename +/// to be opened. void -set_vmlinux_ctfa_path(read_context& ctxt, - const string& filename) +open_vmlinux_ctf_archive(read_context& ctxt, + const string& vmlinux_ctfa_path) { - ctxt.vmlinux_ctfa_path_ = filename; + int errp; + if ((ctxt.ctfa = ctf_arc_open(vmlinux_ctfa_path.c_str(), + &errp)) == NULL ) + { + std::cerr << "cannot open: " + << ctf_errmsg (errp) + << "\n"; + std::abort(); + } } + +/// Set CTF archive member for a given read context. +/// +/// @param ctxt the read_context to consider. +/// +/// @param ctfa reference to be set. +void +set_vmlinux_ctf_archive(read_context& ctxt, + void *ctfa) +{ + ctxt.ctfa = static_cast(ctfa); +} + +/// Return CTF archive member for a given read context. +/// +/// @param ctxt the read_context to consider. +ctf_archive_t * +vmlinux_ctf_archive(read_context& ctxt) +{ return ctxt.ctfa; } + std::string dic_type_key(ctf_dict_t *dic, ctf_id_t ctf_type) { diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index b73786a8..5995a4ac 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -2577,12 +2577,13 @@ build_corpus_group_from_kernel_dist_under(const string& root, bool got_binary_paths = get_binary_paths_from_kernel_dist(root, debug_info_root, vmlinux, modules); #ifdef WITH_CTF - string vmlinux_ctfa; + string vmlinux_ctfa_path; if (got_binary_paths && env->get_debug_format_type() == environment::CTF_FORMAT_TYPE) { - got_binary_paths = get_vmlinux_ctfa_path_from_kernel_dist(root, vmlinux_ctfa); - ABG_ASSERT(!vmlinux_ctfa.empty()); + got_binary_paths = + get_vmlinux_ctfa_path_from_kernel_dist(root, vmlinux_ctfa_path); + ABG_ASSERT(!vmlinux_ctfa_path.empty()); } #endif @@ -2684,11 +2685,14 @@ build_corpus_group_from_kernel_dist_under(const string& root, else if (env->get_debug_format_type() == environment::CTF_FORMAT_TYPE) { ctf_reader::read_context_sptr ctxt; + void *vmlinux_ctfa = nullptr; + if (!vmlinux.empty()) { ctxt = ctf_reader::create_read_context(vmlinux, env.get()); - set_vmlinux_ctfa_path(*ctxt, vmlinux_ctfa); + open_vmlinux_ctf_archive(*ctxt, vmlinux_ctfa_path); + vmlinux_ctfa = vmlinux_ctf_archive(*ctxt); group.reset(new corpus_group(env.get(), root)); set_read_context_corpus_group(*ctxt, group); @@ -2725,7 +2729,7 @@ build_corpus_group_from_kernel_dist_under(const string& root, << ") ... " << std::flush; reset_read_context(ctxt, *m, env.get()); - set_vmlinux_ctfa_path(*ctxt, vmlinux_ctfa); + set_vmlinux_ctf_archive(*ctxt, vmlinux_ctfa); set_read_context_corpus_group(*ctxt, group); t.start();