From: Florian Forster Date: Fri, 17 Apr 2009 23:04:48 +0000 (+0200) Subject: Merge branch 'collectd-4.5' into collectd-4.6 X-Git-Tag: collectd-4.7.0~13^2~13 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=9b626288aff81c68fe19210a58b4a32eeefde9d3;hp=4ea822d83441f31e816d0742f1276bb501a0cb11 Merge branch 'collectd-4.5' into collectd-4.6 Conflicts: src/cpu.c --- diff --git a/src/battery.c b/src/battery.c index 272193ee..33ba2923 100644 --- a/src/battery.c +++ b/src/battery.c @@ -23,6 +23,8 @@ #include "common.h" #include "plugin.h" +#include "utils_complain.h" + #if HAVE_MACH_MACH_TYPES_H # include #endif @@ -436,6 +438,8 @@ static int battery_read (void) /* #endif HAVE_IOKIT_IOKITLIB_H || HAVE_IOKIT_PS_IOPOWERSOURCES_H */ #elif KERNEL_LINUX + static c_complain_t acpi_dir_complaint = C_COMPLAIN_INIT_STATIC; + FILE *fh; char buffer[1024]; char filename[256]; @@ -506,8 +510,17 @@ static int battery_read (void) battery_submit ("0", "voltage", voltage); } - walk_directory (battery_acpi_dir, battery_read_acpi, - /* user_data = */ NULL); + if (0 == access (battery_acpi_dir, R_OK)) + walk_directory (battery_acpi_dir, battery_read_acpi, + /* user_data = */ NULL); + else + { + char errbuf[1024]; + c_complain_once (LOG_WARNING, &acpi_dir_complaint, + "battery plugin: Failed to access `%s': %s", + battery_acpi_dir, + sstrerror (errno, errbuf, sizeof (errbuf))); + } #endif /* KERNEL_LINUX */ diff --git a/src/cpu.c b/src/cpu.c index 8a4e10e6..64ce5df9 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -1,7 +1,8 @@ /** * collectd - src/cpu.c * Copyright (C) 2005-2009 Florian octo Forster - * Copyright (C) 2009 Simon Kuhnle + * Copyright (C) 2008 Oleg King + * Copyright (C) 2009 Simon Kuhnle * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -18,6 +19,7 @@ * * Authors: * Florian octo Forster + * Oleg King * Simon Kuhnle **/ diff --git a/src/interface.c b/src/interface.c index 520f4c8d..fad37dbe 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,6 +1,6 @@ /** * collectd - src/interface.c - * Copyright (C) 2005-2007 Florian octo Forster + * Copyright (C) 2005-2008 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/memory.c b/src/memory.c index 7e4e7543..2d90de3c 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1,6 +1,6 @@ /** * collectd - src/memory.c - * Copyright (C) 2005-2007 Florian octo Forster + * Copyright (C) 2005-2008 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/ping.c b/src/ping.c index 7ffbfaff..084e4568 100644 --- a/src/ping.c +++ b/src/ping.c @@ -1,6 +1,6 @@ /** * collectd - src/ping.c - * Copyright (C) 2005,2006 Florian octo Forster + * Copyright (C) 2005-2007 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/src/processes.c b/src/processes.c index 26dde3e4..2e44018e 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1357,7 +1357,9 @@ static int ps_read (void) pse.num_proc = 1; pse.num_lwp = procs[i].ki_numthreads; + pse.vmem_size = procs[i].ki_size; pse.vmem_rss = procs[i].ki_rssize * getpagesize(); + pse.stack_size = procs[i].ki_ssize * getpagesize(); pse.vmem_minflt = 0; pse.vmem_minflt_counter = procs[i].ki_rusage.ru_minflt; pse.vmem_majflt = 0;