Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2106926rwd; Tue, 13 Jun 2023 20:28:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oreXLOCHx/7Ip+Ng3XxSO6OUbsY/BeunysuiRd5mWChdRGBAWSXpBk0MTYc6z/EIXn+5g X-Received: by 2002:a17:90a:9c8:b0:25b:eba8:15d6 with SMTP id 66-20020a17090a09c800b0025beba815d6mr374154pjo.39.1686713306413; Tue, 13 Jun 2023 20:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686713306; cv=none; d=google.com; s=arc-20160816; b=IPwpu8q7+VJjjBzPwd/QGob9affKZDLIE/amJj475LVuWwewheFYndXSZVztXnxe/Q 0Ouu7EkrMzGmdAGYPA1e5Bz5o7+PORATx1nnDlzFmxbk4R/15MEpV5Tk9DA3hiRukyoC DnSJ0Thvz6UCklmyu8HBt4jiICGzHcR2IhIDBSpFYHairjZGOF1sQIZhrCxv0qGgrOa7 BZY4eyP9+0UVwdIU0mEqp1L+ZMe5fqFh3invgI7j2j35um5fc/NTw5SOJMpKI4WX88E7 BoE95ZEvfPFNK0NByg8b8PnflZBgqsPMA/LyrQk4u8ND50BO0uKM7tuKqCzCWnDf63t6 qcVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=w48tSpLqh1bjHgLcJdsXqvkcCf7nU4CX/ADnj4B4dnk=; b=hSVj+MAiI+JoIXwaifa5fbxKKlWXhUT620gwCmu81tjW60U4V4gp27zNlUn3CM/UKT 4MGRoiXEr1M/DiHzHs1X2h/o+o0hxuCzbK98OvZltVf8PU1uPKXItKV+qvqFdJKBD45i nbwUSdhsRLBPpF+Q+cf8pGBmXzfg6ywS6LU+Hir0b+XN5Rb7s+n+mFp7vxkn4ErytCg3 c+t1OLRyjBRUB+LxGNyfvX+v3iIkcYb/GxSKB4hU83y+qVkML3mB7xIm73FdcVleRX8J EZfNk9l12i/d6xzxRQGtmh60T1GpjnD4Jsmcx8MDJXrcSr/7euvbLsi3Yc7iDnhyaAMH Psqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WVi6RE4e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p18-20020a170902ebd200b001ae7da95d0esi9866343plg.479.2023.06.13.20.28.09; Tue, 13 Jun 2023 20:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WVi6RE4e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242499AbjFNDVG (ORCPT + 99 others); Tue, 13 Jun 2023 23:21:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242392AbjFNDU5 (ORCPT ); Tue, 13 Jun 2023 23:20:57 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86BFC196; Tue, 13 Jun 2023 20:20:55 -0700 (PDT) X-UUID: 76115b980a6211ee9cb5633481061a41-20230614 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=w48tSpLqh1bjHgLcJdsXqvkcCf7nU4CX/ADnj4B4dnk=; b=WVi6RE4eL72h0ItIjr69r/D4N7M9q45UPK3mGZQ3sMqUgG5nNUO20RSrL9uAEfkQACtT3Ys+Gsg/dz8NzB/0RzQ8HjLq6Sv8U2+14IEAu1Yo4M33HtKh/qXsM1IDPUNB4AKz7N6khn8f8JPZGw0WVrnaauBkIOjB1qgIHcasFXU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.26,REQID:58c44784-1a93-475a-a639-9ef4b69fb3df,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:cb9a4e1,CLOUDID:de9b8b3e-7aa7-41f3-a6bd-0433bee822f3,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 76115b980a6211ee9cb5633481061a41-20230614 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1036596478; Wed, 14 Jun 2023 11:20:49 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 14 Jun 2023 11:20:48 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 14 Jun 2023 11:20:48 +0800 From: Wei Chin Tsai To: , Russell King , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , Wei Chin Tsai , , , Subject: [PATCH v2 2/3] memory: export symbols for memory related functions Date: Wed, 14 Jun 2023 11:20:34 +0800 Message-ID: <20230614032038.11699-3-Wei-chin.Tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230614032038.11699-1-Wei-chin.Tsai@mediatek.com> References: <20230614032038.11699-1-Wei-chin.Tsai@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In this patch, we modified 3 files and export symbols for 2 functions. Export symbols for "smap_gather_stats" functions so that user can have an idea for each user process memory's usage. Export symbols for "arch_vma_name" functions so that user can know the heap usage for each user process. According to these two information, user can do the memory statistics and anaysis. Signed-off-by: Wei Chin Tsai --- arch/arm/kernel/process.c | 1 + fs/proc/task_mmu.c | 5 +++-- kernel/signal.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 0e8ff85890ad..df91412a1069 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -343,6 +343,7 @@ const char *arch_vma_name(struct vm_area_struct *vma) { return is_gate_vma(vma) ? "[vectors]" : NULL; } +EXPORT_SYMBOL_GPL(arch_vma_name); /* If possible, provide a placement hint at a random offset from the * stack for the sigpage and vdso pages. diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 6259dd432eeb..814d7829a20b 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -773,8 +773,8 @@ static const struct mm_walk_ops smaps_shmem_walk_ops = { * * Use vm_start of @vma as the beginning address if @start is 0. */ -static void smap_gather_stats(struct vm_area_struct *vma, - struct mem_size_stats *mss, unsigned long start) +void smap_gather_stats(struct vm_area_struct *vma, + struct mem_size_stats *mss, unsigned long start) { const struct mm_walk_ops *ops = &smaps_walk_ops; @@ -809,6 +809,7 @@ static void smap_gather_stats(struct vm_area_struct *vma, else walk_page_range(vma->vm_mm, start, vma->vm_end, ops, mss); } +EXPORT_SYMBOL_GPL(smap_gather_stats); #define SEQ_PUT_DEC(str, val) \ seq_put_decimal_ull_width(m, str, (val) >> 10, 8) diff --git a/kernel/signal.c b/kernel/signal.c index b5370fe5c198..a1abe77fcdc3 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -4700,6 +4700,7 @@ __weak const char *arch_vma_name(struct vm_area_struct *vma) { return NULL; } +EXPORT_SYMBOL_GPL(arch_vma_name); static inline void siginfo_buildtime_checks(void) { -- 2.18.0