diff -u collectd-5.4.0/debian/changelog collectd-5.4.0/debian/changelog --- collectd-5.4.0/debian/changelog +++ collectd-5.4.0/debian/changelog @@ -1,3 +1,10 @@ +collectd (5.4.0-3ubuntu2.1) trusty; urgency=medium + + * debian/patches: + - Added swap_in_openvz.dpatch: Fix swap tracking in OpenVZ (LP: #1372750). + + -- Marius Gedminas Tue, 03 Nov 2015 14:49:47 +0200 + collectd (5.4.0-3ubuntu2) trusty; urgency=medium * Cherry-pick the following change from Debian to work around our FTBFS: diff -u collectd-5.4.0/debian/patches/00list collectd-5.4.0/debian/patches/00list --- collectd-5.4.0/debian/patches/00list +++ collectd-5.4.0/debian/patches/00list @@ -7,0 +8 @@ +swap_in_openvz.dpatch only in patch2: unchanged: --- collectd-5.4.0.orig/debian/patches/swap_in_openvz.dpatch +++ collectd-5.4.0/debian/patches/swap_in_openvz.dpatch @@ -0,0 +1,35 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## swap_in_openvz.dpatch by Florian Forster +## +## DP: This is the smallest possible fix for OpenVZ, where SwapCached is not +## DP: available. +## DP: +## DP: This is upstream commit 1a146775d42a15202cba4e19c0fcda465705bcb8, +## DP: suitable for backporting on top of 5.4.0. Git master (i.e. 5.5.0) +## DP: has a different fix for this. +## DP: +## DP: See . + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' collectd~/src/swap.c collectd/src/swap.c +--- collectd~/src/swap.c 2015-11-03 14:14:46.000000000 +0200 ++++ collectd/src/swap.c 2015-11-03 14:17:42.778738308 +0200 +@@ -339,7 +339,7 @@ + + fclose (fh); + +- if (have_data != 0x07) ++ if ((have_data & 0x03) != 0x03) + return (ENOENT); + + if (isnan (swap_total) +@@ -351,7 +351,8 @@ + + swap_submit_gauge (NULL, "used", 1024.0 * swap_used); + swap_submit_gauge (NULL, "free", 1024.0 * swap_free); +- swap_submit_gauge (NULL, "cached", 1024.0 * swap_cached); ++ if (have_data & 0x04) ++ swap_submit_gauge (NULL, "cached", 1024.0 * swap_cached); + + return (0); + } /* }}} int swap_read_combined */