3 Replies Latest reply on Oct 14, 2009 12:27 PM by pdrongowski

    Exporting CodeAnalyst data from the command line

    MeMo_oMeM
      is it possible?

      Hi,

      There are hundreds (maybe thousands) of objects in the code I am analyzing, so I would like to automate the profiling process. For this purpose, I wrote a script that parses the CSV files exported by the CodeAnalyst GUI to derive the information I am looking for. However this script is useless unless I can find a way to export CodeAnalyst data that does not involve clicking on object names one by one to export them.

      I can run the profiler from the command line (using opcontrol) but I could not find a way to generate CSV from the command line, I eventually have to import it into the GUI. The generated data, which is dumped under /var/lib/oprofile, is not human readable.

      My question is, is there a way to generate a CSV for each different object from the command line? It would be very useful if the GUI provided a way to export data for *all* objects in separate CSV's, instead of clicking on them one by one to export, such as "export all" (?)

      Please tell me if my question is not clear. I will try to clarify with an example if needed. Thank you very much in advance!

       

       

       

        • Exporting CodeAnalyst data from the command line

          MeMo_oMeM,

          Does opreport not work for you?

          Currently, there is no way from the GUI to export all the module or function (object names?) data at one time.

            • Exporting CodeAnalyst data from the command line
              MeMo_oMeM

               

              Does opreport not work for you?


              Now, it does I figured that when I run experiments from the GUI, opreport (and similarly opannotate) gives an error while reporting results. When I start experiments from the command line, then I can use these tools and get the results stacked in one text file, which is great.

              I have a question regarding the command line opcontrol tough: I could not find a way to run experiments during the entire code run, i.e., by *not* limiting the number of samples. I just bypass this issue by putting a ridiculously large number as the limit, which is ugly and risky. Is there a way to say "no limit" in command line, similar to the "Profile the duration of the app execution" checkbox in GUI?

              Thanks for your reply!

               

                • Exporting CodeAnalyst data from the command line
                  pdrongowski

                  Hi MeMo_oMeM --

                  It's possible that I don't understand your usage model, but it sounds like you want to collect data during the entire run of an application.

                  When I do this for an app using the command line, I usually create a shell script that:

                      1. Sets up the oprofile configuration (events, etc.)

                      2. Starts the oprofile data collection daemon.

                      3. Starts the application.

                      4. Stops the oprofile data collection daemon.

                  Steps 1, 2, and 4 all use opcontrol (with some combination of options!) The oprofile daemon collects data on a system-wide basis, so you could even run multiple apps/processes in step 3 and all of them will be profiled.

                  Hope this helps -- pj