Adding new feature of core PID loop logging

This differs from the normal logging,
as this focuses on the core of the PID loop computations.

All variables within the core pid/ec/pid.cpp pid()
function are now logged, so math can be debugged.

Output is throttled to only log a new line
when it changes, or when 60 seconds have elapsed.

Creates 2 files for each PID loop,
one showing coefficients that were configured for it,
and one showing the variables changing over time.

Enable by --corelogging command line option,
or by creating /etc/thermal.d/corelogging file.

Tested:
Log files appear as expected, when enabled.
No changes noticed, when this feature is disabled.

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: I3f37fe918e7cbc6fb885ffa2f268600d5a317d32
diff --git a/test/Makefile.am b/test/Makefile.am
index 86493c6..d7d4d9d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -44,13 +44,15 @@
 
 pid_zone_unittest_SOURCES = pid_zone_unittest.cpp
 pid_zone_unittest_LDADD = $(top_builddir)/pid/ec/pid.o \
+ $(top_builddir)/pid/ec/logging.o \
  $(top_builddir)/sensors/manager.o $(top_builddir)/pid/pidcontroller.o \
  $(top_builddir)/pid/zone.o $(top_builddir)/pid/tuning.o
 
 pid_thermalcontroller_unittest_SOURCES = pid_thermalcontroller_unittest.cpp
 pid_thermalcontroller_unittest_LDADD = $(top_builddir)/pid/ec/pid.o \
+ $(top_builddir)/pid/ec/logging.o $(top_builddir)/pid/tuning.o \
  $(top_builddir)/pid/util.o $(top_builddir)/pid/pidcontroller.o \
- $(top_builddir)/pid/thermalcontroller.o $(top_builddir)/pid/tuning.o
+ $(top_builddir)/pid/thermalcontroller.o
 
 pid_stepwisecontroller_unittest_SOURCES = pid_stepwisecontroller_unittest.cpp
 pid_stepwisecontroller_unittest_LDADD = $(top_builddir)/pid/ec/stepwise.o \
@@ -59,6 +61,7 @@
 
 pid_fancontroller_unittest_SOURCES = pid_fancontroller_unittest.cpp
 pid_fancontroller_unittest_LDADD = $(top_builddir)/pid/ec/pid.o \
+ $(top_builddir)/pid/ec/logging.o \
  $(top_builddir)/pid/util.o $(top_builddir)/pid/pidcontroller.o \
  $(top_builddir)/pid/fancontroller.o $(top_builddir)/pid/tuning.o