diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-13 16:07:51 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-13 16:07:51 +0100 |
commit | 068444629fbcf59dd8165a63885f8e69fd5cb474 (patch) | |
tree | 1920df77e4484f985f48fd2794093730c29e2b6a | |
parent | 8030a1484917d5b71d5ccd1a1d28a29da7a3d7f0 (diff) | |
download | busybox-w32-068444629fbcf59dd8165a63885f8e69fd5cb474.tar.gz busybox-w32-068444629fbcf59dd8165a63885f8e69fd5cb474.tar.bz2 busybox-w32-068444629fbcf59dd8165a63885f8e69fd5cb474.zip |
top: add keyboard commands to --help
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r-- | include/usage.src.h | 8 | ||||
-rw-r--r-- | procps/top.c | 29 |
2 files changed, 29 insertions, 8 deletions
diff --git a/include/usage.src.h b/include/usage.src.h index ef2bebd8b..a4776a2d6 100644 --- a/include/usage.src.h +++ b/include/usage.src.h | |||
@@ -3826,14 +3826,6 @@ INSERT | |||
3826 | "Runs PROG. Sends SIG to it if it is not gone in SECS seconds.\n" \ | 3826 | "Runs PROG. Sends SIG to it if it is not gone in SECS seconds.\n" \ |
3827 | "Defaults: SECS: 10, SIG: TERM." \ | 3827 | "Defaults: SECS: 10, SIG: TERM." \ |
3828 | 3828 | ||
3829 | #define top_trivial_usage \ | ||
3830 | "[-b] [-nCOUNT] [-dSECONDS]" IF_FEATURE_TOPMEM(" [-m]") | ||
3831 | #define top_full_usage "\n\n" \ | ||
3832 | "Provide a view of process activity in real time.\n" \ | ||
3833 | "Read the status of all processes from /proc each SECONDS\n" \ | ||
3834 | "and display a screenful of them." \ | ||
3835 | //TODO: add options and keyboard commands | ||
3836 | |||
3837 | #define tr_trivial_usage \ | 3829 | #define tr_trivial_usage \ |
3838 | "[-cds] STRING1 [STRING2]" | 3830 | "[-cds] STRING1 [STRING2]" |
3839 | #define tr_full_usage "\n\n" \ | 3831 | #define tr_full_usage "\n\n" \ |
diff --git a/procps/top.c b/procps/top.c index f9106fac7..1eb33dc5d 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -833,6 +833,35 @@ enum { | |||
833 | | PSSCAN_COMM, | 833 | | PSSCAN_COMM, |
834 | }; | 834 | }; |
835 | 835 | ||
836 | //usage:#if ENABLE_FEATURE_SHOW_THREADS || ENABLE_FEATURE_TOP_SMP_CPU | ||
837 | //usage:# define IF_SHOW_THREADS_OR_TOP_SMP(...) __VA_ARGS__ | ||
838 | //usage:#else | ||
839 | //usage:# define IF_SHOW_THREADS_OR_TOP_SMP(...) | ||
840 | //usage:#endif | ||
841 | //usage:#define top_trivial_usage | ||
842 | //usage: "[-b] [-nCOUNT] [-dSECONDS]" IF_FEATURE_TOPMEM(" [-m]") | ||
843 | //usage:#define top_full_usage "\n\n" | ||
844 | //usage: "Provide a view of process activity in real time." | ||
845 | //usage: "\n""Read the status of all processes from /proc each SECONDS" | ||
846 | //usage: "\n""and display a screenful of them." | ||
847 | //usage: "\n""Keys:" | ||
848 | //usage: "\n"" N/M" | ||
849 | //usage: IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE("/P") | ||
850 | //usage: IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE("/T") | ||
851 | //usage: ": " IF_FEATURE_TOPMEM("show CPU usage, ") "sort by pid/mem" | ||
852 | //usage: IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE("/cpu") | ||
853 | //usage: IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE("/time") | ||
854 | //usage: IF_FEATURE_TOPMEM( | ||
855 | //usage: "\n"" S: show memory, R: reverse memory sort" | ||
856 | //usage: ) | ||
857 | //usage: IF_SHOW_THREADS_OR_TOP_SMP( | ||
858 | //usage: "\n"" " | ||
859 | //usage: IF_FEATURE_SHOW_THREADS("H: toggle threads") | ||
860 | //usage: IF_FEATURE_SHOW_THREADS(IF_FEATURE_TOP_SMP_CPU(", ")) | ||
861 | //usage: IF_FEATURE_TOP_SMP_CPU("1: toggle SMP") | ||
862 | //usage: ) | ||
863 | //usage: "\n"" Q,^C: exit" | ||
864 | |||
836 | int top_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 865 | int top_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
837 | int top_main(int argc UNUSED_PARAM, char **argv) | 866 | int top_main(int argc UNUSED_PARAM, char **argv) |
838 | { | 867 | { |