From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 52E574CAB for ; Thu, 15 Nov 2018 16:47:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2018 07:47:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,236,1539673200"; d="scan'208";a="108355352" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 15 Nov 2018 07:47:23 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id wAFFlM4J024814; Thu, 15 Nov 2018 15:47:22 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id wAFFlM7Z028150; Thu, 15 Nov 2018 15:47:22 GMT Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id wAFFlMLX028146; Thu, 15 Nov 2018 15:47:22 GMT From: Anatoly Burakov To: dev@dpdk.org Cc: john.mcnamara@intel.com, bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, david.hunt@intel.com, mohammad.abdul.awal@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com Date: Thu, 15 Nov 2018 15:47:20 +0000 Message-Id: <979a0e8fbbef524e2c07d80265c8cc440382a450.1542291869.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [RFC v2 8/9] usertools: add hugepage info script X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 15:47:26 -0000 Add a simple hugepage info script for demonstration purposes. It lists the following information: - Currently configured persistent hugetlbfs mountpoints (fstab) - Currently mounted hugetlbfs mountpoints - Total number of hugepages for each size - Per-NUMA node number of hugepages for each size Signed-off-by: Anatoly Burakov --- usertools/hugepage-info.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 usertools/hugepage-info.py diff --git a/usertools/hugepage-info.py b/usertools/hugepage-info.py new file mode 100755 index 000000000..bbea35e7b --- /dev/null +++ b/usertools/hugepage-info.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + + +from __future__ import print_function +from DPDKConfigLib import HugeUtil, PlatformInfo, Util + +pc = HugeUtil.PersistentMountpointConfig() +print("Persistent hugetlbfs mountpoints:") + +for sz, mp in pc.mountpoints.items(): + print("%s: %s" % (Util.kilobytes_to_human_readable(sz), mp)) + +rc = HugeUtil.RuntimeMountpointConfig() +print("Current hugetlbfs mountpoints:") + +for sz, mp in rc.mountpoints.items(): + print("%s: %s" % (Util.kilobytes_to_human_readable(sz), mp)) + +info = PlatformInfo.PlatformInfo() +rhc = HugeUtil.RuntimeHugepageConfig() +print("Current hugepage configuration:") +for sz, nr in rhc.total_nr_hugepages.items(): + print("%s: %s" % (Util.kilobytes_to_human_readable(sz), nr)) + +print("Current per-NUMA node configuration:") +for node in info.numa_nodes: + for pagesz in info.hugepage_sizes_supported: + print("[Node %s] %s: %s" % (node, + Util.kilobytes_to_human_readable(pagesz), + rhc.hugepages_per_node[node, pagesz])) -- 2.17.1