From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2E22D4C9D for ; Mon, 25 Jun 2018 17:59:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 08:59:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,270,1526367600"; d="scan'208";a="210998595" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga004.jf.intel.com with ESMTP; 25 Jun 2018 08:59:48 -0700 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 w5PFxldL032521; Mon, 25 Jun 2018 16:59:47 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w5PFxlmN026641; Mon, 25 Jun 2018 16:59:47 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w5PFxl0P026637; Mon, 25 Jun 2018 16:59:47 +0100 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 Date: Mon, 25 Jun 2018 16:59:45 +0100 Message-Id: <293393804c84669c55fbdfd157a6c88150e7754e.1529940601.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 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: Mon, 25 Jun 2018 15:59:53 -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