While you're at it:
printf("CPU states:"
" %2ld.%ld%% user, %2ld.%ld%% system,"
" %2ld.%ld%% nice, %2ld.%ld%% idle",
user_ticks / 10UL, user_ticks % 10UL,
system_ticks / 10UL, system_ticks % 10UL,
nice_ticks / 10UL, nice_ticks % 10UL,
idle_ticks / 10UL, idle_ticks % 10UL);
" %2ld" -> "%3ld" will make 100.00% look much nicer:
Current code: " 34.56%" " 100.00%" (i.e. 100% is one char wider!)
New code: " 34.56%" "100.00%"
Same here:
printf ("CPU%d states: %2d.%-d%% user, %2d.%-d%% system,"
" %2d.%-d%% nice, %2d.%-d%% idle",
cpumap,
Another thing: in sight of moves towards 64bit jiffies isn't it wise to
use unsigned long long (or explicit u64) for all these numbers?
-- vda - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/