From patchwork Wed Aug 15 18:55:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masayoshi Mizuma X-Patchwork-Id: 958001 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H+bpPiUM"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41rJZX1x5vz9s7Q for ; Thu, 16 Aug 2018 04:55:45 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C54823E6C42 for ; Wed, 15 Aug 2018 20:55:38 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) by picard.linux.it (Postfix) with ESMTP id 0947A3E6C21 for ; Wed, 15 Aug 2018 20:55:37 +0200 (CEST) Received: from mail-yw1-xc41.google.com (mail-yw1-xc41.google.com [IPv6:2607:f8b0:4864:20::c41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 65978600492 for ; Wed, 15 Aug 2018 20:55:35 +0200 (CEST) Received: by mail-yw1-xc41.google.com with SMTP id y203-v6so1581584ywd.9 for ; Wed, 15 Aug 2018 11:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=15gvTTHektBDDIfKRsa/cnzgrBTSc8XG7hMVbZXkI80=; b=H+bpPiUMjOn5F9LAVyCOPA2CeMUQHJmFMiVUvPEJ9EzMcejRXddeRjA9xCC7TjsyGD KM0o8mJlNVIe0RPAW91tvvn7e+T6Xk23Og+pDRz01+0xUV56Ddz5OJP73KWZd5HRz15z NWy4+htBihqwTGUjw/1BlQouzDEIcIZrW0OsJEMi9wz/kZWIIwbHXdJ2bgxYmjnbsKX7 SpU1Z0sHmqjLEBHDJfDp7KWU9emkHRrpBvvAOFraiPtoJJQZ9To8iwy5+ojdhJngsBPZ 3ZVAOVpa2ebdtMd/i+Tu+AUb9vgA/nHkq5ZEDgV8x78FXunZGwZMQ09IyQDgh80Y5JXC CJOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=15gvTTHektBDDIfKRsa/cnzgrBTSc8XG7hMVbZXkI80=; b=j+qMKqlp6Y8aHxRyILJ+QAbwTYseL6rp7KYAREig4E6I3Icl5XjrglpqIiJR9UVAyd ecmrDQ1WViH/0WeyyBxRC4IWvN0yqcNd/j2HjWqPWEid+uDwN67NZK9Y9v7lpTP/5eWa qUua6a39KlrfMNlrlumHStf5gw+UsbVNEwtbIQSPtQMKTZotlrta47sX3X822AO1noq4 JtzbchUK8BtFUq69LG88lF/C4aEkKtMiHPW+NShO8urxHzWLsOJxQiFueATDyW93ktP/ tUnvGzqN9qD6J2Rz5FtLsRMuK59Bz8tG3oN20bQws8IM5cjsEDcFkWkGV4fsri40ssyN gvxw== X-Gm-Message-State: AOUpUlELda9XCXycP6PX9cWishiIidvq7Mo1cYVhFFnRii399CMRYrMv jYclM0RtKcx2f3y49yFPTromms0= X-Google-Smtp-Source: AA+uWPybV84CAvjJM14tbhhrmpzdzwj8o9aMzPreqPpeRUohUhKqYS8/HbXccWoHVWSvCGTb6ON+fg== X-Received: by 2002:a81:155:: with SMTP id 82-v6mr14081679ywb.347.1534359334121; Wed, 15 Aug 2018 11:55:34 -0700 (PDT) Received: from gabell.redhat.com ([2601:18f:600:d880:8c49:fa6d:9d57:73cd]) by smtp.gmail.com with ESMTPSA id z190-v6sm16839765ywz.89.2018.08.15.11.55.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 11:55:33 -0700 (PDT) From: Masayoshi Mizuma To: ltp@lists.linux.it Date: Wed, 15 Aug 2018 14:55:16 -0400 Message-Id: <20180815185516.32726-1-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: clamav-milter 0.99.2 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-5.smtp.seeweb.it Cc: Masayoshi Mizuma Subject: [LTP] [PATCH] ver_linux: use lscpu command result instead of /proc/cpuinfo X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Masayoshi Mizuma lscpu command shows the cpu information clearly. So let's use the result if the command is installed to the system. Signed-off-by: Masayoshi Mizuma --- ver_linux | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ver_linux b/ver_linux index dda337926..5f9260f5f 100755 --- a/ver_linux +++ b/ver_linux @@ -96,5 +96,10 @@ echo 'free reports:' free echo -echo '/proc/cpuinfo' -cat /proc/cpuinfo +echo 'cpuinfo:' +which lscpu > /dev/null 2>&1 +if [ $? -eq 0 ]; then + lscpu +else + cat /proc/cpuinfo +fi