multiple-cpu aware procps Top

Denys Vlasenko vda.linux at googlemail.com
Thu Sep 18 23:47:27 UTC 2008


On Thursday 18 September 2008 05:25, Vineet Gupta wrote:
> Given that more and more systems are moving towards multi-cpu/core
> architectures it would be nice if busybox Top could report SMP centric
> information.
> 
> I have a patch against Top of the tree (Rev 23420) to do just this.
> 
> ===========================
> The summary of changes is:
> ===========================
> 
> 1. Process List output has an additional column "cpu" which reports last CPU
> the process was found running on (when /proc sample was taken). This can
> come in handy to observe
> the effects of calls such as sched_setaffinity( ) which can pin a task to a
> set of CPU(s). New Config option ENABLE_FEATURE_TOP_SMP_PROCESS
> 
> 2. CPU Utilization reporting per CPU. There is a toggle "1" to display the
> regular output which is aggregate of all CPUs) vs a  per CPU line. New
> Config option ENABLE_FEATURE_TOP_SMP_CPU
> 
> Please consider applying the attached patch.

Please use only tabs for indentation, the patch you attached
has it mixed (tabs/spaces):

+#if ENABLE_FEATURE_TOP_SMP_PROCESS
+                               /* (6): rss_rlim, start_code, end_code, start_stack, kstk_esp, kstk_eip */
+                               /* (4): signal, blocked, sigignore, sigcatch */
+                               /* (4): wchan, nswap, cnswap, exit_signal */
+                       cp = skip_fields(cp, 14);
+            sp->last_seen_on_cpu = fast_strtoul_10(&cp);
 #endif

Otherwise, looks good.
--
vda



More information about the busybox mailing list