From: Christian Babeux Date: Mon, 30 Sep 2013 21:00:48 +0000 (-0400) Subject: Add the command line flags for CTF conversion to the nexdump utility X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=50841f9eef0cd9187430b0c0e32aca2cc0f84372;p=babeltrace.git Add the command line flags for CTF conversion to the nexdump utility The nexdump utility now accepts the --ctf command line switch to convert the specified Nexus trace to the Common Trace Format (CTF) in outdir. Signed-off-by: Christian Babeux Signed-off-by: Jérémie Galarneau --- diff --git a/converter/nexus/Application.cpp b/converter/nexus/Application.cpp index d5c31157..8b476965 100644 --- a/converter/nexus/Application.cpp +++ b/converter/nexus/Application.cpp @@ -66,6 +66,14 @@ void Application::enableFmanLog() visitors_.push_back(v); } +// Enable the Common Trace Format (CTF) converter for the Application +void Application::enableCTFLog(const string &outdir) +{ + // TODO + //NxMessageVisitor* v = new CTFLogVisitor(outdir); + //visitors_.push_back(v); +} + // Main application entry bool Application::process(const string & fn) { diff --git a/converter/nexus/Application.h b/converter/nexus/Application.h index 7237b76a..f21eb058 100644 --- a/converter/nexus/Application.h +++ b/converter/nexus/Application.h @@ -76,6 +76,12 @@ public: */ void enableFmanLog(); + /*! + @abstract Enable the Common Trace Format (CTF) converter for the Application + @param outdir output directory for the CTF traces + */ + void enableCTFLog(const string &outdir); + /*! @abstract Open the named file and process the Nexus data @param fn filename containing data diff --git a/converter/nexus/main.cpp b/converter/nexus/main.cpp index 062c53d8..d8649317 100644 --- a/converter/nexus/main.cpp +++ b/converter/nexus/main.cpp @@ -49,6 +49,9 @@ void helpOption() cout << " --summary Display a summary of message count information" << endl; + cout + << " --ctf Convert the trace to the Common Trace Format (CTF) in outdir" + << endl; } void versionOption() @@ -62,6 +65,8 @@ int main(int argc, char * const argv[]) Application app; string in_filename; + string ctf_outdir; + bool process_ctf_outdir = false; // process the options for (int i = 1; i < argc; i++) { @@ -87,6 +92,14 @@ int main(int argc, char * const argv[]) } else if (argStr.find("--fmlog") == 0) { app.enableFmanLog(); + } else if (argStr.find("--ctf") == 0) { + process_ctf_outdir = true; + + } else if (process_ctf_outdir) { + ctf_outdir = argStr; + app.enableCTFLog(ctf_outdir); + process_ctf_outdir = false; + } else if (in_filename.empty()) { // treat as the filename in_filename = argStr; @@ -98,6 +111,12 @@ int main(int argc, char * const argv[]) } } + // no ctf output path specified + if (process_ctf_outdir && ctf_outdir.empty()) { + helpOption(); + return -1; + } + // check if filename not found if (in_filename.empty()) { helpOption();