Received: by 10.223.176.5 with SMTP id f5csp749067wra; Tue, 30 Jan 2018 19:00:18 -0800 (PST) X-Google-Smtp-Source: AH8x226iQXA9wIbjYEiMZF7fIGKvBkDwUIYQGYTBNk+Al5FIVldtCH6B0Yyrfz1NfnDnby6WiLO1 X-Received: by 10.98.85.195 with SMTP id j186mr27772779pfb.77.1517367618694; Tue, 30 Jan 2018 19:00:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517367618; cv=none; d=google.com; s=arc-20160816; b=ItflA+c/PC9euKco1aoe0EF3AsNOxtV2z0yc6dXvEszU74BIB7DJPftkcJnf2nQup7 gcVj9IXVg/5NPVDnu/1oS7srHrWJJelDrJkExzIejcHv/88AjX+nxO4DeEYE8S9I98l9 a47jvObJZpIjVW9rVS2LDbo/EbcJyCwIBXy70AChR9bFTbM6MI5V1n7EzYdUsOEai8SB 3jt07S1yYZPmbP7hY9bpOebOV0VxwFrMjisjzGs1ktBVMDNirsnvjihlT8lA7wXulD0H 9J6KXkvvCDnDqfjBOL/PVWidBnoANhEtmLZRzI+sBIVYiufABbpTfV6/R5CqklPuLnrS X8Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=gEISEX+e4MFIwgDw10Oyh/+v0+Clp4SJ9/QW4CArDGs=; b=NNNukEacxN7V2tMREYa6TH3dLRNKIloF7ZBVonMkRgk7b0AyVvyO786g/3QI10HlIJ GQXgCppUFPf8HS/wpUEjspR3yMYhYxrkpzm2ZgvFCZnIqsMLcAUzV/f0NQvNAZU9QXfd Wavt1w6IS+q3MBCA8KKVm9fgiu1jYPG9dldNM8c549wypUM19Ps5I4SG/HQ3NA6UapwX nkPTdfBeeCXOKMX+oNWjMtxk0jq5eamwpWGtQqSNFcrKSaW0QVI1SqCUtY6bMWcsMbs+ B4VW53/llJUhG/VhNDBHg7LVGGrCRleoIJNzAzlK8j4RTwOFIt7Dv4UBJ52snjmwsehE Gc4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tALoPJHn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si944266plr.656.2018.01.30.19.00.04; Tue, 30 Jan 2018 19:00:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tALoPJHn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752321AbeAaClM (ORCPT + 99 others); Tue, 30 Jan 2018 21:41:12 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:52860 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927AbeAaClL (ORCPT ); Tue, 30 Jan 2018 21:41:11 -0500 Received: by mail-it0-f65.google.com with SMTP id u62so3278058ita.2 for ; Tue, 30 Jan 2018 18:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=gEISEX+e4MFIwgDw10Oyh/+v0+Clp4SJ9/QW4CArDGs=; b=tALoPJHn+ZfG/zDr13r9p4UHlZrTfgQDH2FDqLuNL0WtuwGJYeTKzjgcBzt8Vu1ME8 ynAwz+b16oXxpVT+xVQuVATH8HdxPsDRbtH5W29pvfQOeZWH3OvV0ZGEjcw1sRxV6JMo 6tvCm6FRVCxaJX9XTYN2qiHh/rBG9Vy73h9tGi8GPJ7Jt9mwrlxH05BX7dwpgSES2fnL NLqBG22TaBYLCB6CknKpDU1vgconFAab0jJ+WoLOUEx8GVDnEfimeqO2CShxHYhnUdFH CiJeRCsup8FEBO6ikeL6e16qfFug9xF4Cw4hwTqLo64JYWWUopf9F8qzGIMD86iv9BGw grZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=gEISEX+e4MFIwgDw10Oyh/+v0+Clp4SJ9/QW4CArDGs=; b=DTGPJqGai58Xke761BujJQ+orD1S6GuBQKDBKRI8U3Z9IoHXlZTAur6rzHKRHw6hlP g+N1X5y2iwdIKfpq0zbGmltcU4SaDESmwMvROGMmrAjeNEJzAxxPS/ZPk5lDV6oJXiAR njPx/NpV9nnAaEGr6c5BJA1LlKk2bot9BlANZMlGOY3YMt96Bdqisv6mAyP8yENQ+hsi miztI3SJO13v0Pf8JUCu8xqNKcFeyecAx8dW8TM5duuer8sB/aOOjLUqtVZ6+mWnCBNZ jjQ7+3kxg4Ol/lRkR+DCEWE2xWakEs8Byo6Sl23XOZ0sbaF4nlt7CKdx2XoMti1ao1nt WGrQ== X-Gm-Message-State: AKwxytfnngV9RhPCVZcjHjhHNo6UGILW9mz82QBWG/Qu/fEykXpwnlP+ HF6Dq5Gpp6BzPeoaiYM4RgSnbQ== X-Received: by 10.36.11.85 with SMTP id 82mr37027377itd.143.1517366470268; Tue, 30 Jan 2018 18:41:10 -0800 (PST) Received: from [2620:15c:17:3:98b3:7143:7aa5:edaa] ([2620:15c:17:3:98b3:7143:7aa5:edaa]) by smtp.gmail.com with ESMTPSA id g1sm6880009itg.10.2018.01.30.18.41.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 18:41:09 -0800 (PST) Date: Tue, 30 Jan 2018 18:41:08 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton cc: Naoya Horiguchi , Konstantin Khlebnikov , Vladimir Davydov , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [patch -mm] tools, vm: new option to specify kpageflags file fix fix In-Reply-To: <20180130160041.ced8e9bbb4741494147f476f@linux-foundation.org> Message-ID: References: <20180130160041.ced8e9bbb4741494147f476f@linux-foundation.org> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Jan 2018, Andrew Morton wrote: > On Tue, 30 Jan 2018 15:01:01 -0800 (PST) David Rientjes wrote: > > > page-types currently hardcodes /proc/kpageflags as the file to parse. > > This works when using the tool to examine the state of pageflags on the > > same system, but does not allow storing a snapshot of pageflags at a given > > time to debug issues nor on a different system. > > > > This allows the user to specify a saved version of kpageflags with a new > > page-types -F option. > > > > This, methinks: > > --- a/tools/vm/page-types.c~tools-vm-new-option-to-specify-kpageflags-file-fix > +++ a/tools/vm/page-types.c > @@ -791,7 +791,7 @@ static void usage(void) > " -N|--no-summary Don't show summary info\n" > " -X|--hwpoison hwpoison pages\n" > " -x|--unpoison unpoison pages\n" > -" -F|--kpageflags kpageflags file to parse\n" > +" -F|--kpageflags filename kpageflags file to parse\n" > " -h|--help Show this usage message\n" > "flags:\n" > " 0x10 bitfield format, e.g.\n" Please find a "fix fix" below per Naoya. Thanks both! diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c @@ -169,10 +169,10 @@ static int opt_raw; /* for kernel developers */ static int opt_list; /* list pages (in ranges) */ static int opt_no_summary; /* don't show summary */ static pid_t opt_pid; /* process to walk */ -const char * opt_file; /* file or directory path */ +const char *opt_file; /* file or directory path */ static uint64_t opt_cgroup; /* cgroup inode */ static int opt_list_cgroup;/* list page cgroup */ -static const char * opt_kpageflags; /* kpageflags file to parse */ +static const char *opt_kpageflags;/* kpageflags file to parse */ #define MAX_ADDR_RANGES 1024 static int nr_addr_ranges;