[PATCH] top: provide cmdline argument '-H' to enable thread scanning by default

Xabier Oneca -- xOneca xoneca at gmail.com
Fri Mar 29 07:28:39 UTC 2019


Hi Thomas,

> diff --git a/procps/top.c b/procps/top.c
> index 625409755..59b0adf04 100644
> --- a/procps/top.c
> +++ b/procps/top.c
> @@ -1110,7 +1114,7 @@ int top_main(int argc UNUSED_PARAM, char **argv)
>
>         /* all args are options; -n NUM */
>         make_all_argv_opts(argv); /* options can be specified w/o dash */
> -       col = getopt32(argv, "d:n:b"IF_FEATURE_TOPMEM("m"), &str_interval, &str_iterations);
> +       col = getopt32(argv, "d:n:b"IF_FEATURE_TOPMEM("m")"H", &str_interval, &str_iterations);

Now -H is ignored if FEATURE_SHOW_THREADS is not enabled (instead of
showing error & usage). Is it what we want? Maybe. But then I would
write a comment clearing this situation.

I personally prefer the error & usage.

Cheers,

Xabier Oneca_,,_


More information about the busybox mailing list