Page 1 of 1

Failed to use "Intel PT(Processor Trace)" with perf in Ubuntu VM

Posted: 15. Dec 2016, 09:13
by hapytrefrend
Failed to use "Intel PT(Processor Trace)" with perf in Ubuntu VM


Hello guys,

I have been trying to use "Intel PT(Processor Trace)" on Ubuntu running on Virtualbox as I did not want to mess up the server itself.
PT runs fine on the host (server) and creates perf.data as supposed to.
The command I used is

Code: Select all

perf record -e intel_pt//u ls 

Howerver, when trying on virtualbox, it was not successful.
The error message appears as below.

Code: Select all

user@user-vb:~$ perf record -e intel_pt//u ls
invalid or unsupported event: 'intel_pt//u'
Run 'perf list' for a list of valid events

Usage: perf record [<options>] [<command>] or: perf record [<options>] -- <command> [<options>]
-e, --event <event>   event selector. use 'perf list' to list available events

Has anyone been able to initialise "Intel PT" in Ubuntu running on VirtualBox?
Is there anyway to utilise this function or am I doing something wrong?
Any comments or ideas are welcome !!


Thank you so much in advance
Have a great Christmas

-hapytrefrend

Re: Failed to use "Intel PT(Processor Trace)" with perf in Ubuntu VM

Posted: 15. Dec 2016, 09:51
by socratis
I'm not sure but I have the feeling that the command line option is not correct and the program tells you about it:
invalid or unsupported event: 'intel_pt//u'
Run 'perf list' for a list of valid events
Did you follow that advice? What is the list of valid events?

BTW, are you trying to measure performance counters on a VM? Not a great idea, It's going to be widely inaccurate.

Re: Failed to use "Intel PT(Processor Trace)" with perf in Ubuntu VM

Posted: 15. Dec 2016, 10:36
by hapytrefrend
Yes we did,
The valid list is as below.

Code: Select all

perf list
List of pre-defined events (to be used in -e):

  alignment-faults                                   [Software event]
  bpf-output                                         [Software event]
  context-switches OR cs                             [Software event]
  cpu-clock                                          [Software event]
  cpu-migrations OR migrations                       [Software event]
  dummy                                              [Software event]
  emulation-faults                                   [Software event]
  major-faults                                       [Software event]
  minor-faults                                       [Software event]
  page-faults OR faults                              [Software event]
  task-clock                                         [Software event]

  msr/smi/                                           [Kernel PMU event]
  msr/tsc/                                           [Kernel PMU event]

  rNNN                                               [Raw hardware event descriptor]
  cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware event descriptor]
   (see 'man perf-list' on how to encode it)

  mem:<addr>[/len][:access]                          [Hardware breakpoint]
As you can see, there is not "Kernel PMU event - intel_pt//" which can be found on the server as below.

Code: Select all

intel_bts//                                        [Kernel PMU event]
intel_pt//                                         [Kernel PMU event]
And to answer your second question,
I am trying to use "intel_pt//" so that when recording traces, I will be able to record more than just "system calls".
(my understanding is that if you only use "pref" to trace, it will be recording just "system calls")

Thank you !

Re: Failed to use "Intel PT(Processor Trace)" with perf in Ubuntu VM

Posted: 15. Dec 2016, 12:10
by socratis
  1. Are the two 'perf' versions the same?
  2. Why do you expect an option in one to exist in the other?
  3. I just installed 'perf version 3.13.9' on an Ubuntu VM and I get a different output from yours:

    Code: Select all

    socratis@VB-Mint ~ $ perf list
    
    List of pre-defined events (to be used in -e):
      cpu-clock                                          [Software event]
      task-clock                                         [Software event]
      page-faults OR faults                              [Software event]
      context-switches OR cs                             [Software event]
      cpu-migrations OR migrations                       [Software event]
      minor-faults                                       [Software event]
      major-faults                                       [Software event]
      alignment-faults                                   [Software event]
      emulation-faults                                   [Software event]
      dummy                                              [Software event]
    
      uncore_cbox_0/clockticks/                          [Kernel PMU event]
      uncore_cbox_1/clockticks/                          [Kernel PMU event]
    
      rNNN                                               [Raw hardware event descriptor]
      cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware event descriptor]
       (see 'man perf-list' on how to encode it)
    
      mem:<addr>[:access]                                [Hardware breakpoint]
    
    For example I don't have the "bfr-output" and our "Kernel PMU event" category is different.
  4. Unless the 'perf' command adapts to what's available on the VM. For example, in a VM, there is no VT-x. In that case there's nothing you can do.
  5. I still don't see why this is a VirtualBox issue, unless it has to do with the previous point.