Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176229
b: refs/heads/master
c: dcfe730
h: refs/heads/master
i:
  176227: a988856
v: v3
  • Loading branch information
Alex Chiang authored and Linus Torvalds committed Dec 15, 2009
1 parent 2982293 commit bfa0376
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1327bf18c8737aeb85226f02f102dfa065fddde
refs/heads/master: dcfe730c60030fb76e2794a8960c6bd84c6c6163
21 changes: 20 additions & 1 deletion trunk/Documentation/vm/page-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ static void usage(void)
printf(
"page-types [options]\n"
" -r|--raw Raw mode, for kernel developers\n"
" -d|--describe flags Describe flags\n"
" -a|--addr addr-spec Walk a range of pages\n"
" -b|--bits bits-spec Walk pages with specified bits\n"
" -p|--pid pid Walk process address space\n"
Expand All @@ -686,6 +687,10 @@ static void usage(void)
" -X|--hwpoison hwpoison pages\n"
" -x|--unpoison unpoison pages\n"
" -h|--help Show this usage message\n"
"flags:\n"
" 0x10 bitfield format, e.g.\n"
" anon bit-name, e.g.\n"
" 0x10,anon comma-separated list, e.g.\n"
"addr-spec:\n"
" N one page at offset N (unit: pages)\n"
" N+M pages range from N to N+M-1\n"
Expand Down Expand Up @@ -884,13 +889,23 @@ static void parse_bits_mask(const char *optarg)
add_bits_filter(mask, bits);
}

static void describe_flags(const char *optarg)
{
uint64_t flags = parse_flag_names(optarg, 0);

printf("0x%016llx\t%s\t%s\n",
(unsigned long long)flags,
page_flag_name(flags),
page_flag_longname(flags));
}

static const struct option opts[] = {
{ "raw" , 0, NULL, 'r' },
{ "pid" , 1, NULL, 'p' },
{ "file" , 1, NULL, 'f' },
{ "addr" , 1, NULL, 'a' },
{ "bits" , 1, NULL, 'b' },
{ "describe" , 1, NULL, 'd' },
{ "list" , 0, NULL, 'l' },
{ "list-each" , 0, NULL, 'L' },
{ "no-summary", 0, NULL, 'N' },
Expand All @@ -907,7 +922,7 @@ int main(int argc, char *argv[])
page_size = getpagesize();

while ((c = getopt_long(argc, argv,
"rp:f:a:b:lLNXxh", opts, NULL)) != -1) {
"rp:f:a:b:d:lLNXxh", opts, NULL)) != -1) {
switch (c) {
case 'r':
opt_raw = 1;
Expand All @@ -924,6 +939,10 @@ int main(int argc, char *argv[])
case 'b':
parse_bits_mask(optarg);
break;
case 'd':
opt_no_summary = 1;
describe_flags(optarg);
break;
case 'l':
opt_list = 1;
break;
Expand Down

0 comments on commit bfa0376

Please sign in to comment.