~ubuntu-branches/ubuntu/raring/crash/raring

« back to all changes in this revision

Viewing changes to help.c

  • Committer: Package Import Robot
  • Author(s): Stefan Bader
  • Date: 2012-10-25 16:29:52 UTC
  • mfrom: (0.1.17) (25.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121025162952-e42hkuic0u4h94p0
Tags: 6.1.0-1ubuntu1
* Merge from Debian unstable (LP: #1064475). Remaining changes:
  - debian/patches/01_spu_commands.patch
    + Provides SPU extension support
    + Enable SPU extension only on PPC (using .mk logic)
  - debian/rules:
    + Always build extensions and package them.
    + Cleanup for extensions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* help.c - core analysis suite
2
2
 *
3
3
 * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
4
 
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 David Anderson
5
 
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. All rights reserved.
 
4
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 David Anderson
 
5
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. All rights reserved.
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
31
31
static char *output_info[];
32
32
static char *input_info[];
33
33
static char *README[];
 
34
static void dump_registers(void);
34
35
 
35
36
#define GPLv2 2
36
37
#define GPLv3 3
37
38
 
38
 
#if defined(GDB_7_0)
 
39
#if defined(GDB_5_3) || defined(GDB_6_0) || defined(GDB_6_1)
 
40
static int GPL_version = GPLv2;
 
41
#else
39
42
static int GPL_version = GPLv3;
40
 
#else
41
 
static int GPL_version = GPLv2;
42
43
#endif
43
44
 
44
45
static 
82
83
    "    for that command is displayed.  If it is the string \"input\", a",
83
84
    "    page describing the various crash command line input options is",
84
85
    "    displayed.  If it is the string \"output\", a page describing command",
85
 
    "    line output options is displayed.  After the help message is ",
86
 
    "    displayed, crash exits.",
 
86
    "    line output options is displayed.  If it is the string \"all\", then",
 
87
    "    all of the possible help messages are displayed.  After the help",
 
88
    "    message is displayed, crash exits.",
87
89
    "",
88
90
    "  -s     ",
89
91
    "    Proceed directly to the \"crash>\" prompt without displaying any",
198
200
    "",
199
201
    "  --readnow",
200
202
    "    Pass this flag to the embedded gdb module, which will override",
201
 
    "    its two-stage  strategy that it uses for reading symbol tables",
202
 
    "    from the NAMELIST.",
 
203
    "    the two-stage strategy that it uses for reading symbol tables",
 
204
    "    from the NAMELIST.  If module symbol tables are loaded during",
 
205
    "    runtime with the \"mod\" command, the same override will occur.",
203
206
    "",
204
207
    "  --smp  ",
205
208
    "    Specify that the system being analyzed is an SMP kernel.",
464
467
        oflag = 0;
465
468
 
466
469
        while ((c = getopt(argcnt, args, 
467
 
                "efNDdmM:ngcaBbHhkKsvVoptTzLxO")) != EOF) {
 
470
                "efNDdmM:ngcaBbHhkKsvVoptTzLxOr")) != EOF) {
468
471
                switch(c)
469
472
                {
470
473
                case 'e':
569
572
 
570
573
                case 'z':
571
574
                        fprintf(fp, "help options:\n");
572
 
                        fprintf(fp, " -e - extension table data\n");
573
575
                        fprintf(fp, " -a - alias data\n");
574
576
                        fprintf(fp, " -b - shared buffer data\n");
575
577
                        fprintf(fp, " -B - build data\n");
576
578
                        fprintf(fp, " -c - numargs cache\n");
577
579
                        fprintf(fp, " -d - device table\n");
578
580
                        fprintf(fp, " -D - dumpfile contents/statistics\n");
 
581
                        fprintf(fp, " -e - extension table data\n");
579
582
                        fprintf(fp, " -f - filesys table\n");
 
583
                        fprintf(fp, " -h - hash_table data\n");
 
584
                        fprintf(fp, " -H - hash_table data (verbose)\n");
580
585
                        fprintf(fp, " -k - kernel_table\n");
581
586
                        fprintf(fp, " -K - kernel_table (verbose)\n");
 
587
                        fprintf(fp, " -L - LKCD page cache environment\n");
582
588
                        fprintf(fp, " -M <num> machine specific\n");
583
589
                        fprintf(fp, " -m - machdep_table\n");
584
590
                        fprintf(fp, " -n - dumpfile contents/statistics\n");
 
591
                        fprintf(fp, " -o - offset_table and size_table\n");
 
592
                        fprintf(fp, " -p - program_context\n");
 
593
                        fprintf(fp, " -r - dump registers from dumpfile header\n");
585
594
                        fprintf(fp, " -s - symbol table data\n");
 
595
                        fprintf(fp, " -t - task_table\n");
 
596
                        fprintf(fp, " -T - task_table plus context_array\n");
586
597
                        fprintf(fp, " -v - vm_table\n");
587
598
                        fprintf(fp, " -V - vm_table (verbose)\n");
588
 
                        fprintf(fp, " -o - offset_table and size_table\n");
589
 
                        fprintf(fp, " -t - task_table\n");
590
599
                        fprintf(fp, " -x - text cache\n");
591
 
                        fprintf(fp, " -T - task_table plus context_array\n");
592
 
                        fprintf(fp, " -p - program_context\n");
593
 
                        fprintf(fp, " -h - hash_table data\n");
594
 
                        fprintf(fp, " -H - hash_table data (verbose)\n");
595
 
                        fprintf(fp, " -L - LKCD page cache environment\n");
596
600
                        return;
597
601
 
598
602
                case 'L':
599
603
                        dumpfile_memory(DUMPFILE_ENVIRONMENT);
600
604
                        return;
601
605
 
 
606
                case 'r':
 
607
                        dump_registers();
 
608
                        return;
 
609
 
602
610
                default:  
603
611
                        argerrs++;
604
612
                        break;
625
633
        } while (args[optind]);
626
634
}
627
635
 
 
636
static void
 
637
dump_registers(void)
 
638
{
 
639
        if (pc->flags2 & QEMU_MEM_DUMP)
 
640
                dump_registers_for_qemu_mem_dump();
 
641
        else
 
642
                error(FATAL,
 
643
                    "-r option not supported on %s\n",
 
644
                        ACTIVE() ? "a live system" : "this dumpfile type");
 
645
}
 
646
 
628
647
/*
629
648
 *  Format and display the help menu.
630
649
 */
724
743
char *help_foreach[] = {
725
744
"foreach",
726
745
"display command data for multiple tasks in the system",
727
 
"[[pid | taskp | name | [kernel | user]] ...] command [flag] [argument]",
 
746
"[[pid | taskp | name | state | [kernel | user]] ...]\n"
 
747
"          command [flag] [argument]",
728
748
"  This command allows for a an examination of various kernel data associated",
729
749
"  with any, or all, tasks in the system, without having to set the context",
730
750
"  to each targeted task.\n",
731
751
"      pid  perform the command(s) on this PID.",
732
752
"    taskp  perform the command(s) on task referenced by this hexadecimal", 
733
753
"           task_struct pointer.",
734
 
"     name  perform the command(s) on all commands with this name.  If the",
735
 
"           command name can be confused with a foreach command name, then",
736
 
"           precede the name string with a \"\\\".",
 
754
"     name  perform the command(s) on all tasks with this name.  If the",
 
755
"           task name can be confused with a foreach command name, then",
 
756
"           precede the name string with a \"\\\".  If the name string is",
 
757
"           enclosed within \"'\" characters, then the encompassed string",
 
758
"           must be a POSIX extended regular expression that will be used",
 
759
"           to match task names.",
737
760
"     user  perform the command(s) on all user (non-kernel) threads.",
738
761
"   kernel  perform the command(s) on all kernel threads.",
739
 
"   active  perform the command(s) on the active thread on each CPU.\n",
 
762
"   active  perform the command(s) on the active thread on each CPU.",
 
763
"    state  perform the command(s) on all tasks in the specified state, which",
 
764
"           may be one of: RU, IN, UN, ST, ZO, TR, SW or DE.\n",
740
765
"  If none of the task-identifying arguments above are entered, the command",
741
766
"  will be performed on all tasks.\n",
742
767
"  command  select one or more of the following commands to be run on the tasks",
743
768
"           selected, or on all tasks:\n",
744
 
"             bt  run the \"bt\" command  (optional flags: -r -t -l -e -R -f -F -o)",
745
 
"             vm  run the \"vm\" command  (optional flags: -p -v -m -R)",
746
 
"           task  run the \"task\" command  (optional flag: -R)",
747
 
"          files  run the \"files\" command  (optional flag: -R)",
748
 
"            net  run the \"net\" command  (optional flags: -s -S -R)",
749
 
"            set  run the \"set\" command",
750
 
"            sig  run the \"sig\" command (optional flag: -g)",
751
 
"           vtop  run the \"vtop\" command  (optional flags: -c -u -k)\n",
 
769
"              bt  run the \"bt\" command  (optional flags: -r -t -l -e -R -f -F",
 
770
"                  -o -s -x -d)",
 
771
"              vm  run the \"vm\" command  (optional flags: -p -v -m -R -d -x)",
 
772
"            task  run the \"task\" command  (optional flags: -R -d -x)",
 
773
"           files  run the \"files\" command  (optional flag: -R)",
 
774
"             net  run the \"net\" command  (optional flags: -s -S -R -d -x)",
 
775
"             set  run the \"set\" command",
 
776
"             sig  run the \"sig\" command (optional flag: -g)",
 
777
"            vtop  run the \"vtop\" command  (optional flags: -c -u -k)\n",
752
778
"     flag  Pass this optional flag to the command selected.",
753
779
" argument  Pass this argument to the command selected.",
754
780
" ",
793
819
"  Display the open files for all tasks:\n",
794
820
"    %s> foreach files",
795
821
"    ...\n",
 
822
"  Display the state of tasks whose name contains a match to \"event.*\":\n",
 
823
"    %s> foreach 'event.*' task -R state",
 
824
"    PID: 99     TASK: ffff8804750d5500  CPU: 0   COMMAND: \"events/0\"",
 
825
"      state = 1,",
 
826
"    ",
 
827
"    PID: 100    TASK: ffff8804750d4ac0  CPU: 1   COMMAND: \"events/1\"",
 
828
"      state = 1,",
 
829
"    ",
 
830
"    PID: 101    TASK: ffff8804750d4080  CPU: 2   COMMAND: \"events/2\"",
 
831
"      state = 1,",
 
832
"    ...\n",
 
833
"  Display the stack traces for all blocked (TASK_UNINTERRUPTIBLE) tasks:\n",
 
834
"    %s> foreach UN bt",
 
835
"    PID: 428    TASK: ffff880036b6c560  CPU: 1   COMMAND: \"jbd2/dm-1-8\"",
 
836
"     #0 [ffff880035779a70] __schedule at ffffffff815df272",
 
837
"     #1 [ffff880035779b08] schedule at ffffffff815dfacf",
 
838
"     #2 [ffff880035779b18] io_schedule at ffffffff815dfb7f",
 
839
"     #3 [ffff880035779b38] sleep_on_page at ffffffff81119a4e",
 
840
"     #4 [ffff880035779b48] __wait_on_bit at ffffffff815e039f",
 
841
"     #5 [ffff880035779b98] wait_on_page_bit at ffffffff81119bb8",
 
842
"     #6 [ffff880035779be8] filemap_fdatawait_range at ffffffff81119ccc",
 
843
"     #7 [ffff880035779cd8] filemap_fdatawait at ffffffff81119d8b",
 
844
"     #8 [ffff880035779ce8] jbd2_journal_commit_transaction at ffffffff8123a99c",
 
845
"     #9 [ffff880035779e58] kjournald2 at ffffffff8123ee7b",
 
846
"    #10 [ffff880035779ee8] kthread at ffffffff8108fb9c",
 
847
"    #11 [ffff880035779f48] kernel_thread_helper at ffffffff815ebaf4",
 
848
"    ...\n",
796
849
NULL
797
850
};
798
851
 
863
916
"  A number of internal debug, statistical, and other dumpfile related",
864
917
"  data is available with the following options:",
865
918
" ",
866
 
"    -e - extension table data",
867
919
"    -a - alias data",
868
920
"    -b - shared buffer data",
869
921
"    -B - build data",
870
922
"    -c - numargs cache",
871
923
"    -d - device table",
872
924
"    -D - dumpfile contents/statistics",
 
925
"    -e - extension table data",
873
926
"    -f - filesys table",
 
927
"    -h - hash_table data",
 
928
"    -H - hash_table data (verbose)",
874
929
"    -k - kernel_table",
875
930
"    -K - kernel_table (verbose)",
 
931
"    -L - LKCD page cache environment",
876
932
"    -M <num> machine specific",
877
933
"    -m - machdep_table",
878
934
"    -n - dumpfile contents/statistics",
 
935
"    -o - offset_table and size_table",
 
936
"    -p - program_context",
 
937
"    -r - dump registers from dumpfile header",
879
938
"    -s - symbol table data",
 
939
"    -t - task_table",
 
940
"    -T - task_table plus context_array",
880
941
"    -v - vm_table",
881
942
"    -V - vm_table (verbose)",
882
 
"    -o - offset_table and size_table",
883
 
"    -t - task_table",
884
943
"    -x - text cache",
885
 
"    -T - task_table plus context_array",
886
 
"    -p - program_context",
887
 
"    -h - hash_table data",
888
 
"    -H - hash_table data (verbose)",
889
 
"    -L - LKCD page cache environment",
890
944
NULL               
891
945
};
892
946
 
905
959
"       -v  display the current state of internal %s variables.",
906
960
"",
907
961
"  If no argument is entered, the current context is displayed.  The context",
908
 
"  consists of the PID, the task pointer, the CPU, and task state.",
 
962
"  consists of the PID, the task pointer, the CPU, and task state.  The task",
 
963
"  state shows the bits found in both the task_struct state and exit_state",
 
964
"  fields.",
909
965
"  ",
910
966
"  This command may also be used to set internal %s variables.  If no value",
911
967
"  argument is entered, the current value of the %s variable is shown.  These",
932
988
"                               should return zero-filled memory.",
933
989
"       null-stop  on | off     if on, gdb's printing of character arrays will",
934
990
"                               stop at the first NULL encountered.", 
 
991
"             gdb  on | off     if on, the %s session will be run in a mode",
 
992
"                               where all commands will be passed directly to",
 
993
"                               gdb, and the command prompt will change to ",
 
994
"                               \"gdb>\"; when running in this mode, native %s",
 
995
"                               commands may be executed by preceding them with",
 
996
"                               the \"crash\" directive.",
 
997
"           scope  text-addr    sets the text scope for viewing the definition",
 
998
"                               of data structures; the \"text-addr\" argument",
 
999
"                               must be a kernel or module text address, which", 
 
1000
"                               may be expressed symbolically or as a hexadecimal",
 
1001
"                               value.",
935
1002
" ",
936
1003
"  Internal variables may be set in four manners:\n",
937
1004
"    1. entering the set command in $HOME/.%src.",
978
1045
"          namelist: vmlinux",
979
1046
"     zero_excluded: off",
980
1047
"         null-stop: on",
 
1048
"               gdb: off",
 
1049
"             scope: (not set)",
981
1050
" ",
982
1051
"  Show the current context:\n",
983
1052
"    %s> set",
1062
1131
"[-k|-u|-G][-s][-p|-c|-t|-l|-a|-g|-r] [pid | taskp | command] ...",
1063
1132
"  This command displays process status for selected, or all, processes" ,
1064
1133
"  in the system.  If no arguments are entered, the process data is",
1065
 
"  is displayed for all processes.  Selected process identifiers can be",
1066
 
"  entered in the following forms:\n",
 
1134
"  is displayed for all processes.  Specific processes may be selected",
 
1135
"  by using the following identifier formats:\n",
1067
1136
"       pid  a process PID.",
1068
1137
"     taskp  a hexadecimal task_struct pointer.",
1069
1138
"   command  a command name.  If a command name is made up of letters that",
1070
1139
"            are all numerical values, precede the name string with a \"\\\".",
1071
 
"        -k  select all kernel threads.",
1072
 
"        -u  select all user tasks.",
 
1140
" ",
 
1141
"  The process list may be further restricted by the following options:\n",
 
1142
"        -k  restrict the output to only kernel threads.",
 
1143
"        -u  restrict the output to only user tasks.",
1073
1144
"        -G  display only the thread group leader in a thread group.",
1074
1145
" ",
1075
1146
"  The process identifier types may be mixed.  For each task, the following",
1080
1151
"    3. the CPU number that the task ran on last.",
1081
1152
"    4. the task_struct address or the kernel stack pointer of the process.",
1082
1153
"       (see -s option below)",
1083
 
"    5. the task state (RU, IN, UN, ZO, ST, DE, SW).",
 
1154
"    5. the task state (RU, IN, UN, ZO, ST, TR, DE, SW).",
1084
1155
"    6. the percentage of physical memory being used by this task.",
1085
1156
"    7. the virtual address size of this task in kilobytes.",
1086
1157
"    8. the resident set size of this task in kilobytes.",
1105
1176
"           and system times.",
1106
1177
"       -l  display the task last_run or timestamp value, whichever applies,",
1107
1178
"           of selected, or all, tasks; the list is sorted with the most",
1108
 
"           recently-run task (largest last_run/timestamp) shown first.",
 
1179
"           recently-run task (largest last_run/timestamp) shown first,",
 
1180
"           followed by the task's current state.",
1109
1181
"       -a  display the command line arguments and environment strings of",
1110
1182
"           selected, or all, user-mode tasks.",
1111
1183
"       -g  display tasks by thread group, of selected, or all, tasks.",
1260
1332
"  Show all tasks sorted by their task_struct's last_run or timestamp value,",
1261
1333
"  whichever applies:\n",
1262
1334
"    %s> ps -l",
1263
 
"    [280195]  PID: 2      TASK: c1468000  CPU: 0   COMMAND: \"keventd\"",
1264
 
"    [280195]  PID: 1986   TASK: c5af4000  CPU: 0   COMMAND: \"sshd\"",
1265
 
"    [280195]  PID: 2039   TASK: c58e6000  CPU: 0   COMMAND: \"sshd\"",
1266
 
"    [280195]  PID: 2044   TASK: c5554000  CPU: 0   COMMAND: \"bash\"",
1267
 
"    [280195]  PID: 2289   TASK: c70c0000  CPU: 0   COMMAND: \"s\"",
1268
 
"    [280190]  PID: 1621   TASK: c54f8000  CPU: 0   COMMAND: \"cupsd\"",
1269
 
"    [280184]  PID: 5      TASK: c154c000  CPU: 0   COMMAND: \"kswapd\"",
1270
 
"    [280184]  PID: 6      TASK: c7ff6000  CPU: 0   COMMAND: \"kscand\"",
1271
 
"    [280170]  PID: 0      TASK: c038e000  CPU: 0   COMMAND: \"swapper\"",
1272
 
"    [280166]  PID: 2106   TASK: c0c0c000  CPU: 0   COMMAND: \"sshd\"",
1273
 
"    [280166]  PID: 2162   TASK: c03a4000  CPU: 0   COMMAND: \"vmstat\"",
1274
 
"    [280160]  PID: 1      TASK: c154a000  CPU: 0   COMMAND: \"init\"",
1275
 
"    [280131]  PID: 3      TASK: c11ce000  CPU: 0   COMMAND: \"kapmd\"",
1276
 
"    [280117]  PID: 1568   TASK: c5a8c000  CPU: 0   COMMAND: \"smartd\"",
1277
 
"    [280103]  PID: 1694   TASK: c4c66000  CPU: 0   COMMAND: \"ntpd\"",
1278
 
"    [280060]  PID: 8      TASK: c7ff2000  CPU: 0   COMMAND: \"kupdated\"",
1279
 
"    [279767]  PID: 1720   TASK: c4608000  CPU: 0   COMMAND: \"sendmail\"",
1280
 
"    [279060]  PID: 13     TASK: c69f4000  CPU: 0   COMMAND: \"kjournald\"",
1281
 
"    [278657]  PID: 1523   TASK: c5ad4000  CPU: 0   COMMAND: \"ypbind\"",
1282
 
"    [277712]  PID: 2163   TASK: c06e0000  CPU: 0   COMMAND: \"sshd\"",
1283
 
"    [277711]  PID: 2244   TASK: c4cdc000  CPU: 0   COMMAND: \"ssh\"",
1284
 
"    [277261]  PID: 1391   TASK: c5d8e000  CPU: 0   COMMAND: \"syslogd\"",
1285
 
"    [276837]  PID: 1990   TASK: c58d8000  CPU: 0   COMMAND: \"bash\"",
1286
 
"    [276802]  PID: 1853   TASK: c3828000  CPU: 0   COMMAND: \"atd\"",
1287
 
"    [276496]  PID: 1749   TASK: c4480000  CPU: 0   COMMAND: \"cannaserver\"",
1288
 
"    [274931]  PID: 1760   TASK: c43ac000  CPU: 0   COMMAND: \"crond\"",
1289
 
"    [246773]  PID: 1844   TASK: c38d8000  CPU: 0   COMMAND: \"xfs\"",
1290
 
"    [125620]  PID: 2170   TASK: c48dc000  CPU: 0   COMMAND: \"bash\"",
1291
 
"    [119059]  PID: 1033   TASK: c64be000  CPU: 0   COMMAND: \"kjournald\"",
1292
 
"    [110916]  PID: 1663   TASK: c528a000  CPU: 0   COMMAND: \"sshd\"",
1293
 
"    [ 86122]  PID: 2112   TASK: c0da6000  CPU: 0   COMMAND: \"bash\"",
1294
 
"    [ 13637]  PID: 1891   TASK: c67ae000  CPU: 0   COMMAND: \"sshd\"",
1295
 
"    [ 13636]  PID: 1894   TASK: c38ec000  CPU: 0   COMMAND: \"bash\"",
1296
 
"    [  7662]  PID: 1885   TASK: c6478000  CPU: 0   COMMAND: \"mingetty\"",
1297
 
"    [  7662]  PID: 1886   TASK: c62da000  CPU: 0   COMMAND: \"mingetty\"",
1298
 
"    [  7662]  PID: 1887   TASK: c5f8c000  CPU: 0   COMMAND: \"mingetty\"",
1299
 
"    [  7662]  PID: 1888   TASK: c5f88000  CPU: 0   COMMAND: \"mingetty\"",
1300
 
"    [  7662]  PID: 1889   TASK: c5f86000  CPU: 0   COMMAND: \"mingetty\"",
1301
 
"    [  7662]  PID: 1890   TASK: c6424000  CPU: 0   COMMAND: \"mingetty\"",
1302
 
"    [  7661]  PID: 4      TASK: c154e000  CPU: 0   COMMAND: \"ksoftirqd/0\"",
1303
 
"    [  7595]  PID: 1872   TASK: c2e7e000  CPU: 0   COMMAND: \"inventory.pl\"",
1304
 
"    [  6617]  PID: 1771   TASK: c435a000  CPU: 0   COMMAND: \"jserver\"",
1305
 
"    [  6307]  PID: 1739   TASK: c48f8000  CPU: 0   COMMAND: \"gpm\"",
1306
 
"    [  6285]  PID: 1729   TASK: c4552000  CPU: 0   COMMAND: \"sendmail\"",
1307
 
"    [  6009]  PID: 1395   TASK: c6344000  CPU: 0   COMMAND: \"klogd\"",
1308
 
"    [  5820]  PID: 1677   TASK: c4d74000  CPU: 0   COMMAND: \"xinetd\"",
1309
 
"    [  5719]  PID: 1422   TASK: c5d04000  CPU: 0   COMMAND: \"portmap\"",
1310
 
"    [  4633]  PID: 1509   TASK: c5ed4000  CPU: 0   COMMAND: \"apmd\"",
1311
 
"    [  4529]  PID: 1520   TASK: c5d98000  CPU: 0   COMMAND: \"ypbind\"",
1312
 
"    [  4515]  PID: 1522   TASK: c5d32000  CPU: 0   COMMAND: \"ypbind\"",
1313
 
"    [  4373]  PID: 1441   TASK: c5d48000  CPU: 0   COMMAND: \"rpc.statd\"",
1314
 
"    [  4210]  PID: 1352   TASK: c5b30000  CPU: 0   COMMAND: \"dhclient\"",
1315
 
"    [  1184]  PID: 71     TASK: c65b6000  CPU: 0   COMMAND: \"khubd\"",
1316
 
"    [   434]  PID: 9      TASK: c11de000  CPU: 0   COMMAND: \"mdrecoveryd\"",
1317
 
"    [    48]  PID: 7      TASK: c7ff4000  CPU: 0   COMMAND: \"bdflush\"",
 
1335
"    [280195] [RU]  PID: 2      TASK: c1468000  CPU: 0   COMMAND: \"keventd\"",
 
1336
"    [280195] [IN]  PID: 1986   TASK: c5af4000  CPU: 0   COMMAND: \"sshd\"",
 
1337
"    [280195] [IN]  PID: 2039   TASK: c58e6000  CPU: 0   COMMAND: \"sshd\"",
 
1338
"    [280195] [RU]  PID: 2044   TASK: c5554000  CPU: 0   COMMAND: \"bash\"",
 
1339
"    [280195] [RU]  PID: 2289   TASK: c70c0000  CPU: 0   COMMAND: \"s\"",
 
1340
"    [280190] [IN]  PID: 1621   TASK: c54f8000  CPU: 0   COMMAND: \"cupsd\"",
 
1341
"    [280184] [IN]  PID: 5      TASK: c154c000  CPU: 0   COMMAND: \"kswapd\"",
 
1342
"    [280184] [IN]  PID: 6      TASK: c7ff6000  CPU: 0   COMMAND: \"kscand\"",
 
1343
"    [280170] [IN]  PID: 0      TASK: c038e000  CPU: 0   COMMAND: \"swapper\"",
 
1344
"    [280166] [IN]  PID: 2106   TASK: c0c0c000  CPU: 0   COMMAND: \"sshd\"",
 
1345
"    [280166] [IN]  PID: 2162   TASK: c03a4000  CPU: 0   COMMAND: \"vmstat\"",
 
1346
"    [280160] [IN]  PID: 1      TASK: c154a000  CPU: 0   COMMAND: \"init\"",
 
1347
"    [280131] [IN]  PID: 3      TASK: c11ce000  CPU: 0   COMMAND: \"kapmd\"",
 
1348
"    [280117] [IN]  PID: 1568   TASK: c5a8c000  CPU: 0   COMMAND: \"smartd\"",
 
1349
"    [280103] [IN]  PID: 1694   TASK: c4c66000  CPU: 0   COMMAND: \"ntpd\"",
 
1350
"    [280060] [IN]  PID: 8      TASK: c7ff2000  CPU: 0   COMMAND: \"kupdated\"",
 
1351
"    [279767] [IN]  PID: 1720   TASK: c4608000  CPU: 0   COMMAND: \"sendmail\"",
 
1352
"    [279060] [IN]  PID: 13     TASK: c69f4000  CPU: 0   COMMAND: \"kjournald\"",
 
1353
"    [278657] [IN]  PID: 1523   TASK: c5ad4000  CPU: 0   COMMAND: \"ypbind\"",
 
1354
"    [277712] [IN]  PID: 2163   TASK: c06e0000  CPU: 0   COMMAND: \"sshd\"",
 
1355
"    [277711] [IN]  PID: 2244   TASK: c4cdc000  CPU: 0   COMMAND: \"ssh\"",
 
1356
"    [277261] [IN]  PID: 1391   TASK: c5d8e000  CPU: 0   COMMAND: \"syslogd\"",
 
1357
"    [276837] [IN]  PID: 1990   TASK: c58d8000  CPU: 0   COMMAND: \"bash\"",
 
1358
"    [276802] [IN]  PID: 1853   TASK: c3828000  CPU: 0   COMMAND: \"atd\"",
 
1359
"    [276496] [IN]  PID: 1749   TASK: c4480000  CPU: 0   COMMAND: \"cannaserver\"",
 
1360
"    [274931] [IN]  PID: 1760   TASK: c43ac000  CPU: 0   COMMAND: \"crond\"",
 
1361
"    [246773] [IN]  PID: 1844   TASK: c38d8000  CPU: 0   COMMAND: \"xfs\"",
 
1362
"    [125620] [IN]  PID: 2170   TASK: c48dc000  CPU: 0   COMMAND: \"bash\"",
 
1363
"    [119059] [IN]  PID: 1033   TASK: c64be000  CPU: 0   COMMAND: \"kjournald\"",
 
1364
"    [110916] [IN]  PID: 1663   TASK: c528a000  CPU: 0   COMMAND: \"sshd\"",
 
1365
"    [ 86122] [IN]  PID: 2112   TASK: c0da6000  CPU: 0   COMMAND: \"bash\"",
 
1366
"    [ 13637] [IN]  PID: 1891   TASK: c67ae000  CPU: 0   COMMAND: \"sshd\"",
 
1367
"    [ 13636] [IN]  PID: 1894   TASK: c38ec000  CPU: 0   COMMAND: \"bash\"",
 
1368
"    [  7662] [IN]  PID: 1885   TASK: c6478000  CPU: 0   COMMAND: \"mingetty\"",
 
1369
"    [  7662] [IN]  PID: 1886   TASK: c62da000  CPU: 0   COMMAND: \"mingetty\"",
 
1370
"    [  7662] [IN]  PID: 1887   TASK: c5f8c000  CPU: 0   COMMAND: \"mingetty\"",
 
1371
"    [  7662] [IN]  PID: 1888   TASK: c5f88000  CPU: 0   COMMAND: \"mingetty\"",
 
1372
"    [  7662] [IN]  PID: 1889   TASK: c5f86000  CPU: 0   COMMAND: \"mingetty\"",
 
1373
"    [  7662] [IN]  PID: 1890   TASK: c6424000  CPU: 0   COMMAND: \"mingetty\"",
 
1374
"    [  7661] [IN]  PID: 4      TASK: c154e000  CPU: 0   COMMAND: \"ksoftirqd/0\"",
 
1375
"    [  7595] [IN]  PID: 1872   TASK: c2e7e000  CPU: 0   COMMAND: \"inventory.pl\"",
 
1376
"    [  6617] [IN]  PID: 1771   TASK: c435a000  CPU: 0   COMMAND: \"jserver\"",
 
1377
"    [  6307] [IN]  PID: 1739   TASK: c48f8000  CPU: 0   COMMAND: \"gpm\"",
 
1378
"    [  6285] [IN]  PID: 1729   TASK: c4552000  CPU: 0   COMMAND: \"sendmail\"",
 
1379
"    [  6009] [IN]  PID: 1395   TASK: c6344000  CPU: 0   COMMAND: \"klogd\"",
 
1380
"    [  5820] [IN]  PID: 1677   TASK: c4d74000  CPU: 0   COMMAND: \"xinetd\"",
 
1381
"    [  5719] [IN]  PID: 1422   TASK: c5d04000  CPU: 0   COMMAND: \"portmap\"",
 
1382
"    [  4633] [IN]  PID: 1509   TASK: c5ed4000  CPU: 0   COMMAND: \"apmd\"",
 
1383
"    [  4529] [IN]  PID: 1520   TASK: c5d98000  CPU: 0   COMMAND: \"ypbind\"",
 
1384
"    [  4515] [IN]  PID: 1522   TASK: c5d32000  CPU: 0   COMMAND: \"ypbind\"",
 
1385
"    [  4373] [IN]  PID: 1441   TASK: c5d48000  CPU: 0   COMMAND: \"rpc.statd\"",
 
1386
"    [  4210] [IN]  PID: 1352   TASK: c5b30000  CPU: 0   COMMAND: \"dhclient\"",
 
1387
"    [  1184] [IN]  PID: 71     TASK: c65b6000  CPU: 0   COMMAND: \"khubd\"",
 
1388
"    [   434] [IN]  PID: 9      TASK: c11de000  CPU: 0   COMMAND: \"mdrecoveryd\"",
 
1389
"    [    48] [IN]  PID: 7      TASK: c7ff4000  CPU: 0   COMMAND: \"bdflush\"",
1318
1390
" ",
1319
1391
"  Show the kernel stack pointer of each user task:\n",
1320
1392
"    %s> ps -us",
1394
1466
char *help_rd[] = {
1395
1467
"rd",
1396
1468
"read memory",
1397
 
"[-adDsSupxmfN][-8|-16|-32|-64][-o offs][-e addr] [address|symbol] [count]",
 
1469
"[-adDsSupxmfN][-8|-16|-32|-64][-o offs][-e addr][-r file][address|symbol]\n"
 
1470
"     [count]",
1398
1471
"  This command displays the contents of memory, with the output formatted",
1399
1472
"  in several different manners.  The starting address may be entered either",
1400
1473
"  symbolically or by address.  The default output size is the size of a long",
1426
1499
"           values)",
1427
1500
"  -o offs  offset the starting address by offs.",
1428
1501
"  -e addr  display memory until reaching specified ending hexadecimal address.",
 
1502
"  -r file  dumps raw data to the specified output file; the number of bytes that",
 
1503
"           are copied to the file must be specified either by a count argument",
 
1504
"           or by the -e option.",
1429
1505
"  address  starting hexadecimal address:",
1430
1506
"             1  the default presumes a kernel virtual address.",
1431
1507
"             2. -p specifies a physical address.",
1432
1508
"             3. -u specifies a user virtual address, but is only necessary on",
1433
1509
"                processors with common user and kernel virtual address spaces.",
1434
1510
"   symbol  symbol of starting address to read.",
1435
 
"    count  number of memory locations to display; if entered, must be the last",
1436
 
"           argument on the command line (default is 1; unlimited for -a).",
 
1511
"    count  number of memory locations to display; if entered, it must be the",
 
1512
"           last argument on the command line; if not entered, the count defaults",
 
1513
"           to 1, or unlimited for -a; when used with the -r option, it is the",
 
1514
"           number of bytes to be written to the file.",
1437
1515
"\nEXAMPLES",
1438
1516
"  Display the kernel's version string:\n",
1439
1517
"    %s> rd -a linux_banner",
1529
1607
char *help_bt[] = {
1530
1608
"bt",
1531
1609
"backtrace",
1532
 
#if defined(GDB_6_0) || defined(GDB_6_1) || defined(GDB_7_0)
1533
 
"[-a|-g|-r|-t|-T|-l|-e|-E|-f|-F|-o|-O] [-R ref] [-I ip] [-S sp] [pid | task]",
1534
 
#else
1535
 
"[-a|-r|-t|-l|-e|-f|-g] [-R ref] [ -I ip ] [-S sp] [pid | taskp]",
1536
 
#endif
 
1610
"[-a|-g|-r|-t|-T|-l|-e|-E|-f|-F|-o|-O] [-R ref] [-s [-x|d]] [-I ip] [-S sp]"
 
1611
"\n     [pid | task]",
1537
1612
"  Display a kernel stack backtrace.  If no arguments are given, the stack",
1538
1613
"  trace of the current context will be displayed.\n",
1539
1614
"       -a  displays the stack traces of the active task on each CPU.",
1540
1615
"           (only applicable to crash dumps)",
 
1616
#ifdef GDB_5_3
 
1617
"       -g  use gdb stack trace code. (alpha only)",
 
1618
#else
1541
1619
"       -g  displays the stack traces of all threads in the thread group of",
 
1620
#endif
1542
1621
"           the target task; the thread group leader will be displayed first.",
1543
1622
"       -r  display raw stack data, consisting of a memory dump of the two",
1544
1623
"           pages of memory containing the task_union structure.",
1568
1647
"           of this option toggles the backtrace method.",
1569
1648
"           x86_64: use old backtrace method by default; subsequent usage of this",
1570
1649
"           option toggles the backtrace method.",  
1571
 
#if !defined(GDB_6_0) && !defined(GDB_6_1) && !defined(GDB_7_0)
1572
 
"       -g  use gdb stack trace code. (alpha only)",
1573
 
#endif
1574
1650
"   -R ref  display stack trace only if there is a reference to this symbol",
1575
1651
"           or text address.",
 
1652
"       -s  display the symbol name plus its offset.", 
 
1653
"       -x  when displaying a symbol offset with the -s option, override the",
 
1654
"           default output format with hexadecimal format.",
 
1655
"       -d  when displaying a symbol offset with the -s option, override the",
 
1656
"           default output format with decimal format.",
1576
1657
"    -I ip  use ip as the starting text location.",
1577
1658
"    -S sp  use sp as the starting stack frame address.",
1578
1659
"      pid  displays the stack trace(s) of this pid.",
1755
1836
"       DS:  002b      ESI: 0804b305  ES:  002b      EDI: 08074ed0",
1756
1837
"       SS:  002b      ESP: bffe9a90  EBP: bffe9ac8",
1757
1838
"       CS:  0023      EIP: 4012066e  ERR: 00000080  EFLAGS: 00000246",
 
1839
" ",
 
1840
"  Display the symbol name plus its offset in each frame, overriding",
 
1841
"  the current output format with hexadecimal:\n",
 
1842
"    %s> bt -sx",
 
1843
"    PID: 1499   TASK: ffff88006af43cc0  CPU: 2   COMMAND: \"su\"",
 
1844
"     #0 [ffff8800664a1c90] machine_kexec+0x167 at ffffffff810327b7",
 
1845
"     #1 [ffff8800664a1ce0] crash_kexec+0x60 at ffffffff810a9ec0",
 
1846
"     #2 [ffff8800664a1db0] oops_end+0xb0 at ffffffff81504160",
 
1847
"     #3 [ffff8800664a1dd0] general_protection+0x25 at ffffffff81503435",
 
1848
"        [exception RIP: kmem_cache_alloc+120]",
 
1849
"        RIP: ffffffff8113cf88  RSP: ffff8800664a1e88  RFLAGS: 00010086",
 
1850
"        RAX: 0000000000000000  RBX: ff88006ef56840ff  RCX: ffffffff8114e9e4",
 
1851
"        RDX: 0000000000000000  RSI: 00000000000080d0  RDI: ffffffff81796020",
 
1852
"        RBP: ffffffff81796020   R8: ffff88000a3137a0   R9: 0000000000000000",
 
1853
"        R10: ffff88007ac97300  R11: 0000000000000400  R12: 00000000000080d0",
 
1854
"        R13: 0000000000000292  R14: 00000000000080d0  R15: 00000000000000c0",
 
1855
"        ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018",
 
1856
"     #4 [ffff8800664a1ed0] get_empty_filp+0x74 at ffffffff8114e9e4",
 
1857
"     #5 [ffff8800664a1ef0] sock_alloc_fd+0x23 at ffffffff8142f553",
 
1858
"     #6 [ffff8800664a1f10] sock_map_fd+0x23 at ffffffff8142f693",
 
1859
"     #7 [ffff8800664a1f50] sys_socket+0x43 at ffffffff814302a3",
 
1860
"     #8 [ffff8800664a1f80] system_call_fastpath+0x16 at ffffffff81013042",
 
1861
"        RIP: 00007f5720b368e7  RSP: 00007fff52b629a8  RFLAGS: 00010206",
 
1862
"        RAX: 0000000000000029  RBX: ffffffff81013042  RCX: 0000000000000000",
 
1863
"        RDX: 0000000000000009  RSI: 0000000000000003  RDI: 0000000000000010",
 
1864
"        RBP: 000000000066f320   R8: 0000000000000001   R9: 0000000000000000",
 
1865
"        R10: 0000000000000000  R11: 0000000000000202  R12: ffff88007ac97300",
 
1866
"        R13: 0000000000000000  R14: 00007f571e104a80  R15: 00007f571e305048",
 
1867
"        ORIG_RAX: 0000000000000029  CS: 0033  SS: 002b",
1758
1868
NULL               
1759
1869
};
1760
1870
 
1947
2057
char *help_mach[] = {
1948
2058
"mach",
1949
2059
"machine specific data",    
1950
 
"[-cm]",
 
2060
"[-m | -c -[xd]]",
1951
2061
"  This command displays data specific to a machine type.\n",
 
2062
"    -m  Display the physical memory map (x86, x86_64 and ia64 only).",
1952
2063
"    -c  Display each cpu's cpuinfo structure (x86, x86_64 and ia64 only).",
1953
2064
"        Display each cpu's x8664_pda structure (x86_64 only),", 
1954
2065
"        Display the hwrpb_struct, and each cpu's percpu_struct (alpha only).",
1955
 
"    -m  Display the physical memory map (x86, x86_64 and ia64 only).",
 
2066
"    -x  override default output format with hexadecimal format.",
 
2067
"    -d  override default output format with decimal format.",
1956
2068
"\nEXAMPLES", 
1957
2069
"    %s> mach",
1958
2070
"           MACHINE TYPE: i686",
2089
2201
char *help_runq[] = {
2090
2202
"runq",
2091
2203
"run queue",
 
2204
"[-t]",
 
2205
"  With no argument, this command displays the tasks on the run queues",
 
2206
"  of each cpu.",
2092
2207
" ",
2093
 
"  This command displays the tasks on the run queues of each cpu.",
 
2208
"   -t  Display the timestamp information of each cpu's runqueue, which is the",
 
2209
"       rq.clock, rq.most_recent_timestamp or rq.timestamp_last_tick value,",
 
2210
"       whichever applies; following each cpu timestamp is the last_run or ",
 
2211
"       timestamp value of the active task on that cpu, whichever applies, ",
 
2212
"       along with the task identification.", 
2094
2213
"\nEXAMPLES",
 
2214
" Display the tasks on an O(1) scheduler run queue:\n",
2095
2215
"    %s> runq",
2096
2216
"    CPU 0 RUNQUEUE: ffff880001cdb460",
2097
2217
"      CURRENT: PID: 2739   TASK: ffff8800320fa7e0  COMMAND: \"bash\"",
2107
2227
"         [115] PID: 1779   TASK: ffff88003207a860  COMMAND: \"klogd\"",
2108
2228
"      EXPIRED PRIO_ARRAY: ffff880001ce3db8",
2109
2229
"         [no tasks queued]",
 
2230
" ",
 
2231
" Display the tasks on a CFS run queue:\n",
 
2232
"    %s> runq",
 
2233
"    CPU 0 RUNQUEUE: ffff8800090436c0",
 
2234
"      CURRENT: PID: 588    TASK: ffff88007e4877a0  COMMAND: \"udevd\"",
 
2235
"      RT PRIO_ARRAY: ffff8800090437c8",
 
2236
"         [no tasks queued]",
 
2237
"      CFS RB_ROOT: ffff880009043740",
 
2238
"         [118] PID: 2110   TASK: ffff88007d470860  COMMAND: \"check-cdrom.sh\"",
 
2239
"         [118] PID: 2109   TASK: ffff88007f1247a0  COMMAND: \"check-cdrom.sh\"",
 
2240
"         [118] PID: 2114   TASK: ffff88007f20e080  COMMAND: \"udevd\"",
 
2241
"    ",
 
2242
"    CPU 1 RUNQUEUE: ffff88000905b6c0",
 
2243
"      CURRENT: PID: 2113   TASK: ffff88007e8ac140  COMMAND: \"udevd\"",
 
2244
"      RT PRIO_ARRAY: ffff88000905b7c8",
 
2245
"         [no tasks queued]",
 
2246
"      CFS RB_ROOT: ffff88000905b740",
 
2247
"         [118] PID: 2092   TASK: ffff88007d7a4760  COMMAND: \"MAKEDEV\"",
 
2248
"         [118] PID: 1983   TASK: ffff88007e59f140  COMMAND: \"udevd\"",
 
2249
"         [118] PID: 2064   TASK: ffff88007e40f7a0  COMMAND: \"udevd\"",
 
2250
"         [115] PID: 2111   TASK: ffff88007e4278a0  COMMAND: \"kthreadd\"",
 
2251
" ",
 
2252
" Display run queue timestamp data:\n",
 
2253
"    %s> runq -t ",
 
2254
"    CPU 0: 2680990637359",
 
2255
"           2680986653330  PID: 28228  TASK: ffff880037ca2ac0  COMMAND: \"loop\"",
 
2256
"    CPU 1: 2680940618478",
 
2257
"           2680940618478  PID: 28167  TASK: ffff880078130040  COMMAND: \"bash\"",
 
2258
"    CPU 2: 2680990763425",
 
2259
"           2680986785772  PID: 28227  TASK: ffff8800787780c0  COMMAND: \"loop\"",
 
2260
"    CPU 3: 2680990954469",
 
2261
"           2680986059540  PID: 28226  TASK: ffff880078778b00  COMMAND: \"loop\"",
2110
2262
NULL               
2111
2263
};
2112
2264
 
2185
2337
char *help_dev[] = {
2186
2338
"dev",
2187
2339
"device data",
2188
 
"[-i | -p]",
 
2340
"[-i | -p | -d]",
2189
2341
"  If no argument is entered, this command dumps character and block",
2190
2342
"  device data.\n",
2191
2343
"    -i  display I/O port usage; on 2.4 kernels, also display I/O memory usage.",
2192
2344
"    -p  display PCI device data.",
 
2345
"    -d  display disk I/O statistics:",
 
2346
"         TOTAL: total number of allocated in-progress I/O requests",
 
2347
"          SYNC: I/O requests that are synchronous",
 
2348
"         ASYNC: I/O requests that are asynchronous",
 
2349
"          READ: I/O requests that are reads (older kernels)",
 
2350
"         WRITE: I/O requests that are writes (older kernels)",
 
2351
"           DRV: I/O requests that are in-flight in the device driver",
2193
2352
"\nEXAMPLES",
2194
2353
"  Display character and block device data:\n",
2195
2354
"    %s> dev",
2312
2471
"    c0004080  fec00000-fec0ffff  reserved",
2313
2472
"    c00040a0  fee00000-fee0ffff  reserved",
2314
2473
"    c00040c0  ffe00000-ffffffff  reserved",
 
2474
"\n  Display disk I/O statistics:\n",
 
2475
"    %s> dev -d",
 
2476
"    MAJOR GENDISK            NAME     REQUEST QUEUE      TOTAL  READ WRITE   DRV",
 
2477
"        2 0xffff81012d8a5000 fd0      0xffff81012dc053c0    12     0    12     0",
 
2478
"       22 0xffff81012dc6b000 hdc      0xffff81012d8ae340     2     2     0     0",
 
2479
"        8 0xffff81012dd71000 sda      0xffff81012d8af040     6     0     6     6",
 
2480
"        8 0xffff81012dc77000 sdb      0xffff81012d8b5740     0     0     0     0",
 
2481
"        8 0xffff81012d8d0c00 sdc      0xffff81012d8ae9c0     0     0     0     0",
2315
2482
 
2316
2483
NULL               
2317
2484
};
2321
2488
char *help_search[] = {
2322
2489
"seach",
2323
2490
"search memory",
2324
 
"[-s start] [ -[kKV] | -u | -p ] [-e end | -l length] [-m mask]\n"
2325
 
"         -[cwh] value ...",
 
2491
"[-s start] [ -[kKV] | -u | -p | -t ] [-e end | -l length] [-m mask]\n"
 
2492
"         [-x count] -[cwh] [value | (expression) | symbol | string] ...",
2326
2493
"  This command searches for a given value within a range of user virtual, kernel",
2327
2494
"  virtual, or physical memory space.  If no end nor length value is entered, ",
2328
2495
"  then the search stops at the end of user virtual, kernel virtual, or physical",
2329
2496
"  address space, whichever is appropriate.",
2330
2497
" ",
2331
2498
"  An optional mask value may be entered to mask off \"don't care\" bits.\n",
2332
 
"   -s start  Start the search at this hexadecimal user or kernel virtual ",
2333
 
"             address, physical address, or kernel symbol.  The start address",
2334
 
"             must be appropriate for the memory type specified; if no memory",
2335
 
"             type is specified, the default is kernel virtual address space.",
2336
 
"         -k  If no start address is specified, start the search at the base",
2337
 
"             of kernel virtual address space.  This option is the default.",
2338
 
"         -K  Same as -k, except that mapped kernel virtual memory that was",
2339
 
"             allocated by vmalloc(), module memory, or virtual mem_map regions",
2340
 
"             will not be searched.", 
2341
 
"         -V  Same as -k, except that unity-mapped kernel virtual memory and",
2342
 
"             mapped kernel-text/static-data (x86_64 and ia64) will not be",
2343
 
"             searched.",
2344
 
"         -u  If no start address is specified, start the search at the base",
2345
 
"             of the current context's user virtual address space.  If a start",
2346
 
"             address is specified, then this option specifies that the start",
2347
 
"             address is a user virtual address.",
2348
 
"         -p  If no start address is specified, start the search at the base",
2349
 
"             of physical address space.  If a start address is specified, then",
2350
 
"             this option specifies that the start address is a physical address.",
2351
 
"     -e end  Stop the search at this hexadecimal user or kernel virtual address,",
2352
 
"             kernel symbol, or physical address.  The end address must be",
2353
 
"             appropriate for the memory type specified.",
2354
 
"  -l length  Length in bytes of address range to search.",
2355
 
"    -m mask  Ignore the bits that are set in the hexadecimal mask value.",
2356
 
"         -c  Search for character string values instead of unsigned longs.  If",
2357
 
"             the string contains any space(s), it must be encompassed by double",
2358
 
"             quotes.",
2359
 
"         -w  Search for unsigned hexadecimal ints instead of unsigned longs.",
2360
 
"             This is only meaningful on 64-bit systems in order to search both",
2361
 
"             the upper and lower 32-bits of each 64-bit long for the value.",
2362
 
"         -h  Search for unsigned hexadecimal shorts instead of unsigned longs.",
2363
 
"      value  Search for this hexadecimal long, unless modified by -c, -w, or -h.",
 
2499
"    -s start  Start the search at this hexadecimal user or kernel virtual ",
 
2500
"              address, physical address, or kernel symbol.  The start address",
 
2501
"              must be appropriate for the memory type specified; if no memory",
 
2502
"              type is specified, the default is kernel virtual address space.",
 
2503
"          -k  If no start address is specified, start the search at the base",
 
2504
"              of kernel virtual address space.  This option is the default.",
 
2505
"          -K  Same as -k, except that mapped kernel virtual memory that was",
 
2506
"              allocated by vmalloc(), module memory, or virtual mem_map regions",
 
2507
"              will not be searched.", 
 
2508
"          -V  Same as -k, except that unity-mapped kernel virtual memory and",
 
2509
"              mapped kernel-text/static-data (x86_64 and ia64) will not be",
 
2510
"              searched.",
 
2511
"          -u  If no start address is specified, start the search at the base",
 
2512
"              of the current context's user virtual address space.  If a start",
 
2513
"              address is specified, then this option specifies that the start",
 
2514
"              address is a user virtual address.",
 
2515
"          -p  If no start address is specified, start the search at the base",
 
2516
"              of physical address space.  If a start address is specified,",
 
2517
"              then this option specifies that the start address is a physical ",
 
2518
"              address.",
 
2519
"          -t  Search only the kernel stack pages of every task.  If one or more",
 
2520
"              matches are found in a task's kernel stack, precede the output",
 
2521
"              with a task-identifying header.",
 
2522
"      -e end  Stop the search at this hexadecimal user or kernel virtual",
 
2523
"              address, kernel symbol, or physical address.  The end address",
 
2524
"              must be appropriate for the memory type specified.",
 
2525
"   -l length  Length in bytes of address range to search.",
 
2526
"     -m mask  Ignore the bits that are set in the hexadecimal mask value.",
 
2527
"          -c  Search for character string values instead of unsigned longs.  If",
 
2528
"              the string contains any space(s), it must be encompassed by double",
 
2529
"              quotes.",
 
2530
"          -w  Search for unsigned hexadecimal ints instead of unsigned longs.",
 
2531
"              This is only meaningful on 64-bit systems in order to search both",
 
2532
"              the upper and lower 32-bits of each 64-bit long for the value.",
 
2533
"          -h  Search for unsigned hexadecimal shorts instead of unsigned longs.",
 
2534
"    -x count  Display the memory contents before and after any found value.  The",
 
2535
"              before and after memory context will consist of \"count\" memory",
 
2536
"              items of the same size as the \"value\" argument.  This option is",
 
2537
"              not applicable with the -c option.",
 
2538
"       value  Search for this hexadecimal long, unless modified by the -c, -w, ",
 
2539
"              or -h options.",
 
2540
"(expression)  Search for the value of this expression; the expression value must",
 
2541
"              not overflow the designated size when -h or -w are used; not",
 
2542
"              applicable when used with the -c option.",
 
2543
"      symbol  Search for this symbol value; the symbol value must not overflow",
 
2544
"              the designated size when -h or -w are used; not applicable when ",
 
2545
"              used with the -c option.",
 
2546
"      string  Search for character string values; if the string contains any ",
 
2547
"              space(s), it must be encompassed by double quotes; only applicable",
 
2548
"              with the -c option.",
2364
2549
" ",
2365
 
"  If -k, -K, -V, -u or -p are not used, then the search defaults to kernel",
 
2550
"  If -k, -K, -V, -u, -p or -t are not used, then the search defaults to kernel",
2366
2551
"  virtual address space.  The starting address must be long-word aligned. ",
2367
2552
"  Address ranges that start in user space and end in kernel space are not",
2368
2553
"  accepted.",
2448
2633
"    ffff8801258be748: Failure to install fence: %%d..<3>[drm:%%s] *ERROR* Failed",
2449
2634
"    ffff880125f07ec9: can\'t allocate memory..<3>ACPI: Invalid data..Too many d",
2450
2635
"    ffffffff813ddec1: can\'t allocate memory for key lists..<3>%%s %%s: error con",
 
2636
"\n  Search the kernel stacks of all tasks for those that contain the inode",
 
2637
"  address ffff81002c0a3050:\n",
 
2638
"    %s> search -t ffff81002c0a3050",
 
2639
"    PID: 4876   TASK: ffff81003e9f5860  CPU: 7   COMMAND: \"automount\"",
 
2640
"    ffff8100288fbe98: ffff81002c0a3050",
 
2641
"    ",
 
2642
"    PID: 4880   TASK: ffff81003ce967a0  CPU: 0   COMMAND: \"automount\"",
 
2643
"    ffff81002c0fbdd8: ffff81002c0a3050",
 
2644
"    ffff81002c0fbe78: ffff81002c0a3050",
 
2645
"\n  When a kernel symbol or an (expression) is used an argument, both the",
 
2646
"  resultant value and the input string are displayed:\n",
 
2647
"    %s> search anon_inode_inode (__down_interruptible+191)",
 
2648
"    ffff81000222a728: ffffffff80493d60 (anon_inode_inode)",
 
2649
"    ffff810005a1e918: ffffffff800649d6 (__down_interruptible+191)",
 
2650
"    ffff810005a1e9d0: ffffffff800649d6 (__down_interruptible+191)",
 
2651
"    ffff810005a1eb48: ffffffff800649d6 (__down_interruptible+191)",
 
2652
"    ffff81000b409c60: ffffffff80493d60 (anon_inode_inode)",
 
2653
"    ffff81000c155b98: ffffffff80493d60 (anon_inode_inode)",
 
2654
"    ffff8100194fac70: ffffffff80493d60 (anon_inode_inode)",
 
2655
"    ffff81001daa1008: ffffffff80493d60 (anon_inode_inode)",
 
2656
"    ffff810028b95830: ffffffff800649d6 (__down_interruptible+191)",
 
2657
"    ffff81002cea0c70: ffffffff80493d60 (anon_inode_inode)",
 
2658
"    ffff810031327268: ffffffff80493d60 (anon_inode_inode)",
 
2659
"    ffff810031327270: ffffffff800649d6 (__down_interruptible+191)",
 
2660
"    ffff810034b1ccd0: ffffffff800649d6 (__down_interruptible+191)",
 
2661
"    ffff8100399565a8: ffffffff80493d60 (anon_inode_inode)",
 
2662
"    ffff81003a278cd0: ffffffff800649d6 (__down_interruptible+191)",
 
2663
"    ffff81003cc23e08: ffffffff800649d6 (__down_interruptible+191)",
2451
2664
NULL               
2452
2665
};
2453
2666
 
2455
2668
char *help_irq[] = {
2456
2669
"irq",
2457
2670
"IRQ data",
2458
 
"[[[index ...] | -u] | -d | -b]",
 
2671
"[[[index ...] | -u ] | -d | -b | -a | -s [-c cpu]]",
2459
2672
"  This command collaborates the data in an irq_desc_t, along with its",
2460
2673
"  associated hw_interrupt_type and irqaction structure data, into a",
2461
2674
"  consolidated per-IRQ display.  For kernel versions 2.6.37 and later",
2462
2675
"  the display consists of the irq_desc/irq_data address, its irqaction",
2463
2676
"  address(es), and the irqaction name strings.  Alternatively, the", 
2464
 
"  intel interrupt descriptor table may be dumped, or bottom half data", 
2465
 
"  may be displayed.  If no index value argument(s) nor any options are", 
2466
 
"  entered, the IRQ data for all IRQs will be displayed.\n",
 
2677
"  intel interrupt descriptor table, bottom half data, cpu affinity for",
 
2678
"  in-use irqs, or kernel irq stats may be displayed.  If no index value",
 
2679
"  argument(s) nor any options are entered, the IRQ data for all IRQs will",
 
2680
"  be displayed.\n",
2467
2681
"    index   a valid IRQ index.",
2468
 
"       -u   dump data for in-use IRQs only.",  
 
2682
"       -u   dump data for in-use IRQs only.",
2469
2683
"       -d   dump the intel interrupt descriptor table.",
2470
2684
"       -b   dump bottom half data.",
 
2685
"       -a   dump cpu affinity for in-use IRQs.",
 
2686
"       -s   dump the kernel irq stats; if no cpu specified with -c, the",
 
2687
"            irq stats of all cpus will be displayed.",
 
2688
"   -c cpu   only usable with the -s option, dump the irq stats of the ",
 
2689
"            specified cpu[s]; cpu can be specified as \"1,3,5\", \"1-3\",",
 
2690
"            or \"1,3,5-7,10\".",
2471
2691
"\nEXAMPLES",
2472
2692
"  Display the relevant data for IRQ 18 from a pre-2.6.37 kernel:\n", 
2473
2693
"    %s> irq 18",
2545
2765
"        [6]     ffffffff81069090  <tasklet_action> ",
2546
2766
"        [7]     ffffffff81058830  <run_rebalance_domains> ",
2547
2767
"        [8]     ffffffff81087f00  <run_hrtimer_softirq> ",
2548
 
"        [9]     ffffffff810ca7a0  <rcu_process_callbacks> ",
 
2768
"        [9]     ffffffff810ca7a0  <rcu_process_callbacks> \n",
 
2769
"  Display the cpu affinity for in-use IRQs:\n",
 
2770
"    %s> irq -a",
 
2771
"    IRQ NAME                 AFFINITY",
 
2772
"      0 timer                0-23",
 
2773
"      1 i8042                0-23",
 
2774
"      8 rtc0                 0-23",
 
2775
"      9 acpi                 0-23",
 
2776
"     16 ehci_hcd:usb2,uhci_hcd:usb3,uhci_hcd:usb6 0,6,18",
 
2777
"     17 uhci_hcd:usb4,uhci_hcd:usb7 0-23",
 
2778
"     18 ehci_hcd:usb1,uhci_hcd:usb5,uhci_hcd:usb8,ioc0 0,11,23",
 
2779
"     24 dmar0                0",
 
2780
"     35 pciehp               0-23",
 
2781
"     36 pciehp               0-23",
 
2782
"     37 pciehp               0-23",
 
2783
"     38 pciehp               0-23",
 
2784
"     39 megasas              0-5,12-17",
 
2785
"     40 lpfc:sp              0-5,12-17",
 
2786
"     41 lpfc:fp              0,6-11,18-23",
 
2787
"     42 lpfc:sp              0,6-11,18-23",
 
2788
"     43 lpfc:fp              0,6-11,18-23",
 
2789
"    ...\n",
 
2790
"     80 ioat-msix            0-23",
 
2791
"     81 ioat-msix            0-23",
 
2792
"     82 ioat-msix            0-23",
 
2793
"     83 ioat-msix            0-23",
 
2794
"     84 ioat-msix            0-23",
 
2795
"     85 ioat-msix            0-23",
 
2796
"     86 ioat-msix            0-23",
 
2797
"     87 ioat-msix            0-23",
 
2798
"     88 eth4                 0,17\n",
 
2799
"  Display the kernel irq stats:\n",
 
2800
"    %s>irq -c 0,2 -s",
 
2801
"               CPU0       CPU2 ",
 
2802
"      0: 2068161471          0 IR-IO-APIC-edge     timer",
 
2803
"      1:          9          0 IR-IO-APIC-edge     i8042",
 
2804
"      8:          1          0 IR-IO-APIC-edge     rtc0",
 
2805
"      9:          0          0 IR-IO-APIC-fasteoi  acpi",
 
2806
"     16:         36          0 IR-IO-APIC-fasteoi  ehci_hcd:usb2",
 
2807
"    ...\n",
 
2808
"     85:          3          0 IR-PCI-MSI-edge     ioat-msix",
 
2809
"     86:          3          0 IR-PCI-MSI-edge     ioat-msix",
 
2810
"     87:          3          0 IR-PCI-MSI-edge     ioat-msix",
 
2811
"     88:         24        295 IR-PCI-MSI-edge     eth4",
2549
2812
NULL               
2550
2813
};
2551
2814
 
2552
2815
 
 
2816
char *help_ipcs[] = {
 
2817
"ipcs",                            
 
2818
"System V IPC facilities",  
 
2819
"[-smMq] [-n pid|task] [id | addr]",
 
2820
 
 
2821
"  This command provides information on the System V IPC facilities.  With no",
 
2822
"  arguments, the command will display kernel usage of all three factilities.",
 
2823
"  ",
 
2824
"       -s  show semaphore arrays.",
 
2825
"       -m  show shared memory segments.",
 
2826
"       -M  show shared memory segments with additional details.",
 
2827
"       -q  show message queues.",
 
2828
"       id  show the data associated with this resource ID.",
 
2829
"     addr  show the data associated with this virtual address of a",
 
2830
"           shmid_kernel, sem_array or msq_queue.",
 
2831
"",
 
2832
"  For kernels supporting namespaces, the -n option may be used to",
 
2833
"  display the IPC facilities with respect to the namespace of a",
 
2834
"  specified task:\n",
 
2835
"  -n pid   a process PID.",
 
2836
"  -n task  a hexadecimal task_struct pointer.",
 
2837
"\nEXAMPLES",
 
2838
"  Display all IPC facilities:\n",
 
2839
"    %s> ipcs",
 
2840
"    SHMID_KERNEL     KEY      SHMID      UID   PERMS BYTES      NATTCH STATUS",
 
2841
"    ffff880473a28310 00000000 0          0     666   90000      1       ",
 
2842
"    ffff880473a28490 00000001 32769      0     666   90000      1       ",
 
2843
"    ffff880473a28250 00000002 65538      0     666   90000      1       ",
 
2844
"    ",
 
2845
"    SEM_ARRAY        KEY      SEMID      UID   PERMS NSEMS     ",
 
2846
"    ffff88047200f9d0 00000000 0          0     600   1         ",
 
2847
"    ffff88046f826910 00000000 32769      0     600   1         ",
 
2848
"    ",
 
2849
"    MSG_QUEUE        KEY      MSQID      UID   PERMS USED-BYTES   MESSAGES",
 
2850
"    ffff8100036bb8d0 000079d7 0          3369  666   16640        104",         
 
2851
"    ffff8100036bb3d0 000079d8 32769      3369  666   12960        81",          
 
2852
"    ffff810026d751d0 000079d9 65538      3369  666   10880        68",
 
2853
"    ",
 
2854
"  Display shared memory usage with detailed information:\n",
 
2855
"    %s> ipcs -M",
 
2856
"    SHMID_KERNEL     KEY      SHMID      UID   PERMS BYTES      NATTCH STATUS",
 
2857
"    ffff880473a28310 00000000 0          0     666   90000      1       ",
 
2858
"    PAGES ALLOCATED/RESIDENT/SWAPPED: 22/1/0",
 
2859
"    INODE: ffff88047239cd98",
 
2860
"    ",
 
2861
"    SHMID_KERNEL     KEY      SHMID      UID   PERMS BYTES      NATTCH STATUS",
 
2862
"    ffff880473a28490 00000001 32769      0     666   90000      1       ",
 
2863
"    PAGES ALLOCATED/RESIDENT/SWAPPED: 22/1/0",
 
2864
"    INODE: ffff88047239c118",
 
2865
"    ",
 
2866
"    SHMID_KERNEL     KEY      SHMID      UID   PERMS BYTES      NATTCH STATUS",
 
2867
"    ffff880473a28250 00000002 65538      0     666   90000      1       ",
 
2868
"    PAGES ALLOCATED/RESIDENT/SWAPPED: 22/1/0",
 
2869
"    INODE: ffff880470503758",
 
2870
"    ",
 
2871
"  Display the shared memory data associated with shmid_kernel ffff880473a28250:\n",
 
2872
"    %s> ipcs -M ffff880473a28250",
 
2873
"    SHMID_KERNEL     KEY      SHMID      UID   PERMS BYTES      NATTCH STATUS",
 
2874
"    ffff880473a28250 00000002 65538      0     666   90000      1       ",
 
2875
"    PAGES ALLOCATED/RESIDENT/SWAPPED: 22/1/0",
 
2876
"    INODE: ffff880470503758",
 
2877
NULL
 
2878
};
 
2879
 
2553
2880
char *help_cpu[] = {
2554
2881
"cpu",
2555
2882
"set context to the active task on a cpu",
2654
2981
char *help_log[] = {
2655
2982
"log",
2656
2983
"dump system message buffer",
2657
 
"[-m]",
2658
 
"  This command dumps the kernel log_buf contents in chronological order.",
 
2984
"[-tdm]",
 
2985
"  This command dumps the kernel log_buf contents in chronological order.  The",
 
2986
"  command supports the older log_buf formats, which may or may not contain a",
 
2987
"  timestamp inserted prior to each message, as well as the newer variable-length", 
 
2988
"  record format, where the timestamp is contained in each log entry's header.",
2659
2989
"  ",
2660
 
"    -m  Display the message log level preceding each message.",
 
2990
"    -t  Display the message text without the timestamp; only applicable to the",
 
2991
"        variable-length record format.",
 
2992
"    -d  Display the dictionary of key/value pair properties that are optionally",
 
2993
"        appended to a message by the kernel's dev_printk() function; only",
 
2994
"        applicable to the variable-length record format.",
 
2995
"    -m  Display the message log level in brackets preceding each message.  For",
 
2996
"        the variable-length record format, the level will be displayed in ",
 
2997
"        hexadecimal, and depending upon the kernel version, also contains the",
 
2998
"        facility or flags bits.",
 
2999
" ",        
2661
3000
"\nEXAMPLES",
2662
3001
"  Dump the kernel message buffer:\n",
2663
3002
"    %s> log",
2706
3045
"    <6>Installing knfsd (copyright (C) 1996 okir@monad.swb.de).",
2707
3046
"    <7>nfsd_init: initialized fhcache, entries=256",
2708
3047
"    ... ",
 
3048
" ",
 
3049
"  On a system with the variable-length record format, and whose log_buf has been",
 
3050
"  filled and wrapped around, display the log with timestamp data:\n",
 
3051
"    %s> log",
 
3052
"    [    0.467730] pci 0000:ff:02.0: [8086:2c10] type 00 class 0x060000",
 
3053
"    [    0.467749] pci 0000:ff:02.1: [8086:2c11] type 00 class 0x060000",
 
3054
"    [    0.467769] pci 0000:ff:02.4: [8086:2c14] type 00 class 0x060000",
 
3055
"    [    0.467788] pci 0000:ff:02.5: [8086:2c15] type 00 class 0x060000",
 
3056
"    [    0.467809] pci 0000:ff:03.0: [8086:2c18] type 00 class 0x060000",
 
3057
"    [    0.467828] pci 0000:ff:03.1: [8086:2c19] type 00 class 0x060000",
 
3058
"    ...",
 
3059
" ",
 
3060
"  Display the same message text as above, without the timestamp data:\n",
 
3061
"    %s> log -t",
 
3062
"    pci 0000:ff:02.0: [8086:2c10] type 00 class 0x060000",
 
3063
"    pci 0000:ff:02.1: [8086:2c11] type 00 class 0x060000",
 
3064
"    pci 0000:ff:02.4: [8086:2c14] type 00 class 0x060000",
 
3065
"    pci 0000:ff:02.5: [8086:2c15] type 00 class 0x060000",
 
3066
"    pci 0000:ff:03.0: [8086:2c18] type 00 class 0x060000",
 
3067
"    pci 0000:ff:03.1: [8086:2c19] type 00 class 0x060000",
 
3068
"    ...",
 
3069
" ",
 
3070
"  Display the same message text as above, with appended dictionary data:\n",
 
3071
"    %s> log -td",
 
3072
"    pci 0000:ff:02.0: [8086:2c10] type 00 class 0x060000",
 
3073
"    SUBSYSTEM=pci",
 
3074
"    DEVICE=+pci:0000:ff:02.0",
 
3075
"    pci 0000:ff:02.1: [8086:2c11] type 00 class 0x060000",
 
3076
"    SUBSYSTEM=pci",
 
3077
"    DEVICE=+pci:0000:ff:02.1",
 
3078
"    pci 0000:ff:02.4: [8086:2c14] type 00 class 0x060000",
 
3079
"    SUBSYSTEM=pci",
 
3080
"    DEVICE=+pci:0000:ff:02.4",
 
3081
"    pci 0000:ff:02.5: [8086:2c15] type 00 class 0x060000",
 
3082
"    SUBSYSTEM=pci",
 
3083
"    DEVICE=+pci:0000:ff:02.5",
 
3084
"    pci 0000:ff:03.0: [8086:2c18] type 00 class 0x060000",
 
3085
"    SUBSYSTEM=pci",
 
3086
"    DEVICE=+pci:0000:ff:03.0",
 
3087
"    pci 0000:ff:03.1: [8086:2c19] type 00 class 0x060000",
 
3088
"    SUBSYSTEM=pci",
 
3089
"    DEVICE=+pci:0000:ff:03.1",
 
3090
"    ...",
2709
3091
NULL               
2710
3092
};
2711
3093
 
3037
3419
char *help_vm[] = { 
3038
3420
"vm",
3039
3421
"virtual memory",
3040
 
"[-p | -v | -m | [-R reference] | [-f vm_flags]] [pid | taskp] ... ",
 
3422
"[-p | -P vmaddr | -v | -m | -x | -d | [-R reference] | [-f vm_flags]]"
 
3423
"\n     [pid | taskp] ... ",
3041
3424
"  This command displays basic virtual memory information of a context,",
3042
3425
"  consisting of a pointer to its mm_struct and page dirctory, its RSS and ",
3043
3426
"  total virtual memory size; and a list of pointers to each vm_area_struct,",
3053
3436
"            -p  translate each virtual page to its physical address, or if", 
3054
3437
"                the page is not mapped, its swap device and offset, or",
3055
3438
"                filename and offset.",
 
3439
"     -P vmaddr  similar to -p, but only translate the pages belonging to the",
 
3440
"                specified VM area of a context.",
3056
3441
"  -R reference  search for references to this number or filename.",
3057
3442
"            -m  dump the mm_struct assocated with the task.",
3058
3443
"            -v  dump all of the vm_area_structs associated with the task.",
 
3444
"            -x  override the default output format for the -m or -v options",
 
3445
"                with hexadecimal format.",
 
3446
"            -d  override the default output format for the -m or -v options", 
 
3447
"                with decimal format.",
3059
3448
"   -f vm_flags  translate the bits of a FLAGS (vm_flags) value.", 
3060
3449
"           pid  a process PID.",
3061
3450
"         taskp  a hexadecimal task_struct pointer.",
3231
3620
"  Translate a FLAGS value:\n",
3232
3621
"    %s> vm -f 3875",
3233
3622
"    3875: (READ|EXEC|MAYREAD|MAYWRITE|MAYEXEC|DENYWRITE|EXECUTABLE|LOCKED)",
 
3623
" ",
 
3624
"  Display the page translations of the VM area at address f5604f2c:\n",
 
3625
"    %s> vm -P f5604f2c",
 
3626
"    PID: 5508   TASK: f56a9570  CPU: 0   COMMAND: \"crond\"",
 
3627
"      VMA       START      END    FLAGS  FILE",
 
3628
"    f5604f2c    f5b000    f67000 8000075  /lib/libnss_files-2.12.so",
 
3629
"    VIRTUAL   PHYSICAL",
 
3630
"    f5b000    3fec1000",
 
3631
"    f5c000    3d3a4000",
 
3632
"    f5d000    FILE: /lib/libnss_files-2.12.so  OFFSET: 2000",
 
3633
"    f5e000    FILE: /lib/libnss_files-2.12.so  OFFSET: 3000",
 
3634
"    f5f000    FILE: /lib/libnss_files-2.12.so  OFFSET: 4000",
 
3635
"    f60000    3fd31000",
 
3636
"    f61000    3fd32000",
 
3637
"    f62000    FILE: /lib/libnss_files-2.12.so  OFFSET: 7000",
 
3638
"    f63000    FILE: /lib/libnss_files-2.12.so  OFFSET: 8000",
 
3639
"    f64000    3ff35000",
 
3640
"    f65000    FILE: /lib/libnss_files-2.12.so  OFFSET: a000",
 
3641
"    f66000    FILE: /lib/libnss_files-2.12.so  OFFSET: b000",
3234
3642
NULL               
3235
3643
};
3236
3644
 
3237
3645
char *help_task[] = {
3238
3646
"task",
3239
3647
"task_struct contents",
3240
 
"[-R member[,member]] [pid | taskp] ...",
 
3648
"[-R member[,member]] [-dx] [pid | taskp] ...",
3241
3649
"  This command dumps a formatted display of the contents of a task_struct.",
3242
3650
"  Multiple task or PID numbers may be entered; if no arguments are entered,",
3243
3651
"  the task_struct of the current context is displayed.  The -R option,",
3247
3655
"        pid  a process PID.",
3248
3656
"      taskp  a hexadecimal task_struct pointer.",
3249
3657
"  -R member  a comma-separated list of one or more task_struct members.",  
 
3658
"         -x  override default output format with hexadecimal format.",
 
3659
"         -d  override default output format with decimal format.",
3250
3660
"\nEXAMPLES",
3251
3661
"  Dump the task_struct structure of the current context:\n",
3252
3662
"    %s> task",
3509
3919
char *help_struct[] = {
3510
3920
"struct",
3511
3921
"structure contents",
3512
 
"struct_name[.member[,member]][-o][-l offset][-rfu] [address | symbol]\n"
3513
 
"                                       [count | -c count]",
 
3922
"struct_name[.member[,member]][-o][-l offset][-rfuxdp][address | symbol]\n"
 
3923
"         [count | -c count]",
3514
3924
"  This command displays either a structure definition, or a formatted display",
3515
3925
"  of the contents of a structure at a specified address.  When no address is",
3516
3926
"  specified, the structure definition is shown along with the structure size.",
3520
3930
"    struct_name  name of a C-code structure used by the kernel.",
3521
3931
"        .member  name of a structure member; to display multiple members of a",
3522
3932
"                 structure, use a comma-separated list of members.",
3523
 
"             -o  show member offsets when displaying structure definitions.",
 
3933
"             -o  show member offsets when displaying structure definitions; ",
 
3934
"                 if used with an address or symbol argument, each member will",
 
3935
"                 be preceded by its virtual address.",
3524
3936
"      -l offset  if the address argument is a pointer to a structure member that",
3525
3937
"                 is contained by the target data structure, typically a pointer",
3526
3938
"                 to an embedded list_head, the offset to the embedded member may", 
3531
3943
"             -f  address argument is a dumpfile offset.",
3532
3944
"             -u  address argument is a user virtual address in the current",
3533
3945
"                 context.",
 
3946
"             -x  override default output format with hexadecimal format.",
 
3947
"             -d  override default output format with decimal format.",
 
3948
"             -p  if a structure member is a pointer value, show the member's",
 
3949
"                 data type on the output line; and on the subsequent line(s),", 
 
3950
"                 dereference the pointer, display the pointer target's symbol",
 
3951
"                 value in brackets if appropriate, and if possible, display the",
 
3952
"                 target data; requires an address argument.",
3534
3953
"        address  hexadecimal address of a structure; if the address points",  
3535
3954
"                 to an embedded list_head structure contained within the",
3536
3955
"                 target data structure, then the \"-l\" option must be used.",
3542
3961
"                 value is entered, the (positive) \"count\" structures that",
3543
3962
"                 lead up to and include the target structure will be displayed.\n",
3544
3963
"  Structure data, sizes, and member offsets are shown in the current output",
3545
 
"  radix.",
 
3964
"  radix unless the -x or -d option is specified.",
3546
3965
" ",
3547
3966
"  Please note that in the vast majority of cases, the \"struct\" command",
3548
3967
"  name may be dropped; if the structure name does not conflict with any %s",
3613
4032
"      [52] long unsigned int vm_pte;",
3614
4033
"    }",
3615
4034
"    SIZE: 56\n",
3616
 
"  Display the pgd member of the mm_struct at address c2857bd0:\n",
3617
 
"    %s> struct mm_struct.pgd c2857bd0",
3618
 
"      pgd = 0xc168c000,\n",
3619
4035
"  Display the definition and offset of the pgd member of an mm_struct:\n",
3620
4036
"    %s> struct mm_struct.pgd",
3621
4037
"    struct mm_struct {",
3622
 
"       [12] pgd_t *pgd;",
 
4038
"       [80] pgd_t *pgd;",
3623
4039
"    }\n",
 
4040
"  Display the pgd member of the mm_struct at address ffff810022e7d080:\n",
 
4041
"    %s> struct mm_struct.pgd ffff810022e7d080",
 
4042
"      pgd = 0xffff81000e3ac000\n",
 
4043
"  Display the pgd_t pointed to by the mm_struct.pgd pointer above, forcing",
 
4044
"  the output to be expressed in hexadecimal:\n",
 
4045
"    %s> mm_struct.pgd ffff810022e7d080 -px",
 
4046
"      pgd_t *pgd = 0xffff81000e3ac000",
 
4047
"      -> {",
 
4048
"           pgd = 0x2c0a6067",
 
4049
"         }\n",
 
4050
"  Display the thread_info structure pointed to by the thread_info",
 
4051
"  member of the task_struct at ffff8100181190c0:\n",
 
4052
"    %s> task_struct.thread_info ffff8100181190c0 -p",
 
4053
"      struct thread_info *thread_info = 0xffff810023c06000",
 
4054
"      -> {",
 
4055
"           task = 0xffff8100181190c0,",
 
4056
"           exec_domain = 0xffffffff802f78e0,",
 
4057
"           flags = 128,",
 
4058
"           status = 1,",
 
4059
"           cpu = 3,",
 
4060
"           preempt_count = 0,",
 
4061
"           addr_limit = {",
 
4062
"             seg = 18446604435732824064",
 
4063
"           },",
 
4064
"           restart_block = {",
 
4065
"             fn = 0xffffffff80095a52 <do_no_restart_syscall>,",
 
4066
"             arg0 = 0,",
 
4067
"             arg1 = 0,",
 
4068
"             arg2 = 0,",
 
4069
"             arg3 = 0",
 
4070
"           }",
 
4071
"         }\n",
3624
4072
"  Display the flags and virtual members of 4 contigous page structures",
3625
4073
"  in the mem_map page structure array:\n",
3626
4074
"    %s> page.flags,virtual c101196c 4",
3725
4173
"      d_extra_attributes = 0x0, ",
3726
4174
"      d_iname = \"boot.log\\000\"",
3727
4175
"    }",
 
4176
" ",
 
4177
"  Display the virtual address of each member of the task_struct at",
 
4178
"  ffff8100145d2080:\n",
 
4179
"    %s> task_struct -o ffff8100145d2080",
 
4180
"    struct task_struct {",
 
4181
"      [ffff8100145d2080] volatile long int state;",
 
4182
"      [ffff8100145d2088] struct thread_info *thread_info;",
 
4183
"      [ffff8100145d2090] atomic_t usage;",
 
4184
"      [ffff8100145d2098] long unsigned int flags;",
 
4185
"      [ffff8100145d20a0] int lock_depth;",
 
4186
"      [ffff8100145d20a4] int load_weight;",
 
4187
"      [ffff8100145d20a8] int prio;",
 
4188
"      [ffff8100145d20ac] int static_prio;",
 
4189
"      [ffff8100145d20b0] int normal_prio;",
 
4190
"      [ffff8100145d20b8] struct list_head run_list;",
 
4191
"      [ffff8100145d20c8] struct prio_array *array;",
 
4192
"    ...",
3728
4193
"\nNOTE",
3729
4194
"  If the structure name does not conflict with any %s command name, the",
3730
4195
"  \"struct\" command may be dropped.  Accordingly, the examples above could",
3732
4197
"    %s> vm_area_struct c1e44f10",
3733
4198
"    %s> vm_area_struct",
3734
4199
"    %s> vm_area_struct -o",
3735
 
"    %s> mm_struct.pgd c2857bd0",
 
4200
"    %s> mm_struct.pgd ffff810022e7d080",
3736
4201
"    %s> mm_struct.pgd",
3737
4202
"    %s> tcp_sl_timer tcp_slt_array 4\n",
3738
4203
"  Lastly, the short-cut \"*\" pointer-to command may also be used to negate",
3744
4209
char *help_union[] = {
3745
4210
"union",
3746
4211
"union contents",
3747
 
"union_name[.member[,member]] [-o][-l offset][-rfu] [address | symbol]\n"
 
4212
"union_name[.member[,member]] [-o][-l offset][-rfuxdp] [address | symbol]\n"
3748
4213
"                                     [count | -c count]",
3749
4214
"  This command displays either a union definition, or a formatted display",
3750
4215
"  of the contents of a union at a specified address.  When no address is",
3755
4220
"     union_name  name of a C-code union used by the kernel.",
3756
4221
"        .member  name of a union member; to display multiple members of a",
3757
4222
"                 union, use a comma-separated list of members.",
3758
 
"             -o  show member offsets when displaying union definitions.",
3759
 
"                 (always 0)",
 
4223
"             -o  show member offsets when displaying union definitions; the",
 
4224
"                 offset is always 0 unless used with an address or symbol",
 
4225
"                 argument, in which case each member will be preceded by its",
 
4226
"                 virtual address.",
3760
4227
"      -l offset  if the address argument is a pointer to a list_head structure",
3761
4228
"                 that is embedded in the target union structure, the offset",
3762
4229
"                 to the list_head member may be entered in either of the",
3765
4232
"                   2. a number of bytes. ",
3766
4233
"             -r  raw dump of union data.",
3767
4234
"             -f  address argument is a dumpfile offset.",
 
4235
"             -x  override default output format with hexadecimal format.",
 
4236
"             -d  override default output format with decimal format.",
 
4237
"             -p  if a union member is a pointer value, show the member's",
 
4238
"                 data type on the output line; and on the subsequent line(s),",
 
4239
"                 dereference the pointer, display the pointer target's symbol",
 
4240
"                 value in brackets if appropriate, and if possible, display the",
 
4241
"                 target data; requires an address argument.",
3768
4242
"             -u  address argument is a user virtual address in the current",
3769
4243
"                 context.",
3770
4244
"        address  hexadecimal address of a union; if the address points",
3777
4251
"                 entered or if a negative number is entered; if a negative",
3778
4252
"                 value is entered, the (positive) \"count\" structures that",
3779
4253
"                 lead up to and include the target structure will be displayed.\n",
3780
 
"  Union data, sizes, and member offsets are shown in the current output radix.",
 
4254
"  Union data, sizes, and member offsets are shown in the current output radix",
 
4255
"  unless the -x or -d option is specified.",
3781
4256
" ",
3782
4257
"  Please note that in the vast majority of cases, the \"union\" command",
3783
4258
"  name may be dropped; if the union name does not conflict with any %s",
3848
4323
char *help_mod[] = {
3849
4324
"mod",
3850
4325
"module information and loading of symbols and debugging data",
3851
 
"[ -s module [objfile] | -d module | -S [directory] | -D | -r | -o ] ",
 
4326
"-s module [objfile] | -d module | -S [directory] | -D | -r | -R | -o | -g",
3852
4327
"  With no arguments, this command displays basic information of the currently",
3853
4328
"  installed modules, consisting of the module address, name, size, the",
3854
4329
"  object file name (if known), and whether the module was compiled with",
3884
4359
"                       appended, a search will be made for an object file",
3885
4360
"                       consisting of the module name with a .o or .ko suffix,",
3886
4361
"                       starting at the /lib/modules/<release> directory on",
3887
 
"                       the host system.  If an objfile argument is appended,",
3888
 
"                       then that file will be used.",
 
4362
"                       the host system, or if not found there, starting at the",
 
4363
"                       directory containing the kernel namelist file.  If an",
 
4364
"                       objfile argument is appended, then that file will be",
 
4365
"                       used.",
3889
4366
"            -d module  Deletes the symbolic and debugging data of the module",
3890
4367
"                       specified.",
3891
4368
"       -S [directory]  Load symbolic and debugging data from the object file",
3892
4369
"                       for all loaded modules.  For each module, a search",
3893
4370
"                       will be made for an object file consisting of the",
3894
 
"                       module name with a .o or.ko suffix, starting at the",
3895
 
"                       /lib/modules/<release> directory of the host system.",
3896
 
"                       If a directory argument is appended, then the search",
3897
 
"                       will be restricted to that directory.",
 
4371
"                       module name with a .o or .ko suffix, starting at the",
 
4372
"                       /lib/modules/<release> directory of the host system,",
 
4373
"                       or if not found there, starting at the directory",
 
4374
"                       containing the kernel namelist file.  If a directory",
 
4375
"                       argument is appended, then the search will be restricted",
 
4376
"                       to that directory.",
3898
4377
"                   -D  Deletes the symbolic and debugging data of all modules.",
3899
 
"                   -r  Reinitialize module data. All currently-loaded symbolic",
 
4378
"                   -r  Passes the -readnow flag to the embedded gdb module,",
 
4379
"                       which will override the two-stage strategy that it uses",
 
4380
"                       for reading symbol tables from module object files.",
 
4381
"                   -R  Reinitialize module data. All currently-loaded symbolic",
3900
4382
"                       and debugging data will be deleted, and the installed",
3901
4383
"                       module list will be updated (live system only).",
 
4384
"                   -g  When used with -s or -S, add a module object's section",
 
4385
"                       start and end addresses to its symbol list.",
3902
4386
"                   -o  Load module symbols with old mechanism.",
3903
4387
" ",
 
4388
"  If the %s session was invoked with the \"--mod <directory>\" option, or",
 
4389
"  a CRASH_MODULE_PATH environment variable exists, then /lib/modules/<release>",
 
4390
"  will be overridden as the default directory tree that is searched for module",
 
4391
"  object files.",
 
4392
" ",
3904
4393
"  After symbolic and debugging data have been loaded, backtraces and text",
3905
4394
"  disassembly will be displayed appropriately.  Depending upon the processor",
3906
4395
"  architecture, data may also printed symbolically with the \"p\" command;",
4019
4508
char *help__list[] = {
4020
4509
"list",
4021
4510
"linked list",
4022
 
"[[-o] offset] [-e end] [-s struct[.member[,member]]] [-H] start",
 
4511
"[[-o] offset] [-e end] [-s struct[.member[,member]] -[xd]] [-h|-H] start",
4023
4512
"  This command dumps the contents of a linked list.  The entries in a linked",
4024
4513
"  list are typically data structures that are tied together in one of two",
4025
4514
"  formats:",
4026
4515
" ",
4027
4516
"  1. A starting address points to a data structure; that structure contains",
4028
 
"     a member that is a pointer to the next structure, and so on.  The list",
4029
 
"     typically ends when a \"next\" pointer value contains one of the",
4030
 
"     following:\n",
4031
 
"       a. a NULL pointer.",
4032
 
"       b. a pointer to the start address.",
4033
 
"       c. a pointer to the first item pointed to by the start address.",
4034
 
"       d. a pointer to its containing structure.",
 
4517
"     a member that is a pointer to the next structure, and so on.  This type",
 
4518
"     of a singly-linked list typically ends when a \"next\" pointer value ",
 
4519
"     contains one of the following:",
 
4520
"",
 
4521
"       (a) a NULL pointer.",
 
4522
"       (b) a pointer to the start address.",
 
4523
"       (c) a pointer to the first item pointed to by the start address.",
 
4524
"       (d) a pointer to its containing structure.",
4035
4525
"  ",
4036
 
"  2. Most Linux lists are linked via embedded list_head structures contained ",
4037
 
"     within the data structures in the list.  The linked list is headed by an",
4038
 
"     external LIST_HEAD, which is simply a list_head structure initialized to",
4039
 
"     point to itself, signifying that the list is empty:",
 
4526
"  2. Most Linux lists of data structures are doubly-linked using \"list_head\"",
 
4527
"     structures that are embedded members of the data structures in the list:",
4040
4528
" ",
4041
4529
"       struct list_head {",
4042
4530
"           struct list_head *next, *prev;",
4043
4531
"       };",
4044
4532
" ",
4045
 
"       #define LIST_HEAD_INIT(name) { &(name), &(name) }"
 
4533
"     The linked list is typically headed by an external, standalone list_head,",
 
4534
"     which is simply initialized to point to itself, signifying that the list",
 
4535
"     is empty:",
4046
4536
" ",
 
4537
"       #define LIST_HEAD_INIT(name) { &(name), &(name) } ",
4047
4538
"       #define LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name)",
4048
4539
" ",
4049
 
"     In the case of list_head-type lists, the \"next\" pointer is the address",
4050
 
"     of the embedded list_head structure in the next structure, and not the",
4051
 
"     address of the structure itself.  The list typically ends when the",
4052
 
"     list_head's next pointer points back to the LIST_HEAD address.",
 
4540
"     In the case of list_head-linked lists, the \"list_head.next\" pointer is",
 
4541
"     the address of a list_head structure that is embedded in the next data",
 
4542
"     structure in the list, and not the address of the next data structure ",
 
4543
"     itself.  The starting point of the list may be:",
 
4544
"",
 
4545
"       (a) an external, standalone, LIST_HEAD().",
 
4546
"       (b) a list_head that is embedded within a data structure of the same",
 
4547
"           type as the whole linked list.",
 
4548
"       (c) a list_head that is embedded within a data structure that is",
 
4549
"           different than the type of structures in the the linked list.",
4053
4550
" ",
 
4551
"     The list typically ends when the embedded \"list_head.next\" pointer of",
 
4552
"     a data structure in the linked list points back to the LIST_HEAD()",
 
4553
"     address.  However, some list_head-linked lists have no defined starting",
 
4554
"     point, but just link back onto themselves in a circular manner.",
 
4555
"",
4054
4556
"  This command can handle both types of linked list; in both cases the list",
4055
4557
"  of addresses that are dumped are the addresses of the data structures",
4056
4558
"  themselves.",
4057
 
" ",
4058
 
"  The arguments are as follows:\n",
 
4559
"",
 
4560
"  The arguments are as follows:",
 
4561
"",
4059
4562
"  [-o] offset  The offset within the structure to the \"next\" pointer",
4060
4563
"               (default is 0).  If non-zero, the offset may be entered",
4061
 
"               in either of two manners:\n",
4062
 
"               1. In \"structure.member\" format; the \"-o\" is not necessary.", 
 
4564
"               in either of two manners:",
 
4565
"",
 
4566
"               1. In \"structure.member\" format; the \"-o\" is not necessary.",
4063
4567
"               2. A number of bytes; the \"-o\" is only necessary on processors",
4064
4568
"                  where the offset value could be misconstrued as a kernel",
4065
 
"                  virtual address.\n",
 
4569
"                  virtual address.",
 
4570
"",
4066
4571
"       -e end  If the list ends in a manner unlike the typical manners that",
4067
4572
"               are described above, an explicit ending address value may be",
4068
4573
"               entered.",
4069
4574
"    -s struct  For each address in list, format and print as this type of",
4070
 
"               structure; use the \"struct.member\" format in order to display", 
 
4575
"               structure; use the \"struct.member\" format in order to display",
4071
4576
"               a particular member of the structure.  To display multiple",
4072
4577
"               members of a structure, use a comma-separated list of members.",
4073
 
" ",
4074
 
"  The meaning of the \"start\" argument, which can be expressed either",
4075
 
"  symbolically or in hexadecimal format, depends upon whether the -H option",
4076
 
"  is pre-pended or not:",
4077
 
" ",
4078
 
"      start  The address of the first structure in the list.",
4079
 
"   -H start  The address of the list_head structure, typically expressed",
4080
 
"             symbolically, but also can be an expression evaluating to the",
4081
 
"             address of the starting list_head structure.",
 
4578
"           -x  Override the default output format with hexadecimal format.",
 
4579
"           -d  Override the default output format with decimal format.",
 
4580
" ",
 
4581
"  The meaning of the \"start\" argument, which can be expressed symbolically,",
 
4582
"  in hexadecimal format, or an expression evaluating to an address, depends",
 
4583
"  upon whether the -h or -H option is pre-pended:",
 
4584
" ",
 
4585
"      start  The address of the first data structure in the list.",
 
4586
"   -H start  The address of a list_head structure, typically that of an",
 
4587
"             external, standalone LIST_HEAD().  The list typically ends ",
 
4588
"             when the embedded \"list_head.next\" of a data structure in ",
 
4589
"             the linked list points back to this \"start\" address.",
 
4590
"   -h start  The address of a data structure which contains an embedded",
 
4591
"             list_head.  The list typically ends when the embedded",
 
4592
"             \"list_head.next\" of a data structure in the linked list ",
 
4593
"             points back to the embedded list_head contained in the data",
 
4594
"             structure whose address is this \"start\" argument.",
 
4595
"",
 
4596
"WARNING ",
 
4597
"  When the \"-h start\" option is used, it is possible that the list_head-linked",
 
4598
"  list will:",
 
4599
" ",
 
4600
"    1. pass through an external standalone LIST_HEAD(), or",
 
4601
"    2. pass through a list_head that is the actual starting list_head, but is",
 
4602
"       contained within a data structure that is not the same type as all of",
 
4603
"       the other data structures in the list.",
 
4604
" ",
 
4605
"  When that occurs, the data structure address displayed for that list_head",
 
4606
"  will be incorrect, because the \"-h start\" option presumes that all",
 
4607
"  list_head structures in the list are contained within the same type of",
 
4608
"  data structure.  Furthermore, if the \"-s struct[.member[,member]\" option",
 
4609
"  is used, it will display bogus data for that particular list_head.",
4082
4610
"\nEXAMPLES",
4083
4611
"  Note that each task_struct is linked to its parent's task_struct via the",
4084
4612
"  p_pptr member:",
4121
4649
" ",
4122
4650
"    %s> p file_systems",
4123
4651
"    file_systems = $1 = (struct file_system_type *) 0xc03adc90",
4124
 
"    %s> list file_system_type.next -s file_system_type.name,fs_flags 0xc03adc90",
 
4652
"    %s> list file_system_type.next -s file_system_type.name,fs_flags c03adc90",
4125
4653
"    c03adc90",
4126
4654
"      name = 0xc02c05c8 \"rootfs\",",
4127
4655
"      fs_flags = 0x30,",
4200
4728
"    f7254000",
4201
4729
"    f7004000",
4202
4730
" ",
4203
 
"  Lastly, in some kernel versions, the vfsmount structures of the mounted",
 
4731
"  In some kernel versions, the vfsmount structures of the mounted",
4204
4732
"  filesystems are linked by the LIST_HEAD \"vfsmntlist\", which uses the",
4205
4733
"  mnt_list list_head of each vfsmount structure in the list.  To dump each",
4206
4734
"  vfsmount structure in the list, append the -s option:\n",
4241
4769
"    f7445f60",
4242
4770
"    struct vfsmount {",
4243
4771
"    ...",
 
4772
" ",
 
4773
"  The task_struct of every task in the system is linked into a circular list",
 
4774
"  by its embedded \"tasks\" list_head.  Show the task_struct addresses and the",
 
4775
"  pids of all tasks in the system using \"-h\" option, starting with the ",
 
4776
"  task_struct at ffff88012b98e040:\n",
 
4777
"    %s> list task_struct.tasks -s task_struct.pid -h ffff88012b98e040",
 
4778
"    ffff88012b98e040",
 
4779
"      pid = 14187",
 
4780
"    ffff8801277be0c0",
 
4781
"      pid = 14248",
 
4782
"    ffffffff81a2d020",
 
4783
"      pid = 0",
 
4784
"    ffff88012d7dd4c0",
 
4785
"      pid = 1",
 
4786
"    ffff88012d7dca80",
 
4787
"      pid = 2",
 
4788
"    ffff88012d7dc040",
 
4789
"      pid = 3",
 
4790
"    ffff88012d7e9500",
 
4791
"      pid = 4",
 
4792
"    ...",
 
4793
"    ffff88012961a100",
 
4794
"      pid = 14101",
 
4795
"    ffff880129017580",
 
4796
"      pid = 14134",
 
4797
"    ffff8801269ed540",
 
4798
"      pid = 14135",
 
4799
"    ffff880128256080",
 
4800
"      pid = 14138",
 
4801
"    ffff88012b8f4100",
 
4802
"      pid = 14183",
4244
4803
NULL               
4245
4804
};
4246
4805
 
 
4806
char *help_tree[] = {
 
4807
"tree",
 
4808
"display radix tree or red-black tree",
 
4809
"-t [radix|rbtree] [-r offset] [-s struct[.member[,member]] -[x|d]]\n          [-o offset] [-p] [-N] start",
 
4810
"  This command dumps the contents of a radix tree or a red-black tree.",
 
4811
"  The arguments are as follows:\n",
 
4812
"    -t type  The type of tree to dump; the type string can be either ",
 
4813
"             \"radix\" or \"rbtree\", although only the first two characters",
 
4814
"             are required.",
 
4815
"  -r offset  If the \"start\" argument is the address of a data structure that",
 
4816
"             contains the radix_tree_root or rb_root structure, then this is", 
 
4817
"             the offset to that structure member.  If the offset is non-zero,",
 
4818
"             then this option is required.  The offset may be entered in either",
 
4819
"             of two manners:",
 
4820
"               1. In \"structure.member\" format.",
 
4821
"               2. A number of bytes.",
 
4822
"  -o offset  For red-black trees only, the offset of the rb_node within its ",
 
4823
"             containing data structure; if the offset is non-zero, then this",
 
4824
"             option is required.  The offset may be entered in either of two",
 
4825
"             manners:",
 
4826
"               1. In \"structure.member\" format.",
 
4827
"               2. A number of bytes.",
 
4828
"             This option is not applicable to radix trees.",
 
4829
"  -s struct  For each entry in a tree, format and print it as this type of data",
 
4830
"             structure; use the \"struct.member\" format in order to display a",
 
4831
"             particular member of the structure.  To display multiple members",
 
4832
"             of a structure, use a comma-separated list of members.",
 
4833
"         -x  Override default output format with hexadecimal format.",
 
4834
"         -d  Override default output format with decimal format.",
 
4835
"         -p  Display the node's position information, showing the relationship",
 
4836
"             between it and the root.  For red-black trees, a position that",
 
4837
"             indicates \"root/l/r\" means that the node is the right child",
 
4838
"             of the left child of the root node.  For radix trees, the height",
 
4839
"             and slot index values are shown with respect to the root.",
 
4840
" ",
 
4841
"  The meaning of the \"start\" argument, which can be expressed either in",
 
4842
"  hexadecimal format or symbolically, depends upon whether the -N option",
 
4843
"  is prepended:",
 
4844
" ",
 
4845
"      start  The address of a radix_tree_root or rb_root structure, or the",
 
4846
"             address of a structure containing the radix_tree_root or rb_root",
 
4847
"             structure; if the latter, then the \"-r offset\" option must be",
 
4848
"             used if the member offset of the root structure is non-zero.",
 
4849
"               ",
 
4850
"   -N start  The address of the structure radix_tree_node or rb_node, bypassing",
 
4851
"             the radix_tree_root or rb_root that points to it.",
 
4852
"",
 
4853
"\nEXAMPLES",
 
4854
"  The vmap_area_root is a standalone rb_root structure.  Display the ",
 
4855
"  virtual addresses of each vmap_area in its red-black tree:\n",
 
4856
"    %s> whatis vmap_area_root",
 
4857
"    struct rb_root vmap_area_root;",
 
4858
"    %s> tree -t rbtree -o vmap_area.rb_node vmap_area_root",
 
4859
"    ffff880128c508c0",
 
4860
"    ffff88012cb68140",
 
4861
"    ffff88012c9afec0",
 
4862
"    ffff88012d65c440",
 
4863
"    ...",
 
4864
"",
 
4865
"  Display the vmap_area's va_start and va_end members of each of",
 
4866
"  the entries above expressing the vmap_area.rb_node offset as a",
 
4867
"  number of bytes:\n",
 
4868
"    %s> tree -t rbtree -o 24 vmap_area_root -s vmap_area.va_start,va_end",
 
4869
"    ffff880128c508c0",
 
4870
"      va_start = 0xffffc90014900000",
 
4871
"      va_end = 0xffffc90014921000",
 
4872
"    ffff88012cb68140",
 
4873
"      va_start = 0xffffc900110c0000",
 
4874
"      va_end = 0xffffc900110d1000",
 
4875
"    ffff88012c9afec0",
 
4876
"      va_start = 0xffffc90000640000",
 
4877
"      va_end = 0xffffc90000642000",
 
4878
"    ffff88012d65c440",
 
4879
"      va_start = 0xffffc90000620000",
 
4880
"      va_end = 0xffffc90000622000",
 
4881
"    ...",
 
4882
"",
 
4883
"  Alternatively, use the -N option with the rb_node address contained",
 
4884
"  in the vmap_area_root structure:\n",
 
4885
"    %s> p vmap_area_root",
 
4886
"    vmap_area_root = $8 = {",
 
4887
"      rb_node = 0xffff880128c508d8",
 
4888
"    }",
 
4889
"    %s> tree -t rbtree -o vmap_area.rb_node -N 0xffff880128c508d8",
 
4890
"    ffff880128c508c0",
 
4891
"    ffff88012cb68140",
 
4892
"    ffff88012c9afec0",
 
4893
"    ffff88012d65c440",
 
4894
" ",
 
4895
"  Display the virtual address of each vm_area_struct in the red-black",
 
4896
"  tree that has its root inside an mm_struct located at ffff880128b5a300.",
 
4897
"  The vm_area_struct.vm_rb rb_node member has an offset of 0x38 bytes:\n",
 
4898
"    %s> tree -t rbtree -r mm_struct.mm_rb ffff880128b5a300 -o 0x38",
 
4899
"    ffff88012a0de080",
 
4900
"    ffff880123e3ac78",
 
4901
"    ffff880123e3a700",
 
4902
"    ffff88012b2837c8",
 
4903
"    ...",
 
4904
"    ffff880128c02ed0",
 
4905
"    ffff8801292e7958",
 
4906
"    ffff880123e3a318",
 
4907
"    ffff880123e3ad40",
 
4908
" ",
 
4909
"  Add the -p option to the command above to show postion information:\n",
 
4910
"    %s> tree -t rbtree -r mm_struct.mm_rb ffff880128b5a300 -o 0x38 -p",
 
4911
"    ffff88012a0de080",
 
4912
"      position: root",
 
4913
"    ffff880123e3ac78",
 
4914
"      position: root/l",
 
4915
"    ffff880123e3a700",
 
4916
"      position: root/l/l",
 
4917
"    ffff88012b2837c8",
 
4918
"      position: root/l/l/l",
 
4919
"    ...",
 
4920
"    ffff880128c02ed0",
 
4921
"      position: root/r/r/l/r",
 
4922
"    ffff8801292e7958",
 
4923
"      position: root/r/r/l/r/r",
 
4924
"    ffff880123e3a318",
 
4925
"      position: root/r/r/r",
 
4926
"    ffff880123e3ad40",
 
4927
"      position: root/r/r/r/r",
 
4928
"",
 
4929
"  Display a list of the page structs in the radix tree of an address_space",
 
4930
"  structure located at ffff88012d364de0:\n",
 
4931
"    %s> tree -t radix -r address_space.page_tree ffff88012d364de0",
 
4932
"    ffffea00040d12c0",
 
4933
"    ffffea00040d9a60",
 
4934
"    ffffea00040d9b08",
 
4935
"    ffffea000407eda8",
 
4936
"    ffffea0004084288",
 
4937
"    ...",
 
4938
"    ffffea000407bc70",
 
4939
"    ffffea00040baf48",
 
4940
"    ffffea0004043f48",
 
4941
"    ffffea000407de58",
 
4942
" ",
 
4943
"  Add the -p option to the command above to show postion information:\n",
 
4944
"    %s> tree -t radix -r address_space.page_tree ffff88012d364de0 -p",
 
4945
"    ffffea00040d12c0",
 
4946
"      position: root/0/0",
 
4947
"    ffffea00040d9a60",
 
4948
"      position: root/0/1",
 
4949
"    ffffea00040d9b08",
 
4950
"      position: root/0/2",
 
4951
"    ffffea000407eda8",
 
4952
"      position: root/0/3",
 
4953
"    ffffea0004084288",
 
4954
"      position: root/0/4",
 
4955
"    ...",
 
4956
"    ffffea000407bc70",
 
4957
"      position: root/3/25",
 
4958
"    ffffea00040baf48",
 
4959
"      position: root/3/26",
 
4960
"    ffffea0004043f48",
 
4961
"      position: root/3/27",
 
4962
"    ffffea000407de58",
 
4963
"      position: root/3/28",
 
4964
"",
 
4965
"  Alternatively, take the address of the radix_tree_node from the",
 
4966
"  radix_tree_root structure in the address_space structure above,",
 
4967
"  and display the tree with the -N option:\n",
 
4968
"    %s> struct address_space.page_tree ffff88012d364de0",
 
4969
"      page_tree = {",
 
4970
"        height = 0x2, ",
 
4971
"        gfp_mask = 0x20, ",
 
4972
"        rnode = 0xffff8801238add71",
 
4973
"      }",
 
4974
"    %s> tree -t radix -N 0xffff8801238add71",
 
4975
"    ffffea00040d12c0",
 
4976
"    ffffea00040d9a60",
 
4977
"    ffffea00040d9b08",
 
4978
"    ffffea000407eda8",
 
4979
"    ffffea0004084288",
 
4980
"    ffffea00040843a0",
 
4981
"    ...",
 
4982
" ",
 
4983
"  Using the same radix tree as above, display the flags and _count",
 
4984
"  members of each page struct in the list, and force the output format",
 
4985
"  to be hexadecimal:\n",
 
4986
"    %s> tree -t radix -N 0xffff8801238add71 -s page.flags,_count -x",
 
4987
"    ffffea00040d12c0",
 
4988
"      flags = 0x4000000002006c",
 
4989
"      _count = {",
 
4990
"        counter = 0x7",
 
4991
"      }",
 
4992
"    ffffea00040d9a60",
 
4993
"      flags = 0x4000000002006c",
 
4994
"      _count = {",
 
4995
"        counter = 0x7",
 
4996
"      }",
 
4997
"    ffffea00040d9b08",
 
4998
"      flags = 0x4000000002006c",
 
4999
"      _count = {",
 
5000
"        counter = 0x7",
 
5001
"      }",
 
5002
"    ffffea000407eda8",
 
5003
"      flags = 0x4000000002006c",
 
5004
"      _count = {",
 
5005
"        counter = 0x7",
 
5006
"      }",
 
5007
"    ...",
 
5008
NULL
 
5009
};
4247
5010
 
4248
5011
char *help_ptob[] = {
4249
5012
"ptob",
4263
5026
"  This command passes its arguments directly to gdb for processing.",
4264
5027
"  This is typically not necessary, but where ambiguities between %s and",
4265
5028
"  gdb command names exist, this will force the command to be executed by gdb.",
 
5029
"",
 
5030
"  Alternatively, if \"set gdb on\" is entered, the session will be run in a",
 
5031
"  mode where all commands are passed directly to gdb.  When running in that",
 
5032
"  mode, native %s commands may be executed by preceding them with the", 
 
5033
"  \"crash\" directive.  To restore native %s mode, enter \"set gdb off\".",
4266
5034
"\nEXAMPLES",
4267
5035
"    %s> gdb help",
4268
5036
"    List of classes of commands:",
4747
5515
char *help_dis[] = {
4748
5516
"dis",
4749
5517
"disassemble",
4750
 
"[-r][-l][-u][-b [num]] [address | symbol | (expression)] [count]",
 
5518
"[-rludx][-b [num]] [address | symbol | (expression)] [count]",
4751
5519
"  This command disassembles source code instructions starting (or ending) at",
4752
5520
"  a text address that may be expressed by value, symbol or expression:\n",
4753
5521
"            -r  (reverse) displays all instructions from the start of the ",
4757
5525
"            -u  address is a user virtual address in the current context;",
4758
5526
"                otherwise the address is assumed to be a kernel virtual address.",
4759
5527
"                If this option is used, then -r and -l are ignored.",
 
5528
"            -x  override default output format with hexadecimal format.",
 
5529
"            -d  override default output format with decimal format.",
4760
5530
"      -b [num]  modify the pre-calculated number of encoded bytes to skip after",
4761
5531
"                a kernel BUG (\"ud2a\") instruction; with no argument, displays",  
4762
5532
"                the current number of bytes being skipped. (x86 and x86_64 only)",
4859
5629
"    0x81ec642:      and    $0x0,\%ecx",
4860
5630
"    0x81ec645:      mov    \%ecx,\%eax",
4861
5631
" ",
 
5632
"  Override the current decimal output radix format:\n",
 
5633
"    %s> dis sys_read 10 -x",
 
5634
"    0xffffffff8001178f <sys_read>:  push   %r13",
 
5635
"    0xffffffff80011791 <sys_read+0x2>:      mov    %rsi,%r13",
 
5636
"    0xffffffff80011794 <sys_read+0x5>:      push   %r12",
 
5637
"    0xffffffff80011796 <sys_read+0x7>:      mov    $0xfffffffffffffff7,%r12",
 
5638
"    0xffffffff8001179d <sys_read+0xe>:      push   %rbp",
 
5639
"    0xffffffff8001179e <sys_read+0xf>:      mov    %rdx,%rbp",
 
5640
"    0xffffffff800117a1 <sys_read+0x12>:     push   %rbx",
 
5641
"    0xffffffff800117a2 <sys_read+0x13>:     sub    $0x18,%rsp",
 
5642
"    0xffffffff800117a6 <sys_read+0x17>:     lea    0x14(%rsp),%rsi",
 
5643
"    0xffffffff800117ab <sys_read+0x1c>:     callq  0xffffffff8000b5b4 <fget_light>",
4862
5644
NULL               
4863
5645
};
4864
5646
 
5074
5856
char *help_files[] = {
5075
5857
"files",
5076
5858
"open files",
5077
 
"[-l | -d dentry] | [-R reference] [pid | taskp] ... ",
 
5859
"[-d dentry] | [-R reference] [pid | taskp] ... ",
5078
5860
"  This command displays information about open files of a context.",
5079
5861
"  It prints the context's current root directory and current working", 
5080
5862
"  directory, and then for each open file descriptor it prints a pointer",
5083
5865
"  the current context is used.  The -R option, typically invoked from",
5084
5866
"  \"foreach files\", searches for references to a supplied number, address,",
5085
5867
"  or filename argument, and prints only the essential information leading",
5086
 
"  up to and including the reference.  The -l and -d options are not context",
5087
 
"  specific, and only show the data requested.\n",
5088
 
"            -l  display files open by lockd server for client locks.",
 
5868
"  up to and including the reference.  The -d option is not context",
 
5869
"  specific, and only shows the data requested.\n",
5089
5870
"     -d dentry  given a hexadecimal dentry address, display its inode,",
5090
5871
"                super block, file type, and full pathname.",
5091
5872
"  -R reference  search for references to this file descriptor number,",
5194
5975
char *help_net[] = {
5195
5976
"net",
5196
5977
"network command",
5197
 
"[-a] [[-s | -S] [-R ref] [pid | taskp]] [-n addr]",
 
5978
"[-a] [[-s | -S [-xd]] [-R ref] [pid | taskp]] [-n addr]",
5198
5979
"  Display various network related data:\n",
5199
5980
"      -a  display the ARP cache.",
5200
5981
"      -s  display open network socket/sock addresses, their family and type,",
5202
5983
"          addresses and ports.",
5203
5984
"      -S  displays open network socket/sock addresses followed by a dump",
5204
5985
"          of both structures.",
 
5986
"      -x  override default output format with hexadecimal format.",
 
5987
"      -d  override default output format with decimal format.",
5205
5988
"  -n addr translates an IPv4 address expressed as a decimal or hexadecimal",
5206
5989
"          value into a standard numbers-and-dots notation.",
5207
5990
"  -R ref  socket or sock address, or file descriptor.",
5221
6004
" ",
5222
6005
"  Dump the ARP cache:\n",
5223
6006
"    %s> net -a",
5224
 
"    IP ADDRESS      HW TYPE    HW ADDRESS         DEVICE  STATE",
5225
 
"    0.0.0.0         UNKNOWN    00 00 00 00 00 00  lo      40 (NOARP)",
5226
 
"    192.168.1.1     ETHER      00:50:54:fe:ef:23  eth0    04 (STALE)",
5227
 
"    192.168.1.10    ETHER      00:90:27:9c:6c:79  eth0    02 (REACHABLE)",
5228
 
"    192.168.1.118   ETHER      00:c0:4f:60:00:e2  eth0    02 (REACHABLE)",
 
6007
"    NEIGHBOUR      IP ADDRESS     HW TYPE   HW ADDRESS         DEVICE  STATE",
 
6008
"    f38d1b00       10.16.64.14    ETHER     00:16:3e:4b:a5:4a  eth1    STALE",
 
6009
"    f38d1080       0.0.0.0        UNKNOWN   00 00 00 00 00 00  lo      NOARP",
 
6010
"    f38d1bc0       10.16.71.254   ETHER     00:00:0c:07:ac:00  eth1    REACHABLE",
 
6011
"    f38d1200       10.16.64.21    ETHER     00:16:3e:51:d8:09  eth1    REACHABLE",
5229
6012
"   ",
5230
6013
"  Display the sockets for PID 2517, using both -s and -S output formats:\n",
5231
6014
"    %s> net -s 2517",
5467
6250
 
5468
6251
        if (helpflag & SYNOPSIS) {
5469
6252
                p++;
5470
 
                fprintf(fp, "Usage: %s ", cmd);
 
6253
                fprintf(fp, "Usage:\n  %s ", cmd);
5471
6254
                fprintf(fp, *p, pc->program_name, pc->program_name);
5472
6255
                fprintf(fp, "\nEnter \"help %s\" for details.\n", cmd);
5473
6256
                RESTART();
5545
6328
"the CTRL-p and CTRL-n keys instead of the up- and down-arrow keys; in vi mode",
5546
6329
"you can enter <ESC>, then \"k\" to cycle back, or \"j\" to cycle forward.",
5547
6330
" ",
5548
 
"Lastly, a set of %s commands may be entered into a regular file that can",
5549
 
"used as input, again using standard command line syntax:\n",
 
6331
"A set of %s commands may be entered into a regular file that can be used as",
 
6332
"input, using standard command line syntax:\n",
5550
6333
"  %s> < inputfile\n",
5551
6334
"An input file may be also be run from the %s command line using the -i ",
5552
6335
"option:\n",
5553
6336
"  $ %s -i inputfile",
5554
6337
"",
 
6338
"Alternatively, an input file containing command arguments may be created.",
 
6339
"The arguments in the input file will be passed to the command specified,",
 
6340
"which will be executed repetetively for each line of arguments in the file:",
 
6341
"",
 
6342
"  %s> ps -p < inputfile",
 
6343
"",
5555
6344
"Lastly, if a command is entered that is not recognized, it is checked against",
5556
6345
"the kernel's list of variables, structure, union or typedef names, and if ",
5557
6346
"found, the command is passed to p, struct, union or whatis.  That being the ",
5558
6347
"case, as long as a kernel variable/structure/union name is different than any",
5559
6348
"of the current commands, the appropriate command above will be executed.  If",
5560
6349
"not, the command will be passed on to the built-in gdb command for execution.",
 
6350
"If an input line starts with \"#\" or \"//\", then the line will be saved",
 
6351
"as a comment that is visible when re-cycling through the history list.",
5561
6352
NULL
5562
6353
};
5563
6354
 
5643
6434
static 
5644
6435
char *version_info[] = {
5645
6436
 
5646
 
"Copyright (C) 2002-2011  Red Hat, Inc.",
5647
 
"Copyright (C) 2004, 2005, 2006  IBM Corporation", 
 
6437
"Copyright (C) 2002-2012  Red Hat, Inc.",
 
6438
"Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation", 
5648
6439
"Copyright (C) 1999-2006  Hewlett-Packard Co",
5649
 
"Copyright (C) 2005, 2006  Fujitsu Limited",
 
6440
"Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited",
5650
6441
"Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.",
5651
 
"Copyright (C) 2005  NEC Corporation",
 
6442
"Copyright (C) 2005, 2011  NEC Corporation",
5652
6443
"Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.",
5653
6444
"Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.",
5654
6445
"This program is free software, covered by the GNU General Public License,",