Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814AbbF2NXj (ORCPT ); Mon, 29 Jun 2015 09:23:39 -0400 Received: from mail.kernel.org ([198.145.29.136]:48280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbbF2NXd (ORCPT ); Mon, 29 Jun 2015 09:23:33 -0400 Date: Mon, 29 Jun 2015 10:23:29 -0300 From: Arnaldo Carvalho de Melo To: Hou Pengyang Cc: mingo@redhat.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, wangnan0@huawei.com, linux-kernel@vger.kernel.org, zhu.wen-jie@hp.com Subject: Re: [RFC] perf tools: Add hugetlbfs memory recognition Message-ID: <20150629132329.GC11747@kernel.org> References: <1435394953-146405-1-git-send-email-houpengyang@huawei.com> <558E6804.5060602@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <558E6804.5060602@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1400 Lines: 40 Em Sat, Jun 27, 2015 at 05:08:20PM +0800, Hou Pengyang escreveu: > There is something about MAP_HUGETLB. > In this patch, we check if a mmap area is hugetlbfs area by MAP_HUGETLB, > a bit in MMAP2 event. > However, if mmap area is hugetlb related, MAP_HUGETLB does not always > appear. Because, there are two ways generating MMAP2 event. > 1) when a new vm_area_struct is created, its info would be exported > as a MMAP2 event. > 2) perf reads /proc/pid/maps for generating MMAP2 event. > MAP_HUGETLB appears if MMAP2 event is generated on situation 1), > while not on situation 2). > This is because on situation 2), perf reads /proc/pid/maps, which > contains only PROT_READ/WRITE/EXEC, MAP_SHARED/MAP_PRIVATE, while more > details appear in /proc/pid/smaps, such as MAP_HUGETLB. Humm: [root@zoo ~]# wc -l /proc/`pidof firefox`/maps 934 /proc/4551/maps [root@zoo ~]# wc -l /proc/`pidof firefox`/smaps 14944 /proc/4551/smaps [root@zoo ~]# > So I wonder if there is a need to read /proc/pid/smaps instead of > /proc/pid/maps to generate MMAP2 event. Or we should solve the problem by > another way? Doing some research now... - Arnaldo -- 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/