From: Florian Forster Date: Fri, 3 Feb 2012 10:49:04 +0000 (+0100) Subject: Merge branch 'collectd-4.10' into collectd-5.0 X-Git-Tag: collectd-5.0.3~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=d0bb20feb1c5915e8b8af24cc2d46c4ac82d6704;hp=-c;p=collectd.git Merge branch 'collectd-4.10' into collectd-5.0 --- d0bb20feb1c5915e8b8af24cc2d46c4ac82d6704 diff --combined src/interface.c index 9501161c,db998a3f..ea820399 --- a/src/interface.c +++ b/src/interface.c @@@ -1,6 -1,6 +1,6 @@@ /** * collectd - src/interface.c - * Copyright (C) 2005-2008 Florian octo Forster + * Copyright (C) 2005-2010 Florian octo Forster * Copyright (C) 2009 Manuel Sanmartin * * This program is free software; you can redistribute it and/or modify it @@@ -128,7 -128,7 +128,7 @@@ static int interface_config (const cha static int interface_init (void) { kstat_t *ksp_chain; - unsigned long long val; + derive_t val; numif = 0; @@@ -141,17 -141,11 +141,11 @@@ { if (strncmp (ksp_chain->ks_class, "net", 3)) continue; - /* Ignore kstat entry if not the regular statistic set. This - * avoids problems with "bogus" interfaces, such as - * "wrsmd" */ - if (strncmp (ksp_chain->ks_name, ksp_chain->ks_module, - strlen (ksp_chain->ks_module)) != 0) - continue; if (ksp_chain->ks_type != KSTAT_TYPE_NAMED) continue; if (kstat_read (kc, ksp_chain, NULL) == -1) continue; - if ((val = get_kstat_value (ksp_chain, "ifspeed")) == -1LL) + if ((val = get_kstat_value (ksp_chain, "obytes")) == -1LL) continue; ksp[numif++] = ksp_chain; } @@@ -161,8 -155,8 +155,8 @@@ #endif /* HAVE_LIBKSTAT */ static void if_submit (const char *dev, const char *type, - unsigned long long rx, - unsigned long long tx) + derive_t rx, + derive_t tx) { value_t values[2]; value_list_t vl = VALUE_LIST_INIT; @@@ -170,15 -164,15 +164,15 @@@ if (ignorelist_match (ignorelist, dev) != 0) return; - values[0].counter = rx; - values[1].counter = tx; + values[0].derive = rx; + values[1].derive = tx; vl.values = values; vl.values_len = 2; sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "interface", sizeof (vl.plugin)); + sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type)); - sstrncpy (vl.type_instance, dev, sizeof (vl.type_instance)); plugin_dispatch_values (&vl); } /* void if_submit */ @@@ -239,7 -233,7 +233,7 @@@ static int interface_read (void #elif KERNEL_LINUX FILE *fh; char buffer[1024]; - unsigned long long incoming, outgoing; + derive_t incoming, outgoing; char *device; char *dummy; @@@ -291,8 -285,8 +285,8 @@@ #elif HAVE_LIBKSTAT int i; - unsigned long long rx; - unsigned long long tx; + derive_t rx; + derive_t tx; if (kc == NULL) return (-1); diff --combined version-gen.sh index 5bc20a11,1d5416ba..5eb46de6 --- a/version-gen.sh +++ b/version-gen.sh @@@ -1,6 -1,6 +1,6 @@@ - #!/bin/sh + #!/usr/bin/env bash -DEFAULT_VERSION="4.10.5.git" +DEFAULT_VERSION="5.0.2.git" VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"