Skip to content
Snippets Groups Projects
Commit da7ee6e3 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Fixing bugs in reading global_knobs.txt - Adding check for file exist

parent 4c7402b3
No related branches found
No related tags found
No related merge requests found
......@@ -24,16 +24,20 @@ PerfParams::PerfParams(int row1, int col1, int skip_offset1) {
PerfParamSet::PerfParamSet() {
//printf("- knobs_file_path = %s \n", GLOBAL_KNOBS_FILE);
printf("- knobs_file_path = %s \n", GLOBAL_KNOBS_FILE);
std::ifstream file(GLOBAL_KNOBS_FILE);
if (!file){
ERROR(" Could NOT find global_knobs.txt \n");
}
std::string line;
std::string partial;
std::vector<std::string> tokens;
while (std::getline(file, line)) { // Read each line
// printf ("***** line === %s ", line);
//printf ("***** line === %s ", line);
std::istringstream iss(line);
std::string token;
while (std::getline(iss, token, '\t')) { // Read each token in the line
......@@ -94,9 +98,13 @@ SampParams::SampParams(int skip_rate1, int skip_offset1,
SampParamSet::SampParamSet() {
//printf("- knobs_file_path = %s \n", GLOBAL_KNOBS_FILE);
printf("- knobs_file_path = %s \n", GLOBAL_KNOBS_FILE);
std::ifstream file(GLOBAL_KNOBS_FILE);
if (!file){
ERROR("Could NOT find global_knobs.txt \n");
}
std::string line;
std::string partial;
std::vector<std::string> tokens;
......
......@@ -5,6 +5,7 @@
#define LOG_DEBUG 0 // Sets the debug logging to true
#define LOG_INFO 1 // Sets the info logging to true
#define LOG_ERROR 1 // Print Errors
#define ASSERT_FLAG // Sets assertions to true (opposite of NDEBUG macro)
#include "debug.h"
......@@ -35,7 +36,7 @@ void DEBUG(const char *format, ...) {
}
void ERROR(const char *format, ...) {
if (!LOG_DEBUG) // Don't print if logging info is disabled
if (!LOG_ERROR) // Don't print if logging info is disabled
return;
va_list args;
va_start(args, format);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment