1. 20 Dec, 2011 2 commits
    • Andrew Vagin's avatar
      perf record: Add ability to record event period · 3e76ac78
      Andrew Vagin authored
      The problem is that when SAMPLE_PERIOD is not set, the kernel generates
      a number of samples in proportion to an event's period. Number of these
      samples may be too big and the kernel throttles all samples above a
      defined limit.
      
      E.g.: I want to trace when a process sleeps. I created a process which
      sleeps for 1ms and for 4ms.  perf got 100 events in both cases.
      
      swapper 0 [000] 1141.371830: sched_stat_sleep: comm=foo pid=1801 delay=1386750 [ns]
      swapper 0 [000] 1141.369444: sched_stat_sleep: comm=foo pid=1801 delay=4499585 [ns]
      
      In the first case a kernel want to send 4499585 events and in the second
      case it wants to send 1386750 events.  perf-reports shows that process
      sleeps in both places equal time.
      
      Instead of this we can get only one sample with an attribute period. As
      result we have less data transferring between kernel and user-space and
      we avoid throttling of samples.
      
      The patch "events: Don't divide events if it has field period" added a
      kernel part of this functionality.
      Acked-by: default avatarArun Sharma <asharma@fb.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: devel@openvz.org
      Link: http://lkml.kernel.org/r/1324391565-1369947-1-git-send-email-avagin@openvz.orgSigned-off-by: default avatarAndrew Vagin <avagin@openvz.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3e76ac78
    • Ingo Molnar's avatar
      Merge branch 'for-tip' of... · 124ba940
      Ingo Molnar authored
      Merge branch 'for-tip' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile into perf/core
      124ba940
  2. 12 Dec, 2011 3 commits
  3. 07 Dec, 2011 2 commits
    • Andreas Krebbel's avatar
      oprofile, s390: Add event interface to the System z hardware sampling module · dd3c4670
      Andreas Krebbel authored
      With this patch the OProfile Basic Mode Sampling support for System z
      is enhanced with a counter file system.  That way hardware sampling
      can be configured using the user space tools with only little
      modifications.
      
      With the patch by default new cpu_types (s390/z10, s390/z196) are
      returned in order to indicate that we are running a CPU which provides
      the hardware sampling facility.  Existing user space tools will
      complain about an unknown cpu type. In order to be compatible with
      existing user space tools the `cpu_type' module parameter has been
      added.  Setting the parameter to `timer' will force the module to
      return `timer' as cpu_type.  The module will still try to use hardware
      sampling if available and the hwsampling virtual filesystem will be
      also be available for configuration.  So this has a different effect
      than using the generic oprofile module parameter `timer=1'.
      
      If the basic mode sampling is enabled on the machine and the
      cpu_type=timer parameter is not used the kernel module will provide
      the following virtual filesystem:
      
      /dev/oprofile/0/enabled
      /dev/oprofile/0/event
      /dev/oprofile/0/count
      /dev/oprofile/0/unit_mask
      /dev/oprofile/0/kernel
      /dev/oprofile/0/user
      
      In the counter file system only the values of 'enabled', 'count',
      'kernel', and 'user' are evaluated by the kernel module. Everything
      else must contain fixed values.
      
      The 'event' value only supports a single event - HWSAMPLING with value
      0.
      
      The 'count' value specifies the hardware sampling rate as it is passed
      to the CPU measurement facility.
      
      The 'kernel' and 'user' flags can now be used to filter for samples
      when using hardware sampling.
      
      Additionally also the following file will be created:
      /dev/oprofile/timer/enabled
      
      This will always be the inverted value of /dev/oprofile/0/enabled. 0
      is not accepted without hardware sampling.
      Signed-off-by: default avatarAndreas Krebbel <krebbel@linux.vnet.ibm.com>
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      dd3c4670
    • Robert Richter's avatar
      oprofile: Fix oprofile_timer_exit() breakage · f8c85203
      Robert Richter authored
      Removing remainings of oprofile_timer_exit() completly.
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      f8c85203
  4. 06 Dec, 2011 14 commits
  5. 05 Dec, 2011 17 commits
  6. 02 Dec, 2011 2 commits
    • Arnaldo Carvalho de Melo's avatar
      perf test: Soft errors shouldn't stop the "Validate PERF_RECORD_" test · f71c49e5
      Arnaldo Carvalho de Melo authored
      For errors that don't preclude checking for further errors, aka "soft"
      errors, just  continue testing for other errors.
      
      Better coverage in verbose mode.
      Suggested-by: default avatarDavid Ahern <dsahern@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-jafcokbj26m845dsgm2hx6az@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f71c49e5
    • Arnaldo Carvalho de Melo's avatar
      perf test: Validate PERF_RECORD_ events and perf_sample fields · 3e7c439a
      Arnaldo Carvalho de Melo authored
      This new test will validate these new routines extracted from 'perf
      record':
      
       - perf_evlist__config_attrs
       - perf_evlist__prepare_workload
       - perf_evlist__start_workload
      
      In addition to several other perf_evlist methods.
      
      It consists of starting a simple workload, setting up just one event to
      monitor ("cycles") requesting that several PERF_SAMPLE_ fields be
      present in all events.
      
      It then will check that the expected PERF_RECORD_ events are produced
      and will sanity check all its fields.
      
      Some checks performed:
      
      . PERF_SAMPLE_TIME monotonically increases.
      
      . PERF_SAMPLE_CPU is the one requested with sched_setaffinity
      
      . PERF_SAMPLE_TID and PERF_SAMPLE_PID matches the one we forked
        in perf_evlist__prepare_workload and that is stored in
        evlist->workload.pid
      
      . For the events where these fields are also present in its
        pre-sample_id_all fields (e.g. event->mmap.pid), that they are what
        is expected too.
      
      . That we get a bunch of mmaps:
      
        PATH/libcSUFFIX
        PATH/ldSUFFIX
        [vdso]
        PATH/sleep
      
      Example:
      
        [root@emilia ~]# taskset -c 3,4 perf test -v1 perf_sample
         6: Validate PERF_RECORD_* events & perf_sample fields:
        --- start ---
        7159480799825 3 PERF_RECORD_SAMPLE
        7159480805584 3 PERF_RECORD_SAMPLE
        7159480807814 3 PERF_RECORD_SAMPLE
        7159480810430 3 PERF_RECORD_SAMPLE
        7159480861511 3 PERF_RECORD_MMAP 8086/8086: [0x7fffffffd000(0x2000) @ 0x7fffffffd000]: //anon
        7159481052516 3 PERF_RECORD_COMM: sleep:8086
        7159481070188 3 PERF_RECORD_MMAP 8086/8086: [0x400000(0x6000) @ 0]: /bin/sleep
        7159481077104 3 PERF_RECORD_MMAP 8086/8086: [0x3d06400000(0x221000) @ 0]: /lib64/ld-2.12.so
        7159481092912 3 PERF_RECORD_MMAP 8086/8086: [0x7fff1adff000(0x1000) @ 0x7fff1adff000]: [vdso]
        7159481196779 3 PERF_RECORD_MMAP 8086/8086: [0x3d06800000(0x37f000) @ 0]: /lib64/libc-2.12.so
        7160481558435 3 PERF_RECORD_EXIT(8086:8086):(8086:8086)
        ---- end ----
        Validate PERF_RECORD_* events & perf_sample fields: Ok
        [root@emilia ~]#
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-svag18v2z4idas0dyz3umjpq@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3e7c439a