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 25B719AA8 for ; Fri, 13 May 2016 17:48:44 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 13 May 2016 08:48:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,614,1455004800"; d="scan'208";a="979871460" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 13 May 2016 08:48:43 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 13 May 2016 08:48:42 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.211]) by FMSMSX102.amr.corp.intel.com ([169.254.10.110]) with mapi id 14.03.0248.002; Fri, 13 May 2016 08:48:42 -0700 From: "Wiles, Keith" To: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC PATCH] tools:new tool for system info CPU, memory and huge pages Thread-Index: AQHRrS7sHVSgKL84Q0m/7MYiL8oo0g== Date: Fri, 13 May 2016 15:48:42 +0000 Message-ID: <9407598A-CC69-4FEA-BB0F-F311E9B4126E@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.118.83] Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC PATCH] tools:new tool for system info CPU, memory and huge pages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2016 15:48:45 -0000 U29ycnkgdGhpcyBvbmUgc2hvdWxkIGhhdmUgYm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xlbmFtZSkpDQo+Kw0KPitkZWYgY3B1bGlzdF9wYXJzZShp bmZvKToNCj4rICAgICcnJyAnJycNCj4rICAgIGNwdXNldCA9IFtdDQo+KyAgICBmb3IgYyBpbiBy YW5nZSgwLCAyNTUpOg0KPisgICAgICAgIGNwdXNldC5hcHBlbmQoMCkNCj4rDQo+KyAgICByYW5n ZXMgPSBpbmZvLnNwbGl0KCcsJykNCj4rICAgIGZvciByIGluIHJhbmdlczoNCj4rICAgICAgICBp ZiBub3QgJy0nIGluIHI6DQo+KyAgICAgICAgICAgIGNwdXNldFtpbnQocildID0gMQ0KPisgICAg ICAgIGVsc2U6DQo+KyAgICAgICAgICAgIGxvdywgaGlnaCA9IGdldF9yYW5nZShyKQ0KPisgICAg ICAgICAgICBmb3IgYyBpbiByYW5nZShsb3csIGhpZ2ggKyAxKToNCj4rICAgICAgICAgICAgICAg IGNwdXNldFtjXSA9IDENCj4rDQo+KyAgICByZXR1cm4gY3B1c2V0DQo+Kw0KPitkZWYgcGF0aF9y ZWFkX2NwdXNldChmbiwgbnVtKToNCj4rICAgICcnJyAnJycNCj4rICAgIGluZm8gPSBnZXRfdG9w b2xvZ3lfaW5mbyhudW0sIGZuKQ0KPisgICAgcmV0dXJuIGNwdWxpc3RfcGFyc2UoaW5mby5zdHJp cCgpKQ0KPisNCj4rZGVmIHNldF9jb3VudChhcnIpOg0KPisgICAgY250ID0gMA0KPisgICAgZm9y IGMgaW4gYXJyOg0KPisgICAgICAgIGNudCA9IGNudCArIGMNCj4rICAgIHJldHVybiBjbnQNCj4r DQo+K2RlZiByZWFkX3RvcG9sb2d5KG5jcHVzLCBjcHUpOg0KPisgICAgZ2xvYmFsIHN5c19pbmZv DQo+Kw0KPisgICAgcGF0aCA9IHRvcG9sb2d5X3BhdGgoY3B1LCAidGhyZWFkX3NpYmxpbmdzX2xp c3QiKQ0KPisgICAgaWYgb3MuYWNjZXNzKHBhdGgsIG9zLkZfT0spID09IEZhbHNlOg0KPisgICAg ICAgIHByaW50ICJQYXRoICglcykgTm90IGZvdW5kIiAlIHBhdGgNCj4rICAgICAgICByZXR1cm4g IiINCj4rDQo+KyAgICB0aHJlYWRfc2libGluZ3MgPSBwYXRoX3JlYWRfY3B1c2V0KCJ0aHJlYWRf c2libGluZ3NfbGlzdCIsIGNwdSkNCj4rICAgIGNvcmVfc2libGluZ3MgPSBwYXRoX3JlYWRfY3B1 c2V0KCJjb3JlX3NpYmxpbmdzX2xpc3QiLCBjcHUpDQo+Kw0KPisgICAgcGF0aCA9IHRvcG9sb2d5 X3BhdGgoY3B1LCAiYm9va19zaWJsaW5nc19saXN0IikNCj4rICAgIGlmIG9zLmFjY2VzcyhwYXRo LCBvcy5GX09LKToNCj4rICAgICAgICBib29rX3NpYmxpbmdzID0gcGF0aF9yZWFkX2NwdXNldCgi Ym9va19zaWJsaW5nc19saXN0IiwgY3B1KQ0KPisgICAgZWxzZToNCj4rICAgICAgICBib29rX3Np YmxpbmdzID0gW10NCj4rDQo+KyAgICBpZiBub3QgJ250aHJlYWRzJyBpbiBzeXNfaW5mbzoNCj4r ICAgICAgICBudGhyZWFkcyA9IHNldF9jb3VudCh0aHJlYWRfc2libGluZ3MpDQo+KyAgICAgICAg aWYgbnRocmVhZHMgPT0gMDoNCj4rICAgICAgICAgICAgbnRocmVhZHMgPSAxDQo+KyAgICAgICAg bmNvcmVzID0gc2V0X2NvdW50KGNvcmVfc2libGluZ3MpL250aHJlYWRzDQo+KyAgICAgICAgaWYg bmNvcmVzID09IDA6DQo+KyAgICAgICAgICAgIG5jb3JlcyA9IDENCj4rICAgICAgICBuc29ja2V0 cyA9IG5jcHVzIC8gbnRocmVhZHMgLyBuY29yZXMNCj4rICAgICAgICBpZiBuc29ja2V0cyA9PSAw Og0KPisgICAgICAgICAgICBuc29ja2V0cyA9IDENCj4rICAgICAgICBuYm9va3MgPSBuY3B1cyAv IG50aHJlYWRzIC8gbmNvcmVzIC8gbnNvY2tldHMNCj4rICAgICAgICBpZiBuYm9va3MgP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3lzX2luZm8sIGluZGVudD00KQ0KPisNCj4rZGVmIG1haW4oKToNCj4rICAgICcn J3Byb2dyYW0gbWFpbiBmdW5jdGlvbicnJw0KPisgICAgZ2xvYmFsIG1hY2hpbmVfcmVhZGFibGUN Cj4rICAgIGdsb2JhbCBzeXNfaW5mbw0KPisNCj4rICAgIHBhcnNlX2FyZ3MoKQ0KPisNCj4rICAg IGdhdGhlcl9pbmZvcm1hdGlvbigpDQo+Kw0KPisgICAgaWYgbWFjaGluZV9yZWFkYWJsZSA+IDA6 DQo+KyAgICAgICAganNvbl9kZXRhaWxzID0geydzeXN0ZW0nOiB7DQo+KyAgICAgICAgICAgICdz eXNuYW1lJzogICAgICAgICAgc3lzX2luZm9bJ3N5c25hbWUnXSwNCj4rICAgICAgICAgICAgJ3Zl cnNpb24nOiAgICAgICAgICBzeXNfaW5mb1sndmVyc2lvbiddLA0KPisgICAgICAgICAgICAncmVs ZWFzZSc6ICAgICAgICAgIHN5c19pbmZvWydyZWxlYXNlJ10sDQo+KyAgICAgICAgICAgICdtYWNo aW5lJzogICAgICAgICAgc3lzX2luZm9bJ21hY2hpbmUnXSwNCj4rICAgICAgICAgICAgfX0NCj4r DQo+KyAgICAgICAgY3B1X2luZm8gPSB7J2NwdSc6IHsNCj4rICAgICAgICAgICAgJ21vZGVsX25h bWUnOiAgICAgICBzeXNfdmFsdWUoJ21vZGVsIG5hbWUnKSwNCj4rICAgICAgICAgICAgJ250aHJl YWRzJzogICAgICAgICBzeXNfdmFsdWUoJ250aHJlYWRzJyksDQo+KyAgICAgICAgICAgICduY29y ZXMnOiAgICAgICAgICAgc3lzX3ZhbHVlKCduY29yZXMnKSwNCj4rICAgICAgICAgICAgJ25zb2Nr ZXRzJzogICAgICAgICBzeXNfdmFsdWUoJ25zb2NrZXRzJyksDQo+KyAgICAgICAgICAgICduYm9v a3MnOiAgICAgICAgICAgc3lzX3ZhbHVlKCduYm9va3MnKSwNCj4rICAgICAgICAgICAgJ25sY29y ZXMnOiA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AgICAgICBpZiBzaG93X3BjaToN Cj4rICAgICAgICAgICAganNvbl9kZXRhaWxzLnVwZGF0ZSh7J3BjaSc6IHN5c192YWx1ZSgncGNp Jyl9KQ0KPisNCj4rICAgICAgICBpZiBtYWNoaW5lX3JlYWRhYmxlID09IDI6DQo+KyAgICAgICAg ICAgIHByaW50IGpzb24uZHVtcHMoanNvbl9kZXRhaWxzLCBzb3J0X2tleXM9RmFsc2UsIGluZGVu dD00KQ0KPisgICAgICAgIGVsc2U6DQo+KyAgICAgICAgICAgIHByaW50IGpzb24uZHVtcHMoanNv bl9kZXRhaWxzLCBzb3J0X2tleXM9RmFsc2UsIHNlcGFyYXRvcnM9KCcsICcsICc6JykpDQo+KyAg ICBlbHNlOg0KPisgICAgICAgIGlmIGxlbihzeXNfaW5mbykgPiAwOg0KPisgICAgICAgICAgICBw cmludCAiU3lzdGVtIEluZm9ybWF0aW9uOiINCj4rICAgICAgICAgICAgcHJpbnQgIiAgIE1vZGVs IE5hbWUgOiAlcyIgJSBzeXNfdmFsdWUoJ21vZGVsIG5hbWUnKQ0KPisgICAgICAgICAgICBwcmlu dCAiICAgc3lzbmFtZSAgICA6ICVzIiAlIHN5c192YWx1ZSgnc3lzbmFtZScpDQo+KyAgICAgICAg ICAgIHByaW50ICIgICByZWxlYXNlICAgIDogJXMiICUgc3lzX3ZhbHVlKCdyZWxlYXNlJykNCj4r ICAgICAgICAgICAgcHJpbnQgIiAgIHZlcnNpb24gICAgOiAlcyIgJSBzeXNfdmFsdWUoJ3ZlcnNp b24nKQ0KPisgICAgICAgICAgICBwcmludCAiICAgbWFjaGluZSAgICA6ICVzIiAlIHN5c192YWx1 ZSgnbWFjaGluZScpDQo+KyAgICAgICAgICAgIHByaW50ICIiDQo+Kw0KPisgICAgICAgICAgICBw cmludCAiQ1BVIEluZm9ybWF0aW9uOiINCj4rICAgICAgICAgICAgcHJpbnQgIiAgIG50aHJlYWRz ICAgOiAlM2QiICUgc3lzX3ZhbHVlKCdudGhyZWFkcycpDQo+KyAgICAgICAgICAgIHByaW50ICIg ICBuY29yZXMgICAgIDogJTNkIiAlIHN5c192YWx1ZSgnbmNvcmVzJykNCj4rICAgICAgICAgICAg cHJpbnQgIiAgIG5zb2NrZXRzICAgOiAlM2QiICUgc3lzX3ZhbHVlKCduc29ja2V0cycpDQo+KyAg ICAgICAgICAgIHByaW50ICIgICBuYm9va3MgICAgIDogJTNkIiAlIHN5c192YWx1ZSgnbmJvb2tz JykNCj4rICAgICAgICAgICAgcHJpbnQgIiAgIG5sY29yZXMgICAgOiAlM2QiICUgc3lzX3ZhbHVl KCdubGNvcmVzJykNCj4rDQo+KyAgICAgICAgICAgIHByaW50ICIiDQo+KyAgICAgICAgaWYgbGVu KHN5c19pbmZvWydtZW1vcnknXSkgPiAwOg0KPisgICAgICAgICAgICBwcmludCAiTWVtb3J5OiIN Cj4rICAgICAgICAgICAgcHJpbnQgIiAgIFRvdGFsICAgIDogIiwgbWVtX3ZhbHVlKCdNZW1Ub3Rh bCcpDQo+KyAgICAgICAgICAgIHByaW50ICIgICBGcmVlICAgICA6ICIsIG1lbV92YWx1ZSgnTWVt RnJlZScpDQo+KyAgICAgICAgICAgIHByaW50ICIgICBBdmFpbGFibGU6ICIsIG1lbV92YWx1ZSgn TWVtQXZhaWxhYmxlJykNCj4rICAgICAgICAgICAgcHJpbnQgIiINCj4rICAgICAgICAgICAgcHJp bnQgIkh1Z2UgUGFnZXM6Ig0KPisgICAgICAgICAgICBwcmludCAiICAgVG90YWwgICAgOiAiLCBt ZW1fdmFsdWUoJ0h1Z2VQYWdlc19Ub3RhbCcpDQo+KyAgICAgICAgICAgIHByaW50ICIgICBGcmVl ICAgICA6ICIsIG1lbV92YWx1ZSgnSHVnZVBhZ2VzX0ZyZWUnKQ0KPisgICAgICAgICAgICBwcmlu dCAiICAgUmVzZXJ2ZWQgOiAiLCBtZW1fdmFsdWUoJ0h1Z2VQYWdlc19Sc3ZkJykNCj4rICAgICAg ICAgICAgcHJpbnQgIi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