aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/Config.src9
-rw-r--r--procps/powertop.c2
-rw-r--r--procps/ps.c32
3 files changed, 27 insertions, 16 deletions
diff --git a/procps/Config.src b/procps/Config.src
index 2b1b8ab11..7fcce98c5 100644
--- a/procps/Config.src
+++ b/procps/Config.src
@@ -5,7 +5,12 @@
5 5
6menu "Process Utilities" 6menu "Process Utilities"
7 7
8INSERT 8config FEATURE_FAST_TOP
9 bool "Faster /proc scanning code (+100 bytes)"
10 default n # all "fast or small" options default to small
11 help
12 This option makes top and ps ~20% faster (or 20% less CPU hungry),
13 but code size is slightly bigger.
9 14
10config FEATURE_SHOW_THREADS 15config FEATURE_SHOW_THREADS
11 bool "Support thread display in ps/pstree/top" 16 bool "Support thread display in ps/pstree/top"
@@ -15,4 +20,6 @@ config FEATURE_SHOW_THREADS
15 Enables the ps -T option, showing of threads in pstree, 20 Enables the ps -T option, showing of threads in pstree,
16 and 'h' command in top. 21 and 'h' command in top.
17 22
23INSERT
24
18endmenu 25endmenu
diff --git a/procps/powertop.c b/procps/powertop.c
index fc6018b7a..24c2b320f 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -505,7 +505,7 @@ static void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
505 unsigned int *edx) 505 unsigned int *edx)
506{ 506{
507 /* EAX value specifies what information to return */ 507 /* EAX value specifies what information to return */
508 __asm__( 508 asm (
509 " pushl %%ebx\n" /* Save EBX */ 509 " pushl %%ebx\n" /* Save EBX */
510 " cpuid\n" 510 " cpuid\n"
511 " movl %%ebx, %1\n" /* Save content of EBX */ 511 " movl %%ebx, %1\n" /* Save content of EBX */
diff --git a/procps/ps.c b/procps/ps.c
index 801a6fdf3..4c6e07e8b 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -451,17 +451,19 @@ static void parse_o(char* opt)
451 opt = comma + 1; 451 opt = comma + 1;
452 continue; 452 continue;
453 } 453 }
454 break; 454 // opt points to last spec in comma separated list.
455 } 455 // This one can have =HEADER part.
456 // opt points to last spec in comma separated list. 456 new = new_out_t();
457 // This one can have =HEADER part. 457 if (equal)
458 new = new_out_t(); 458 *equal = '\0';
459 if (equal) 459 *new = *find_out_spec(opt);
460 *equal = '\0'; 460 if (!equal)
461 *new = *find_out_spec(opt); 461 break;
462 if (equal) { 462 *equal++ = '=';
463 *equal = '='; 463 new->header = equal;
464 new->header = equal + 1; 464 comma = strchr(equal, ',');
465 if (comma)
466 *comma = '\0';
465 // POSIX: the field widths shall be ... at least as wide as 467 // POSIX: the field widths shall be ... at least as wide as
466 // the header text (default or overridden value). 468 // the header text (default or overridden value).
467 // If the header text is null, such as -o user=, 469 // If the header text is null, such as -o user=,
@@ -469,10 +471,12 @@ static void parse_o(char* opt)
469 // default header text 471 // default header text
470 if (new->header[0]) { 472 if (new->header[0]) {
471 new->width = strlen(new->header); 473 new->width = strlen(new->header);
472 print_header = 1;
473 } 474 }
474 } else 475 if (!comma)
475 print_header = 1; 476 break;
477 //*comma = ','; /* no, new->header should stay NUL-terminated */
478 opt = comma + 1;
479 }
476} 480}
477 481
478static void alloc_line_buffer(void) 482static void alloc_line_buffer(void)