Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbbD3K7W (ORCPT ); Thu, 30 Apr 2015 06:59:22 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:14603 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbbD3Kxg (ORCPT ); Thu, 30 Apr 2015 06:53:36 -0400 From: Wang Nan To: , , , , , , CC: , , , Subject: [RFC PATCH 20/22] perf bpf: clean elf memory after loading. Date: Thu, 30 Apr 2015 10:52:43 +0000 Message-ID: <1430391165-30267-21-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1430391165-30267-1-git-send-email-wangnan0@huawei.com> References: <1430391165-30267-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.197.210] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.554209AE.01CA,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9d79a6683c38904c395f3cc310c77fa4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 875 Lines: 28 After all eBPF programs in an object file are loaded, related ELF information is useless. Close the object file and free those memory. Signed-off-by: Wang Nan --- tools/perf/util/bpf-loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 6587e99..208f5e8 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -944,6 +944,7 @@ int bpf__load(const char *path) if ((err = bpf_obj_load_progs(obj))) goto out; + bpf_obj_clear_elf(obj); list_add(&obj->list, &bpf_obj_list); return 0; out: -- 1.8.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/