From patchwork Thu Jun 7 22:54:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 926534 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=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.alibaba.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41218w39SQz9s1B for ; Fri, 8 Jun 2018 08:55:26 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 887151A980C for ; Fri, 8 Jun 2018 00:55:19 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 3426A1A96F6 for ; Fri, 8 Jun 2018 00:55:17 +0200 (CEST) Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 65F3A601B09 for ; Fri, 8 Jun 2018 00:55:14 +0200 (CEST) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R161e4; CH=green; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e07488; MF=yang.shi@linux.alibaba.com; NM=1; PH=DS; RN=6; SR=0; TI=SMTPD_---0T2Mv4tn_1528412099; Received: from e19h19392.et15sqa.tbsite.net(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0T2Mv4tn_1528412099) by smtp.aliyun-inc.com(127.0.0.1); Fri, 08 Jun 2018 06:55:08 +0800 From: Yang Shi To: chrubis@suse.cz, sergey.senozhatsky@gmail.com, minchan@kernel.org, liwang@redhat.com Date: Fri, 8 Jun 2018 06:54:59 +0800 Message-Id: <1528412099-50431-1-git-send-email-yang.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-7.5 required=7.0 tests=ENV_AND_HDR_SPF_MATCH, SPF_PASS,USER_IN_DEF_SPF_WL autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Cc: ltp@lists.linux.it Subject: [LTP] [PATCH v2] zram03: drop obsolete sysfs interfaces 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" Due to upstream linux commit c87d1655c29500b459fb135258a93f8309ada9c7 ("zram: remove obsolete sysfs attrs"), some sysfs interfaces are not available anymore. Check kernel version, and remove dumping them on >= 4.10 kernel to avoid test case failure. Suggested-by: Li Wang Signed-off-by: Yang Shi --- v1 --> v2: Check kernel version to dump proper stats per Li Wang's suggestion testcases/kernel/device-drivers/zram/zram03.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/testcases/kernel/device-drivers/zram/zram03.c b/testcases/kernel/device-drivers/zram/zram03.c index 3f7ab4e..58d88bc 100644 --- a/testcases/kernel/device-drivers/zram/zram03.c +++ b/testcases/kernel/device-drivers/zram/zram03.c @@ -185,11 +185,15 @@ static void print(char *string) static void dump_info(void) { print("initstate"); - print("compr_data_size"); - print("orig_data_size"); print("disksize"); - print("mem_used_total"); - print("num_reads"); - print("num_writes"); - print("zero_pages"); + + if ((tst_kvercmp(4, 10, 0)) < 0) { + /* The below stats are not available on 4.10 or newer kernel */ + print("compr_data_size"); + print("orig_data_size"); + print("mem_used_total"); + print("num_reads"); + print("num_writes"); + print("zero_pages"); + } }