1. 17 Jan, 2018 13 commits
  2. 12 Jan, 2018 6 commits
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Fix setting of --call-graph/--max-stack for non-syscall events · 08e26396
      Arnaldo Carvalho de Melo authored
      The raw_syscalls:sys_{enter,exit} were first supported in 'perf trace',
      together with minor and major page faults, then we supported
      --call-graph, then --max-stack, but when the other tracepoints got
      supported, and bpf, etc, I forgot to make those global call-graph
      settings apply to them.
      
      Fix it by realizing that the global --max-stack and --call-graph
      settings are done via:
      
              OPT_CALLBACK(0, "call-graph", &trace.opts,
                           "record_mode[,record_size]", record_callchain_help,
                           &record_parse_callchain_opt),
      
      And then, when we go to parse the events in -e via:
      
              OPT_CALLBACK('e', "event", &trace, "event",
                           "event/syscall selector. use 'perf list' to list available events",
                           trace__parse_events_option),
      
      And trace__parse_sevents_option() calls:
      
                      struct option o = OPT_CALLBACK('e', "event", &trace->evlist, "event",
                                                     "event selector. use 'perf list' to list available events",
                                                     parse_events_option);
                      err = parse_events_option(&o, lists[0], 0);
      
      parse_events_option() will override the global --call-graph and
      --max-stack if the "call-graph" and/or "max-stack" terms are in the
      event definition, such as in the probe_libc:inet_pton event in one of the
      examples below (-e probe_libc:inet_pton/max-stack=2).
      
      Before:
      
        # perf trace --mmap 1024 --call-graph dwarf -e sendto,probe_libc:inet_pton ping -6 -c 1 ::1
             1.525 (         ): probe_libc:inet_pton:(7f77f3ac9350))
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.071 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.071/0.071/0.071/0.000 ms
             1.677 ( 0.081 ms): ping/31296 sendto(fd: 3, buff: 0x55681b652720, len: 64, addr: 0x55681b650640, addr_len: 28) = 64
                                               __libc_sendto (/usr/lib64/libc-2.26.so)
                                               [0xffffaa97e4bc9cef] (/usr/bin/ping)
                                               [0xffffaa97e4bc656d] (/usr/bin/ping)
                                               [0xffffaa97e4bc7d0a] (/usr/bin/ping)
                                               [0xffffaa97e4bca447] (/usr/bin/ping)
                                               [0xffffaa97e4bc2f91] (/usr/bin/ping)
                                               __libc_start_main (/usr/lib64/libc-2.26.so)
                                               [0xffffaa97e4bc3379] (/usr/bin/ping)
        #
      
      After:
      
        # perf trace --mmap 1024 --call-graph dwarf -e sendto,probe_libc:inet_pton ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.089 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.089/0.089/0.089/0.000 ms
             1.955 (         ): probe_libc:inet_pton:(7f383a311350))
                                               __inet_pton (inlined)
                                               gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so)
                                               __GI_getaddrinfo (inlined)
                                               [0xffffaa5d91444f3f] (/usr/bin/ping)
                                               __libc_start_main (/usr/lib64/libc-2.26.so)
                                               [0xffffaa5d91445379] (/usr/bin/ping)
             2.140 ( 0.101 ms): ping/32047 sendto(fd: 3, buff: 0x55a26edd0720, len: 64, addr: 0x55a26edce640, addr_len: 28) = 64
                                               __libc_sendto (/usr/lib64/libc-2.26.so)
                                               [0xffffaa5d9144bcef] (/usr/bin/ping)
                                               [0xffffaa5d9144856d] (/usr/bin/ping)
                                               [0xffffaa5d91449d0a] (/usr/bin/ping)
                                               [0xffffaa5d9144c447] (/usr/bin/ping)
                                               [0xffffaa5d91444f91] (/usr/bin/ping)
                                               __libc_start_main (/usr/lib64/libc-2.26.so)
                                               [0xffffaa5d91445379] (/usr/bin/ping)
        #
      
      Same thing for --max-stack, the global one:
      
        # perf trace --max-stack 3 -e sendto,probe_libc:inet_pton ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.097 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.097/0.097/0.097/0.000 ms
             1.577 (         ): probe_libc:inet_pton:(7f32f3957350))
                                               __inet_pton (inlined)
                                               gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so)
                                               __GI_getaddrinfo (inlined)
             1.738 ( 0.108 ms): ping/32103 sendto(fd: 3, buff: 0x55c3132d7720, len: 64, addr: 0x55c3132d5640, addr_len: 28) = 64
                                               __libc_sendto (/usr/lib64/libc-2.26.so)
                                               [0xffffaa3cecf44cef] (/usr/bin/ping)
                                               [0xffffaa3cecf4156d] (/usr/bin/ping)
        #
      
      And then setting up a global setting (dwarf, max-stack=4), that will
      affect the raw_syscall:sys_enter for the 'sendto' syscall and that will
      be overriden in the probe_libc:inet_pton call to just one entry.
      
        # perf trace --max-stack=4 --call-graph dwarf -e sendto -e probe_libc:inet_pton/max-stack=1/ ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.090 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.090/0.090/0.090/0.000 ms
             2.140 (         ): probe_libc:inet_pton:(7f9fe9337350))
                                               __GI___inet_pton (/usr/lib64/libc-2.26.so)
             2.283 ( 0.103 ms): ping/31804 sendto(fd: 3, buff: 0x55c7f3e19720, len: 64, addr: 0x55c7f3e17640, addr_len: 28) = 64
                                               __libc_sendto (/usr/lib64/libc-2.26.so)
                                               [0xffffaa380c402cef] (/usr/bin/ping)
                                               [0xffffaa380c3ff56d] (/usr/bin/ping)
                                               [0xffffaa380c400d0a] (/usr/bin/ping)
        #
      
      Install iputils-debuginfo to get those /usr/bin/ping addresses resolved,
      those routines are not on its .dymsym nor .symtab :-)
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrick Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-qgl2gse8elhh9zztw4ajopg3@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      08e26396
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Check if callchain is enabled before setting it up · 1688c2fd
      Arnaldo Carvalho de Melo authored
      The construct:
      
      	if (callchain_param)
      		perf_evsel__config_callchain(evsel, opts, &callchain_param);
      
      happens in several places, so make perf_evsel__config_callchain() work
      just like free(NULL), do nothing if param->enabled is not set.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrick Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-ykk0qzxnxwx3o611ctjnmxav@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1688c2fd
    • Jiri Olsa's avatar
      perf tools: Fix copyfile_offset update of output offset · fa1195cc
      Jiri Olsa authored
      We need to increase output offset in each iteration, not decrease it as
      we currently do.
      
      I guess we were lucky to finish in most cases in first iteration, so the
      bug never showed. However it shows a lot when working with big (~4GB)
      size data.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Fixes: 9c9f5a2f ("perf tools: Introduce copyfile_offset() function")
      Link: http://lkml.kernel.org/r/20180109133923.25406-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fa1195cc
    • Arnaldo Carvalho de Melo's avatar
      perf trace: No need to set PERF_SAMPLE_IDENTIFIER explicitely · 236d812c
      Arnaldo Carvalho de Melo authored
      Since 75562573 ("perf tools: Add support for
      PERF_SAMPLE_IDENTIFIER") we don't need explicitely set
      PERF_SAMPLE_IDENTIFIER, as perf_evlist__config() will do this for us,
      i.e. when there are more than one evsel in an evlist, it will check if
      some evsel has a sample_type different than the one on the first evsel
      in the list, setting PERF_SAMPLE_IDENTIFIER in that case.
      
      So, to simplify 'perf trace' codebase, ditch that check.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrick Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-12xq6orhwttee2tdtu96ucrp@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      236d812c
    • Kan Liang's avatar
      perf script python: Add script to profile and resolve physical mem type · 41013f0c
      Kan Liang authored
      There could be different types of memory in the system. E.g normal
      System Memory, Persistent Memory. To understand how the workload maps to
      those memories, it's important to know the I/O statistics of them.  Perf
      can collect physical addresses, but those are raw data.  It still needs
      extra work to resolve the physical addresses.  Provide a script to
      facilitate the physical addresses resolving and I/O statistics.
      
      Profile with MEM_INST_RETIRED.ALL_LOADS or MEM_UOPS_RETIRED.ALL_LOADS
      event if any of them is available.
      
      Look up the /proc/iomem and resolve the physical address.  Provide
      memory type summary.
      
      Here is an example output:
      
        # perf script report mem-phys-addr
        Event: mem_inst_retired.all_loads:P
        Memory type                                    count   percentage
        ----------------------------------------  -----------  -----------
        System RAM                                        74        53.2%
        Persistent Memory                                 55        39.6%
        N/A
      
        ---
      
      Changes since V2:
       - Apply the new license rules.
       - Add comments for globals
      
      Changes since V1:
       - Do not mix DLA and Load Latency. Do not compare the loads and stores.
         Only profile the loads.
       - Use event name to replace the RAW event
      Signed-off-by: default avatarKan Liang <Kan.liang@intel.com>
      Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lkml.kernel.org/r/1515099595-34770-1-git-send-email-kan.liang@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      41013f0c
    • Luis de Bethencourt's avatar
      perf evlist: Remove trailing semicolon · dd8bd53a
      Luis de Bethencourt authored
      The trailing semicolon is an empty statement that does no operation.
      Removing it since it doesn't do anything.
      Signed-off-by: default avatarLuis de Bethencourt <luisbg@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180111155020.9782-1-luisbg@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dd8bd53a
  3. 11 Jan, 2018 2 commits
    • Mathieu Poirier's avatar
      perf evsel: Fix incorrect handling of type _TERM_DRV_CFG · 2178790b
      Mathieu Poirier authored
      Commit ("d0565132 perf evsel: Enable type checking for
      perf_evsel_config_term types") assumes PERF_EVSEL__CONFIG_TERM_DRV_CFG
      isn't used and as such adds a BUG_ON().
      
      Since the enumeration type is used in macro ADD_CONFIG_TERM() the change
      break CoreSight trace acquisition.
      
      This patch restores the original code.
      Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Fixes: d0565132 ("perf evsel: Enable type checking for perf_evsel_config_term types")
      Link: http://lkml.kernel.org/r/1515617211-32024-1-git-send-email-mathieu.poirier@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2178790b
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-4.16-20180110' of... · 1ccb8fed
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-4.16-20180110' 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:
      
      - The 'perf test bpf' entry hooked a eBPF proggie to the
        SyS_epoll_wait() kernel function and expected it to be hit when calling
        the epoll_wait() libc wrapper, which changed recently, in systems such
        as Fedora 27, with the glibc wrapper calling instead the epoll_pwait()
        syscall, so switch to epoll_pwait() for both the kernel and libc
        function, getting it to work both in old and new systems (Arnaldo Carvalho de Melo)
      
      - Beautify 'gettid' syscall result in 'perf trace', and in doing so
        noticed that we need to handle namespaces in 'perf trace', will be
        dealt with in follow up patches where we'll try to figure out if
        the recent support for namespace in tools/perf/ can be used for this
        purpose as well. (Arnaldo Carvalho de Melo)
      
      - Introduce 'perf report --mmaps' and 'perf report --tasks' to show
        info present in 'perf.data' (Jiri Olsa, Arnaldo Carvalho de Melo)
      
      - Synchronize kernel <-> tooling headers wrt meltdown/spectre changes
        (Arnaldo Carvalho de Melo)
      
      - Fix a wrong offset issue when using /proc/kcore (Jin Yao)
      
      - Fix bug that prevented annotating symbols in perf.data files
        generated with 'perf record --branch-any'  (Jin Yao)
      
      - Add infrastructure to record first and last sample time to the
        perf.data file header, so that when processing all samples in
        a 'perf record' session, such as when doing build-id processing,
        or when specifically requesting that that info be recorded, use
        that in 'perf report --time', that also got support for percent
        slices in addition to absolute ones.
      
        I.e. now it is possible to ask for the samples in the 10%-20%
        time slice of a perf.data file (Jin Yao)
      
      - Enable building with libbabeltrace by default (Jiri Olsa)
      
      - Display perf_event_attr::namespaces when duping the attributes
        in verbose mode (Jiri Olsa)
      
      - Allocate context task_ctx_data for child event (Jiri Olsa)
      
      - Update comments for PERF_RECORD_ITRACE_START and PERF_RECORD_MISC_* (Jiri Olsa)
      
      - Add support for showing PERF_RECORD_LOST events in 'perf script' (Jiri Olsa)
      
      - Add 'perf report --stats' option to display quick statistics about
        metadata events (PERF_RECORD_*) i.e. what we get at the end of 'perf
        report -D' (Jiri Olsa)
      
      - Fix compile error with libunwind x86 (Wang Nan)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1ccb8fed
  4. 10 Jan, 2018 7 commits
    • Arnaldo Carvalho de Melo's avatar
      tools headers: Synchronize kernel <-> tooling headers · 5d64db29
      Arnaldo Carvalho de Melo authored
      Two kernel headers got modified recently due to meltdown/spectre, in:
      
        a89f040f ("x86/cpufeatures: Add X86_BUG_CPU_INSECURE")
      
      which are used by tooling as well:
      
        arch/x86/include/asm/cpufeatures.h
        arch/x86/include/asm/disabled-features.h
      
      None of those changes have an effect on tooling, so do a plain copy.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-qqzcs8ri3vks8cypg0puk0ae@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5d64db29
    • Arnaldo Carvalho de Melo's avatar
      perf report: Introduce --mmaps · 6439d7d1
      Arnaldo Carvalho de Melo authored
      Similar to --tasks, producing the same output plus /proc/<PID>/maps
      similar lines for each mmap record present in a perf.data file.
      
      Please note that not all mmaps are stored, for instance, some of the
      non-executable mmaps are only stored when 'perf record --data' is used,
      when the user wants to resolve data accesses in addition to asking for
      executable mmaps to get the DSO with symtabs.
      
      E.g.:
      
        # perf record sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.018 MB perf.data (7 samples) ]
        [root@jouet ~]# perf report --mmaps
        #      pid      tid     ppid  comm
                 0        0       -1 |swapper
              4137     4137       -1 |sleep
                                        5628a35a1000-5628a37aa000 r-xp 00000000 3147148 /usr/bin/sleep
                                        7fb65ad51000-7fb65b134000 r-xp 00000000 3149795 /usr/lib64/libc-2.26.so
                                        7fb65b134000-7fb65b35e000 r-xp 00000000 3149715 /usr/lib64/ld-2.26.so
                                        7ffd94b9f000-7ffd94ba1000 r-xp 00000000 0 [vdso]
        #
        # perf record sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.019 MB perf.data (8 samples) ]
        # perf report --mmaps
        #      pid      tid     ppid  comm
                 0        0       -1 |swapper
              4161     4161       -1 |sleep
                                        55afae69a000-55afae8a3000 r-xp 00000000 3147148 /usr/bin/sleep
                                        7f569f00d000-7f569f3f0000 r-xp 00000000 3149795 /usr/lib64/libc-2.26.so
                                        7f569f3f0000-7f569f61a000 r-xp 00000000 3149715 /usr/lib64/ld-2.26.so
                                        7fff6fffe000-7fff70000000 r-xp 00000000 0 [vdso]
        #
        # perf record time sleep 1
        0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 2156maxresident)k
        0inputs+0outputs (0major+73minor)pagefaults 0swaps
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.019 MB perf.data (14 samples) ]
        # perf report --mmaps
        #      pid      tid     ppid  comm
                 0        0       -1 |swapper
              4281     4281       -1 |time
                                        560560dca000-560560fcf000 r-xp 00000000 3190458 /usr/bin/time
                                        7fc175196000-7fc175579000 r-xp 00000000 3149795 /usr/lib64/libc-2.26.so
                                        7fc175579000-7fc1757a3000 r-xp 00000000 3149715 /usr/lib64/ld-2.26.so
                                        7ffc924f6000-7ffc924f8000 r-xp 00000000 0 [vdso]
              4282     4282     4281 | sleep
                                         560560dca000-560560fcf000 r-xp 00000000 3190458 /usr/bin/time
                                         564b4de3c000-564b4e045000 r-xp 00000000 3147148 /usr/bin/sleep
                                         7f6a5a716000-7f6a5aaf9000 r-xp 00000000 3149795 /usr/lib64/libc-2.26.so
                                         7f6a5aaf9000-7f6a5ad23000 r-xp 00000000 3149715 /usr/lib64/ld-2.26.so
                                         7fc175196000-7fc175579000 r-xp 00000000 3149795 /usr/lib64/libc-2.26.so
                                         7fc175579000-7fc1757a3000 r-xp 00000000 3149715 /usr/lib64/ld-2.26.so
                                         7ffc924f6000-7ffc924f8000 r-xp 00000000 0 [vdso]
                                         7ffcec7e6000-7ffcec7e8000 r-xp 00000000 0 [vdso]
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-zulwdlg5rfowogr1qznorvvc@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6439d7d1
    • Jiri Olsa's avatar
      perf report: Add --tasks option to display monitored tasks · 930f8b34
      Jiri Olsa authored
      Add --tasks option to display monitored tasks stored in perf.data.
      Displaying pid/tid/ppid plus the command string aligned to distinguish
      parent and child tasks.
      
        $ perf record -a
        ...
        $ perf report --tasks
        #     pid     tid    ppid  comm
                0       0      -1 |swapper
                2       2       0 | kthreadd
            14080   14080       2 |  kworker/u17:1
                4       4       2 |  kworker/0:0H
                6       6       2 |  mm_percpu_wq
        ...
                1       1       0 | systemd
            23242   23242       1 |  firefox
            23242   23298   23242 |   Cache2 I/O
            23242   23304   23242 |   GMPThread
        ...
             1195    1195       1 |  login
             1611    1611    1195 |   bash
             1639    1639    1611 |    startx
             1663    1663    1639 |     xinit
             1673    1673    1663 |      xmonad-x86_64-l
            23939   23939    1673 |       xterm
            23941   23941   23939 |        bash
            23963   23963   23941 |         mutt
            24954   24954   23963 |          offlineimap
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180107160356.28203-13-jolsa@kernel.org
      [ Make it --tasks, plural, --task works as well, as its unambiguous ]
      [ Use machine__find_thread(), not findnew(), as pointed out by Namhyung ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      930f8b34
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Beautify 'gettid' syscall result · 2d1073de
      Arnaldo Carvalho de Melo authored
      Before:
      
        # trace -a -e gettid sleep 0.01
      <SNIP>
           4.863 ( 0.005 ms): Chrome_ChildIO/26241 gettid() = 26241
           4.931 ( 0.004 ms): Chrome_IOThrea/26154 gettid() = 26154
           4.942 ( 0.001 ms): Chrome_IOThrea/26154 gettid() = 26154
           4.946 ( 0.001 ms): Chrome_IOThrea/26154 gettid() = 26154
           4.970 ( 0.002 ms): Chrome_IOThrea/26154 gettid() = 26154
        #
      
      After:
      
        # trace -a -e gettid sleep 0.01
           0.000 ( 0.009 ms): Chrome_IOThrea/26154 gettid() = 26154 (Chrome_IOThread)
      <SNIP>
           3.416 ( 0.002 ms): Chrome_ChildIO/26241 gettid() = 26241 (Chrome_ChildIOT)
           3.424 ( 0.001 ms): Chrome_ChildIO/26241 gettid() = 26241 (Chrome_ChildIOT)
           3.343 ( 0.002 ms): chrome/26116 gettid() = 26116 (chrome)
           3.386 ( 0.002 ms): Chrome_IOThrea/26154 gettid() = 26154 (Chrome_IOThread)
           4.003 ( 0.003 ms): Chrome_ChildIO/26241 gettid() = 26241 (Chrome_ChildIOT)
           4.031 ( 0.002 ms): Chrome_IOThrea/26154 gettid() = 26154 (Chrome_IOThread)
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-kyg4gz2yy0vkrrh2vtq29u71@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2d1073de
    • Jiri Olsa's avatar
      perf report: Add --stats option to display quick data statistics · a4a4d0a7
      Jiri Olsa authored
      Add --stats option to display quick data statistics of event numbers,
      without any further processing, like the one at the end of the perf
      report -D command.
      
        $ perf report --stat
      
        Aggregated stats:
                   TOTAL events:       4566
                    MMAP events:        113
                    LOST events:         19
                    COMM events:          3
                    FORK events:        400
                  SAMPLE events:       3315
                   MMAP2 events:         32
          FINISHED_ROUND events:        681
              THREAD_MAP events:          1
                 CPU_MAP events:          1
               TIME_CONV events:          1
      
      I found this useful when hunting lost events for another change.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180107160356.28203-12-jolsa@kernel.org
      [ Rename it to --stats, plural ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a4a4d0a7
    • Jiri Olsa's avatar
      perf tools: Make the tool's warning messages optional · 075ca1eb
      Jiri Olsa authored
      I want to display the pure events status coming in the next patch and
      the tool's warnings are superfluous in the output. Making it optional,
      enabled by default.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180107160356.28203-11-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      075ca1eb
    • Jiri Olsa's avatar
      perf script: Add support to display lost events · 3d7c27b6
      Jiri Olsa authored
      Adding option to display lost events:
      
        $ perf script --show-lost-events ...
         mplayer 13810 [002] 468011.402396:        100 cycles:ppp:  ff..
         mplayer 13810 [002] 468011.402396: PERF_RECORD_LOST lost 3880
         mplayer 13810 [002] 468011.402397:        100 cycles:ppp:  ff..
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180107160356.28203-10-jolsa@kernel.org
      [ Use PRIu64 when printing u64 values, fixing the build in some arches ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3d7c27b6
  5. 08 Jan, 2018 12 commits