add tuning enable variable
Add a variable that when set, enables tuning logging. This variable is
set to false.
Tuning can be enabled via "-t" "--tuning" on the command line.
With a parameter is the path where to write the logging information.
Change-Id: I6eb8035d56cc3301face21e9375c02fc9fcc5b31
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/main.cpp b/main.cpp
index d896300..cec3789 100644
--- a/main.cpp
+++ b/main.cpp
@@ -22,6 +22,7 @@
#include "pid/builder.hpp"
#include "pid/buildjson.hpp"
#include "pid/pidthread.hpp"
+#include "pid/tuning.hpp"
#include "pid/zone.hpp"
#include "sensors/builder.hpp"
#include "sensors/buildjson.hpp"
@@ -65,12 +66,13 @@
// clang-format off
static struct option long_options[] = {
{"conf", required_argument, 0, 'c'},
+ {"tuning", required_argument, 0, 't'},
{0, 0, 0, 0}
};
// clang-format on
int option_index = 0;
- int c = getopt_long(argc, argv, "c:", long_options, &option_index);
+ int c = getopt_long(argc, argv, "t:c:", long_options, &option_index);
if (c == -1)
{
@@ -82,6 +84,10 @@
case 'c':
configPath = std::string{optarg};
break;
+ case 't':
+ tuningLoggingEnabled = true;
+ tuningLoggingPath = std::string{optarg};
+ break;
default:
/* skip garbage. */
continue;