Add the command line flags for CTF conversion to the nexdump utility
authorChristian Babeux <christian.babeux@efficios.com>
Mon, 30 Sep 2013 21:00:48 +0000 (17:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 13 Dec 2013 21:45:05 +0000 (16:45 -0500)
The nexdump utility now accepts the --ctf <outdir> command line switch
to convert the specified Nexus trace to the Common Trace Format (CTF) in
outdir.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
converter/nexus/Application.cpp
converter/nexus/Application.h
converter/nexus/main.cpp

index d5c31157622517935fc04d232ac47cfda966d0e1..8b476965b99ebeecb15dc093b0e26adb2c3cfedb 100644 (file)
@@ -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)
 {
index 7237b76a5c9c491859e5f15324bd0e47e4234d51..f21eb0588ff15e214985c71738601078edebbdf5 100644 (file)
@@ -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
index 062c53d8054eabab3e4932ac769c0a35750c0811..d864931724378fb3cca1725bd50cb520df099abc 100644 (file)
@@ -49,6 +49,9 @@ void helpOption()
        cout
                << "  --summary                    Display a summary of message count information"
                << endl;
+       cout
+               << "  --ctf <outdir>               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();
This page took 0.02636 seconds and 4 git commands to generate.