libbb: use a wrapper around sysconf(_SC_CLK_TCK) to save a few bytes
function old new delta bb_sc_clk_tck - 10 +10 timescmd 118 113 -5 print_route 1763 1758 -5 mpstat_main 1288 1283 -5 iostat_main 1947 1942 -5 INET_setroute 879 871 -8 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/5 up/down: 10/-28) Total: -18 bytes Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
committed by
Denys Vlasenko
parent
f92f1d0181
commit
5d2e409ef8
@@ -775,12 +775,6 @@ static void main_loop(void)
|
||||
|
||||
/* Initialization */
|
||||
|
||||
/* Get number of clock ticks per sec */
|
||||
static ALWAYS_INLINE unsigned get_hz(void)
|
||||
{
|
||||
return sysconf(_SC_CLK_TCK);
|
||||
}
|
||||
|
||||
static void alloc_struct(int cpus)
|
||||
{
|
||||
int i;
|
||||
@@ -873,7 +867,7 @@ int mpstat_main(int UNUSED_PARAM argc, char **argv)
|
||||
G.cpu_nr = get_cpu_count();
|
||||
|
||||
/* Get number of clock ticks per sec */
|
||||
G.hz = get_hz();
|
||||
G.hz = bb_clk_tck();
|
||||
|
||||
/* Calculate number of interrupts per processor */
|
||||
G.irqcpu_nr = get_irqcpu_nr(PROCFS_INTERRUPTS, NR_IRQS) + NR_IRQCPU_PREALLOC;
|
||||
|
Reference in New Issue
Block a user