1. 18 Jan, 2017 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-4.11-20170117' of... · 9f6f941e
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-4.11-20170117' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      New features:
      
       - Account thread wait time (off CPU time) separately: sleep, iowait and
         preempt, based on the prev_state of the last event, show the breakdown
         when using "perf sched timehist --state" (Namhyumg Kim)
      
      Infrastructure changes:
      
       - Factor out PMU scale conversion code (Andi Kleen)
      
       - Remove unnecessary feature-dwarf warning (David Carrillo-Cisneros)
      
       - Add missing member name in OPT_() macros (Soramichi AKIYAMA)
      
       - Move variables referenced in libperf.a object files from perf's main()
         file, so that other tools can use libperf.a with a different main()
         (Soramichi AKIYAMA)
      
      Documentation changes:
      
       - Fix 'perf script' man page about --dump-raw-trace option (Michael Petlan)
      
       - Also allow forcing reading of non-root owned files by root in 'perf
         script' (Yannick Brosseau)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9f6f941e
  2. 17 Jan, 2017 5 commits
  3. 16 Jan, 2017 5 commits
  4. 14 Jan, 2017 1 commit
    • Masami Hiramatsu's avatar
      kprobes, extable: Identify kprobes trampolines as kernel text area · 5b485629
      Masami Hiramatsu authored
      Improve __kernel_text_address()/kernel_text_address() to return
      true if the given address is on a kprobe's instruction slot
      trampoline.
      
      This can help stacktraces to determine the address is on a
      text area or not.
      
      To implement this atomically in is_kprobe_*_slot(), also change
      the insn_cache page list to an RCU list.
      
      This changes timings a bit (it delays page freeing to the RCU garbage
      collection phase), but none of that is in the hot path.
      
      Note: this change can add small overhead to stack unwinders because
      it adds 2 additional checks to __kernel_text_address(). However, the
      impact should be very small, because kprobe_insn_pages list has 1 entry
      per 256 probes(on x86, on arm/arm64 it will be 1024 probes),
      and kprobe_optinsn_pages has 1 entry per 32 probes(on x86).
      In most use cases, the number of kprobe events may be less
      than 20, which means that is_kprobe_*_slot() will check just one entry.
      Tested-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andrey Konovalov <andreyknvl@google.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/148388747896.6869.6354262871751682264.stgit@devbox
      [ Improved the changelog and coding style. ]
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5b485629
  5. 12 Jan, 2017 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-4.11-20170111' of... · f913f3a6
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-4.11-20170111' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      New features:
      
      - Add more triggers to switch the output file (perf.data.TIMESTAMP).
      
        Now, in addition to switching to a different output file when
        receiving a SIGUSR2, one can also specify file size and time based
        triggers:
      
             perf record -a --switch-output=signal
      
        is equivalent to what we had before:
      
             perf record -a --switch-output
      
        While we can also ask for the file to be "sliced" by size, taking
        into account that that will happen only when we get woken up by
        the kernel, i.e. one has to take into account the --mmap-pages (the
        size of the perf mmap ring buffer):
      
             perf record -a --switch-output=2G
      
        will break the perf.data output into multiple files limited to 2GB
        of samples, right when generating the output.
      
        For time based samples, alert() will be used, so to have 1 minute
        limited perf.data output files:
      
            perf record -a --switch-output=1m
      
        (Jiri Olsa)
      
      - Remove the need to use -e only for syscalls and --event only for
        tracepoints/HW/SW/etc events, i.e. now one can use:
      
            perf trace -e nanosleep,futex,sched:sched_switch ./workload
      
        or:
      
            perf trace --event nanosleep,futex,sched:sched_switch ./workload
      
        And have it tracing raw_syscalls:sys_{enter,exit} for the nanosleep
        and futex syscalls, formatting those as strace does while also
        tracing sched:sched_switch, ordering it all into one strace like
        output.
      
        Using '!' as the first character in the -e/--event argument remains
        a way to negate the list of syscalls, i.e. all syscalls except for
        the ones specified, doesn't affect the other kinds of events.
      
        E.g:
      
        [root@jouet ~] # perf trace -e sched:sched_switch,nanosleep usleep 1
           0.000 ( 0.028 ms): usleep/28150 nanosleep(rqtp: 0x7ffe4201b9f0) ...
           0.028 (         ): sched:sched_switch:usleep:28150 [120] S ==> swapper/0:0 [120])
           0.000 ( 0.065 ms): usleep/28150  ... [continued]: nanosleep()) = 0
        [root@jouet ~]#
      
        (Arnaldo Carvalho de Melo)
      
      - 'perf kallsyms' toy tool to look for extended symbol information on
        the running kernel and demonstrate the machine/thread/symbol APIs for
        use in other tools, such as 'perf probe' (Arnaldo Carvalho de Melo)
      
      Infrastructure improvements:
      
      - Add missing linux/kernel.h include to subcmd.h (Arnaldo Carvalho de Melo)
        tools: Sync x86's vmx.h with the kernel
      
      - Create libdir directory before installing libperf-jvmti.so (Laura Abbott)
      
      - Fix typo in perf_evlist__start_workload() (Soramichi Akiyama)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f913f3a6
  6. 11 Jan, 2017 15 commits
  7. 05 Jan, 2017 2 commits
    • David Carrillo-Cisneros's avatar
      perf/x86: Set pmu->module in Intel PMU modules · 74545f63
      David Carrillo-Cisneros authored
      The conversion of Intel PMU drivers into modules did not include reference
      counting. The machine will crash when attempting to  access deleted code
      if an event from a module PMU is started and the module removed before the
      event is destroyed.
      
      i.e. this crashes the machine:
      
      	$ insmod intel-rapl-perf.ko
      	$ perf stat -e power/energy-cores/ -C 0 &
      	$ rmmod intel-rapl-perf.ko
      
      Set THIS_MODULE to pmu->module in Intel module PMUs so that generic code
      can handle reference counting and deny rmmod while an event still exists.
      Signed-off-by: default avatarDavid Carrillo-Cisneros <davidcc@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1482455860-116269-1-git-send-email-davidcc@google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      74545f63
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo-4.10-20170104' of... · 4e06d4f0
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo-4.10-20170104' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes and one improvement from Arnaldo Carvalho de Melo:
      
      Fixes:
      
        - Fix prev/next_prio formatting for deadline tasks in libtraceevent (Daniel Bristot de Oliveira)
      
        - Robustify reading of build-ids from /sys/kernel/note (Arnaldo Carvalho de Melo)
      
        - Fix building some sample/bpf in Alpine Linux 3.4 (Arnaldo Carvalho de Melo)
      
        - Fix 'make install-bin' to install libtraceevent plugins (Arnaldo Carvalho de Melo)
      
        - Fix 'perf record --switch-output' documentation and comment (Jiri Olsa)
      
        - Fix 'perf probe' for cross arch probing (Masami Hiramatsu)
      
      Improvement:
      
        - Show total scheduling time in 'perf sched timehist' (Namhyumg Kim)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4e06d4f0
  8. 04 Jan, 2017 2 commits
  9. 03 Jan, 2017 6 commits
  10. 02 Jan, 2017 1 commit
    • Masami Hiramatsu's avatar
      perf probe: Fix to get correct modname from elf header · 1f2ed153
      Masami Hiramatsu authored
      Since 'perf probe' supports cross-arch probes, it is possible to analyze
      different arch kernel image which has different bits-per-long.
      
      In that case, it fails to get the module name because it uses the
      MOD_NAME_OFFSET macro based on the host machine bits-per-long, instead
      of the target arch bits-per-long.
      
      This fixes above issue by changing modname-offset based on the target
      archs bit width. This is ok because linux kernel uses LP64 model on
      64bit arch.
      
      E.g. without this (on x86_64, and target module is arm32):
      
        $ perf probe -m build-arm/fs/configfs/configfs.ko -D configfs_lookup
        p:probe/configfs_lookup :configfs_lookup+0
                                ^-Here is an empty module name.
      
      With this fix, you can see correct module name:
      
        $ perf probe -m build-arm/fs/configfs/configfs.ko -D configfs_lookup
        p:probe/configfs_lookup configfs:configfs_lookup+0
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/148337043836.6752.383495516397005695.stgit@devboxSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1f2ed153
  11. 01 Jan, 2017 1 commit