From 46d58adcd416a3d895187ee95918d06b4198faae Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Thu, 11 Jul 2013 17:37:55 +0200 Subject: ifpps: show kernel version and machine type Lets make the headline output a bit more useful and show the current kernel version and well as the machine/hardware type. Signed-off-by: Daniel Borkmann --- ifpps.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ifpps.c') diff --git a/ifpps.c b/ifpps.c index 6743105..0852276 100644 --- a/ifpps.c +++ b/ifpps.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -71,6 +72,7 @@ static struct cpu_hit *cpu_hits; static struct avg_stat stats_avg; static int stats_loop = 0; static WINDOW *stats_screen = NULL; +static struct utsname uts; static const char *short_options = "d:t:n:vhclp"; static const struct option long_options[] = { @@ -687,8 +689,8 @@ static void screen_header(WINDOW *screen, const char *ifname, int *voff, link == 0 ? "no" : "yes"); mvwprintw(screen, (*voff)++, 2, - "Kernel net/sys statistics for %s (%s%s), t=%lums, cpus=%u%s/%u" - " ", + "%s, %s, %s (%s%s), t=%lums, cpus=%u%s/%u" + " ", uts.release, uts.machine, ifname, drvinf.driver, buff, ms_interval, top_cpus, top_cpus > 0 && top_cpus < cpus ? "+1" : "", cpus); } @@ -1231,6 +1233,8 @@ int main(int argc, char **argv) cpus = get_number_cpus(); top_cpus = min(top_cpus, cpus); + if (uname(&uts) < 0) + panic("Cannot execute uname!\n"); stats_alloc(&stats_old, cpus); stats_alloc(&stats_new, cpus); -- cgit v1.2.3-54-g00ecf