// totalram=2107416576, freeram=211525632, sharedram=0, bufferram=157204480}
// totalswap=134209536, freeswap=134209536, procs=157})
-#include <time.h>
#include "libbb.h"
typedef unsigned long long ullong;
#define S_STAT(a) \
typedef struct a { \
struct s_stat *next; \
- void (*collect)(struct a *s); \
+ void (*collect)(struct a *s) FAST_FUNC; \
const char *label;
#define S_STAT_END(a) } a;
S_STAT(s_stat)
S_STAT_END(s_stat)
-static void collect_literal(s_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_literal(s_stat *s UNUSED_PARAM)
{
}
S_STAT_END(cpu_stat)
-static void collect_cpu(cpu_stat *s)
+static void FAST_FUNC collect_cpu(cpu_stat *s)
{
ullong data[CPU_FIELDCNT] = { 0, 0, 0, 0, 0, 0, 0 };
unsigned frac[CPU_FIELDCNT] = { 0, 0, 0, 0, 0, 0, 0 };
int no;
S_STAT_END(int_stat)
-static void collect_int(int_stat *s)
+static void FAST_FUNC collect_int(int_stat *s)
{
ullong data[1];
ullong old;
ullong old;
S_STAT_END(ctx_stat)
-static void collect_ctx(ctx_stat *s)
+static void FAST_FUNC collect_ctx(ctx_stat *s)
{
ullong data[1];
ullong old;
ullong old[2];
S_STAT_END(blk_stat)
-static void collect_blk(blk_stat *s)
+static void FAST_FUNC collect_blk(blk_stat *s)
{
ullong data[2];
int i;
ullong old;
S_STAT_END(fork_stat)
-static void collect_thread_nr(fork_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_thread_nr(fork_stat *s UNUSED_PARAM)
{
ullong data[1];
scale(data[0]);
}
-static void collect_fork(fork_stat *s)
+static void FAST_FUNC collect_fork(fork_stat *s)
{
ullong data[1];
ullong old;
char *device_colon;
S_STAT_END(if_stat)
-static void collect_if(if_stat *s)
+static void FAST_FUNC collect_if(if_stat *s)
{
ullong data[4];
int i;
//HugePages_Total: 0
//HugePages_Free: 0
//Hugepagesize: 4096 kB
-static void collect_mem(mem_stat *s)
+static void FAST_FUNC collect_mem(mem_stat *s)
{
ullong m_total = 0;
ullong m_free = 0;
S_STAT(swp_stat)
S_STAT_END(swp_stat)
-static void collect_swp(swp_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_swp(swp_stat *s UNUSED_PARAM)
{
ullong s_total[1];
ullong s_free[1];
S_STAT(fd_stat)
S_STAT_END(fd_stat)
-static void collect_fd(fd_stat *s UNUSED_PARAM)
+static void FAST_FUNC collect_fd(fd_stat *s UNUSED_PARAM)
{
ullong data[2];
int scale;
S_STAT_END(time_stat)
-static void collect_time(time_stat *s)
+static void FAST_FUNC collect_time(time_stat *s)
{
char buf[sizeof("12:34:56.123456")];
struct tm* tm;
return (s_stat*)s;
}
-static void collect_info(s_stat *s)
+static void FAST_FUNC collect_info(s_stat *s)
{
gen ^= 1;
while (s) {
};
int nmeter_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int nmeter_main(int argc, char **argv)
+int nmeter_main(int argc UNUSED_PARAM, char **argv)
{
char buf[32];
s_stat *first = NULL;
xchdir("/proc");
- if (argc != 2)
+ if (!argv[1])
bb_show_usage();
if (open_read_close("version", buf, sizeof(buf)-1) > 0) {