diff options
author | Bartosz Golaszewski <bartekgola@gmail.com> | 2014-06-22 14:01:13 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-06-22 14:01:13 +0200 |
commit | 5d2e409ef8224dc32fde59702e8ec90b231441ed (patch) | |
tree | 1d73d4a99a495ba57bc5be8878dce3cefbb99e9f /procps/mpstat.c | |
parent | f92f1d0181853b989f9377debb56902e3e21c9a8 (diff) | |
download | busybox-w32-5d2e409ef8224dc32fde59702e8ec90b231441ed.tar.gz busybox-w32-5d2e409ef8224dc32fde59702e8ec90b231441ed.tar.bz2 busybox-w32-5d2e409ef8224dc32fde59702e8ec90b231441ed.zip |
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>
Diffstat (limited to 'procps/mpstat.c')
-rw-r--r-- | procps/mpstat.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/procps/mpstat.c b/procps/mpstat.c index aa5a5c73f..c628d6215 100644 --- a/procps/mpstat.c +++ b/procps/mpstat.c | |||
@@ -775,12 +775,6 @@ static void main_loop(void) | |||
775 | 775 | ||
776 | /* Initialization */ | 776 | /* Initialization */ |
777 | 777 | ||
778 | /* Get number of clock ticks per sec */ | ||
779 | static ALWAYS_INLINE unsigned get_hz(void) | ||
780 | { | ||
781 | return sysconf(_SC_CLK_TCK); | ||
782 | } | ||
783 | |||
784 | static void alloc_struct(int cpus) | 778 | static void alloc_struct(int cpus) |
785 | { | 779 | { |
786 | int i; | 780 | int i; |
@@ -873,7 +867,7 @@ int mpstat_main(int UNUSED_PARAM argc, char **argv) | |||
873 | G.cpu_nr = get_cpu_count(); | 867 | G.cpu_nr = get_cpu_count(); |
874 | 868 | ||
875 | /* Get number of clock ticks per sec */ | 869 | /* Get number of clock ticks per sec */ |
876 | G.hz = get_hz(); | 870 | G.hz = bb_clk_tck(); |
877 | 871 | ||
878 | /* Calculate number of interrupts per processor */ | 872 | /* Calculate number of interrupts per processor */ |
879 | G.irqcpu_nr = get_irqcpu_nr(PROCFS_INTERRUPTS, NR_IRQS) + NR_IRQCPU_PREALLOC; | 873 | G.irqcpu_nr = get_irqcpu_nr(PROCFS_INTERRUPTS, NR_IRQS) + NR_IRQCPU_PREALLOC; |