aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/vm/page-types.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index 2279b616a7ac..8c28be6a47cb 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -674,6 +674,7 @@ static void usage(void)
674 printf( 674 printf(
675"page-types [options]\n" 675"page-types [options]\n"
676" -r|--raw Raw mode, for kernel developers\n" 676" -r|--raw Raw mode, for kernel developers\n"
677" -d|--describe flags Describe flags\n"
677" -a|--addr addr-spec Walk a range of pages\n" 678" -a|--addr addr-spec Walk a range of pages\n"
678" -b|--bits bits-spec Walk pages with specified bits\n" 679" -b|--bits bits-spec Walk pages with specified bits\n"
679" -p|--pid pid Walk process address space\n" 680" -p|--pid pid Walk process address space\n"
@@ -686,6 +687,10 @@ static void usage(void)
686" -X|--hwpoison hwpoison pages\n" 687" -X|--hwpoison hwpoison pages\n"
687" -x|--unpoison unpoison pages\n" 688" -x|--unpoison unpoison pages\n"
688" -h|--help Show this usage message\n" 689" -h|--help Show this usage message\n"
690"flags:\n"
691" 0x10 bitfield format, e.g.\n"
692" anon bit-name, e.g.\n"
693" 0x10,anon comma-separated list, e.g.\n"
689"addr-spec:\n" 694"addr-spec:\n"
690" N one page at offset N (unit: pages)\n" 695" N one page at offset N (unit: pages)\n"
691" N+M pages range from N to N+M-1\n" 696" N+M pages range from N to N+M-1\n"
@@ -884,6 +889,15 @@ static void parse_bits_mask(const char *optarg)
884 add_bits_filter(mask, bits); 889 add_bits_filter(mask, bits);
885} 890}
886 891
892static void describe_flags(const char *optarg)
893{
894 uint64_t flags = parse_flag_names(optarg, 0);
895
896 printf("0x%016llx\t%s\t%s\n",
897 (unsigned long long)flags,
898 page_flag_name(flags),
899 page_flag_longname(flags));
900}
887 901
888static const struct option opts[] = { 902static const struct option opts[] = {
889 { "raw" , 0, NULL, 'r' }, 903 { "raw" , 0, NULL, 'r' },
@@ -891,6 +905,7 @@ static const struct option opts[] = {
891 { "file" , 1, NULL, 'f' }, 905 { "file" , 1, NULL, 'f' },
892 { "addr" , 1, NULL, 'a' }, 906 { "addr" , 1, NULL, 'a' },
893 { "bits" , 1, NULL, 'b' }, 907 { "bits" , 1, NULL, 'b' },
908 { "describe" , 1, NULL, 'd' },
894 { "list" , 0, NULL, 'l' }, 909 { "list" , 0, NULL, 'l' },
895 { "list-each" , 0, NULL, 'L' }, 910 { "list-each" , 0, NULL, 'L' },
896 { "no-summary", 0, NULL, 'N' }, 911 { "no-summary", 0, NULL, 'N' },
@@ -907,7 +922,7 @@ int main(int argc, char *argv[])
907 page_size = getpagesize(); 922 page_size = getpagesize();
908 923
909 while ((c = getopt_long(argc, argv, 924 while ((c = getopt_long(argc, argv,
910 "rp:f:a:b:lLNXxh", opts, NULL)) != -1) { 925 "rp:f:a:b:d:lLNXxh", opts, NULL)) != -1) {
911 switch (c) { 926 switch (c) {
912 case 'r': 927 case 'r':
913 opt_raw = 1; 928 opt_raw = 1;
@@ -924,6 +939,10 @@ int main(int argc, char *argv[])
924 case 'b': 939 case 'b':
925 parse_bits_mask(optarg); 940 parse_bits_mask(optarg);
926 break; 941 break;
942 case 'd':
943 opt_no_summary = 1;
944 describe_flags(optarg);
945 break;
927 case 'l': 946 case 'l':
928 opt_list = 1; 947 opt_list = 1;
929 break; 948 break;