Trace Parser: add protocol 5.0 version support 97/197697/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 15 Jan 2019 11:16:37 +0000 (14:16 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 4 Feb 2019 17:21:21 +0000 (20:21 +0300)
Change-Id: Ieab8d553b1813f5d0ab814d96f794d36db71a009
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
src/cli/trace_parser/docs/README.md
src/cli/trace_parser/exe/session_data.cpp
src/cli/trace_parser/lib/parser.cpp

index 945bffb27eb013216df6cb29eba1b66e600dd402..a70d36471635148cba908949629655dc6a296321 100644 (file)
@@ -43,9 +43,10 @@ API map list file can also be found at the output of **SWAP tool**, it's named *
 | 4.0     |
 | 4.1     |
 | 4.2     |
+| 5.0     |
 Protocol version should be chosen the same as one on the target where the trace was gathered. For detailed information and protocol description, please refer to Protocol Description located at *swap-manager/docs/protocol.rst* or at **swap-manager** *README* file.
 
-If user hasn't specified any protocol version, ***4.2*** protocol version will be used as default.
+If user hasn't specified any protocol version, ***5.0*** protocol version will be used as default.
 
 ### Output types
 **Trace Parser** supports the following output types:
@@ -131,7 +132,7 @@ You can run **Trace Parser** by running the following command in a directory, wh
 This command will read *trace.bin*, parse it into text format and output to *trace.txt*.
 The same command, if target info data is specified manually:
 ``` bash
-./swap_parser -i trace.bin -o trace.txt -c 4 -d 5 -v 4.2 -a api_map_list -t text
+./swap_parser -i trace.bin -o trace.txt -c 4 -d 5 -v 5.0 -a api_map_list -t text
 ```
 If user wants to use default data, it will be like the following:
 ``` bash
index 9c65371b9d3ea8cb217ff917ffdc9fcc6f692b6a..c8426e9ddaed231b4d87fe871d96b179dc402862 100644 (file)
@@ -60,7 +60,7 @@ po::variables_map SessionData::parse_cmdline(int argc, char **argv)
             ("output,o", po::value<std::string>(), "Output file")
             ("cpu_num,c", po::value<int>()->default_value(4), "Target CPUs number")
             ("devs_num,e", po::value<int>()->default_value(5), "Target energy devices number")
-            ("version,v", po::value<std::string>()->default_value("4.2"),
+            ("version,v", po::value<std::string>()->default_value("5.0"),
              "Protocol version")
             ("type,t", po::value<std::string>()->required(),
                 "Output type(t(ext), p(y), j(son), c(sv))")
index 548609f945b63f13592e92b0fe53313b634e47b2..934c9797f76c90f6d95b82b2f5d9beaa49acf814 100644 (file)
@@ -43,6 +43,7 @@ Parser::Parser(const ParserOptions &init_data)
     const std::string v40 = "4.0";
     const std::string v41 = "4.1";
     const std::string v42 = "4.2";
+    const std::string v50 = "5.0";
     const int cpu_num = init_data.cpu_num;
     const int devs_num = init_data.devs_num;
     std::shared_ptr<DataWriter> dw = init_data.writer;
@@ -56,12 +57,15 @@ Parser::Parser(const ParserOptions &init_data)
         protocol_ = std::make_unique<Protocol41>(dw, cpu_num, devs_num, std::move(api_map));
     else if (!init_data.version.compare(v42))
         protocol_ = std::make_unique<Protocol42>(dw, cpu_num, devs_num, std::move(api_map));
+    else if (!init_data.version.compare(v50))
+        // Only the LSan report has been changed, the message format has not been changed
+        protocol_ = std::make_unique<Protocol42>(dw, cpu_num, devs_num, std::move(api_map));
     else
         throw std::logic_error((boost::format("Wrong protocol version <%1%>. \
                                                Suppotred versions are <%2%>, \
-                                               <%3%>, <%4%>, <%5%>")
+                                               <%3%>, <%4%>, <%5%>, <%6%>")
                                 % init_data.version % v30 % v40 % v41 %
-                                v42).str());
+                                v42 % v50).str());
 }
 
 void Parser::start_file() const