Browse Source

Integrated LevelDB backend into tracer, streamlined name handling in

Eyck Jentzsch 1 year ago
parent
commit
53ff55301c
3 changed files with 6 additions and 2 deletions
  1. 1
    1
      incl/scc/tracer.h
  2. 0
    1
      src/scv_tr_sqlite/scv_tr_sqlite.cpp
  3. 5
    0
      src/tracer.cpp

+ 1
- 1
incl/scc/tracer.h View File

@@ -42,7 +42,7 @@ public:
42 42
     /**
43 43
      *
44 44
      */
45
-    enum file_type { NONE, TEXT, COMPRESSED, BINARY, SQLITE };
45
+    enum file_type { NONE, TEXT, COMPRESSED, BINARY, SQLITE, LEVEL };
46 46
     /**
47 47
      *
48 48
      * @param name basename of the trace file(s)

+ 0
- 1
src/scv_tr_sqlite/scv_tr_sqlite.cpp View File

@@ -137,7 +137,6 @@ static void dbCb(const scv_tr_db &_scv_tr_db, scv_tr_db::callback_reason reason,
137 137
     case scv_tr_db::CREATE:
138 138
         if ((_scv_tr_db.get_name() != nullptr) && (strlen(_scv_tr_db.get_name()) != 0)) fName = _scv_tr_db.get_name();
139 139
         try {
140
-            if (fName.size() < 5 || fName.find(".txdb", fName.size() - 5) == string::npos) fName += ".txdb";
141 140
             remove(fName.c_str());
142 141
             db.open(fName);
143 142
             // performance related according to

+ 5
- 0
src/tracer.cpp View File

@@ -64,6 +64,11 @@ tracer::tracer(const std::string &&name, file_type type, bool enable)
64 64
             break;
65 65
         case SQLITE:
66 66
             scv_tr_sqlite_init();
67
+            ss << ".txdb";
68
+            break;
69
+        case LEVEL:
70
+            scv_tr_ldb_init();
71
+            ss << ".txldb";
67 72
             break;
68 73
         }
69 74
         txdb = new scv_tr_db(ss.str().c_str());