8 Replies Latest reply: Sep 4, 2014 4:20 PM by jorensan RSS

Streamline Functions/Code view

divcesar Bit

In the DS-5 Streamline (Professional 5.19.0) how can I change the "counter" that was used to calculate the number of samples (column Self) in the Functions/Code view?

 

Consider the scenario where I've profiled an application using several counters (e.g: clock cycles, branch instructions, cache behavior, etc). Is it possible to visualize (in call paths / functions / code / etc) the number of samples collected only for a subset of these events (e.g. clock cycles)?

 

2014-08-12-211926_1920x1080_scrot.png

 

Thank you,

  • Re: Streamline Functions/Code view
    divcesar Bit

    Anyone?

  • Re: Streamline Functions/Code view
    Ronan Synnott Employee

    I don't believe it's possible today, however I'll mention it to the Streamline development team for a future version.

    • Re: Streamline Functions/Code view
      jorensan Employee

      Actually, there is the feature "event-based sampling" that does exactly this: see the Event-Based Sampling section of http://ds.arm.com/ds-5/optimize/streamline-features/.

       

      You can use the bullseye icon to select a CPU counter for event-based sampling, and then type the threshold for how many counts need to happen before there is a sample. Then the report will show samples for that counter in the functions/code/call paths view.

       

      I think that this feature requires some software infrastructure (interrupts must be "routed" in Linux). I suggest you give it a try. If it doesn't work, have a chat with technical support.

      • Re: Streamline Functions/Code view
        divcesar Bit

        Hello Javier. Thank you for your answer. However, I believe there is some misunderstanding here. What I asked for was if there is a way of choosing different *subsets* of counters to filter the number of samples in the Table Report Views (i.e. functions/code/etc view).

         

        Put it in another way. Consider that the target program takes some time to finish and/or that I want to observe the behavior of *several* counters for the exact same execution of the program, so I would configure the capture session with all relevant events at once. For instance, lets say that I am interested in monitoring events A, B, C, D and E. So I would configure and start a capture session to monitor all these events (be it using EBS or TBS). After the collection finishes I want to see the number of samples of each event alone (only A, or B, or C, etc) or in subsets of related events (eg: A+B or B+D, etc.)

         

        Thank you,

        • Re: Streamline Functions/Code view
          jorensan Employee

          Doh! Then Ronan is right, we don't support that .

           

          The format of the data files generated by our gator agent only has one set of samples, instead of one set of samples per counter with multiple counters. What you are asking for would imply a redesign of the data file format and might have a performance impact, so it doesn't feel like something we can do quickly. I'll share the feedback with the Streamline team, though...

           

          If you could add to this entry some input on why this is important to you, use cases etc, it will be useful to increase the priority of the requirement. For the time being the only workaround I can suggest is running multiple captures, each with one different counter for EBS. Thanks for posting the requirement.

          • Re: Streamline Functions/Code view
            divcesar Bit

            Hello Javier, sorry for my late answer.

             

            The use case is like I posted above.

             

            Consider that the target program takes some time to finish and/or that I want to observe the behavior of *several* counters for the exact same execution of the program, so I would configure the capture session with all relevant events at once. For instance, lets say that I am interested in monitoring events A, B, C, D and E. So I would configure and start a capture session to monitor all these events (be it using EBS or TBS). After the collection finishes I want to see the number of samples of each event alone (only A, or B, or C, etc) or in subsets of related events (eg: A+B or B+D, etc.)

             

            Beside that, I'm just comfortably with this feature on VTune Profiler.

             

            I've done what you suggested (even with EBS) and I've a new question. I profiled the application with only the event "Clock Cycles" enabled and again I went to see the number of samples per function. First thing to note is that the "event" CPU Activity cannot be disabled, at least I did not find anything to do so. Beside that, now I just would like to know how was the number of samples calculated - I used a threshold of 10k. I've attached a printscreen of the reports. Can you help me to understand this?

             

            Timeline.png

            Functions.png

            • Re: Streamline Functions/Code view
              jorensan Employee

              Hi again, this time it's my turn to apologise for the late answer. I was on holiday for the last 2.5 weeks.

               

              The Threshold Value of 10K means that a sample is taken every time the "clocks cycle counter" reaches 10K, or every 10,000 clock cycles. At this point the CPU is interrupted, gator takes control and samples the value of the PC and unwinds the call stack (if you have enabled that setting). This information is then used to generate the Functions, Code and Call Paths tables (that's the number of samples displayed). The Threshold Value setting enables you to manually trade in data accuracy with overhead.

               

              Note that the counter values displayed in the Timeline view are read at context switches, not at "sampling time", so the x axis still shows time and the counter values are accurate. The filtering over time using the callipers also works.

               

              The CPU Activity counter is always generated because it is worked out by the tool from the context switch information without incurring extra overhead on the target (i.e. the overhead of reading a hardware counter at the context switch). However, I also see that you cannot hide in the report (unlike other counters). I'll pass the feedback to engineering to see if they can make it removable.

               

              Cheers, Javier

    • Re: Streamline Functions/Code view
      divcesar Bit

      Hello Ronan.

       

      Thank you for the note.