1. 22 1月, 2019 13 次提交
  2. 21 1月, 2019 1 次提交
  3. 10 1月, 2019 3 次提交
    • R
      tools headers powerpc: Remove unistd.h · 15c03092
      Ravi Bangoria 提交于
      We use syscall.tbl to generate system call table on powerpc.
      
      The unistd.h copy is no longer required now. Remove it.
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/20190110094936.3132-2-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      15c03092
    • R
      perf powerpc: Rework syscall table generation · 02061318
      Ravi Bangoria 提交于
      Commit aff85039 ("powerpc: add system call table generation
      support") changed how systemcall table is generated for powerpc.
      Incorporate these changes into perf as well.
      
      Committer testing:
      
        $ podman run --entrypoint=/bin/sh --privileged -v /home/acme/git:/git --rm -ti docker.io/acmel/linux-perf-tools-build-ubuntu:18.04-x-powerpc64
        perfbuilder@d7a7af166a80:/git/perf$ head -2 /etc/os-release
        NAME="Ubuntu"
        VERSION="18.04.1 LTS (Bionic Beaver)"
        perfbuilder@d7a7af166a80:/git/perf$
        perfbuilder@d7a7af166a80:/git/perf$ make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- EXTRA_CFLAGS= -C /git/linux/tools/perf O=/tmp/build/perf
        make: Entering directory '/git/linux/tools/perf'
          BUILD:   Doing 'make -j8' parallel build
          HOSTCC   /tmp/build/perf/fixdep.o
          HOSTLD   /tmp/build/perf/fixdep-in.o
          LINK     /tmp/build/perf/fixdep
        Warning: Kernel ABI header at 'tools/include/uapi/linux/mman.h' differs from latest version at 'include/uapi/linux/mman.h'
        diff -u tools/include/uapi/linux/mman.h include/uapi/linux/mman.h
        sh: 1: command: Illegal option -c
      
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...            dwarf_getlocations: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ OFF ]
        ...                      libaudit: [ OFF ]
        ...                        libbfd: [ OFF ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ OFF ]
        ...        numa_num_possible_cpus: [ OFF ]
        ...                       libperl: [ OFF ]
        ...                     libpython: [ OFF ]
        ...                      libslang: [ OFF ]
        ...                     libcrypto: [ OFF ]
        ...                     libunwind: [ OFF ]
        ...            libdw-dwarf-unwind: [ on  ]
        ...                          zlib: [ on  ]
        ...                          lzma: [ OFF ]
        ...                     get_cpuid: [ OFF ]
        ...                           bpf: [ on  ]
      
        Makefile.config:445: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev
        Makefile.config:491: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
        Makefile.config:583: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev
        Makefile.config:598: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
        Makefile.config:612: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev
        Makefile.config:639: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev
        Makefile.config:666: No python interpreter was found: disables Python support - please install python-devel/python-dev
        Makefile.config:721: No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling
        Makefile.config:750: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev
        Makefile.config:763: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev
        Makefile.config:814: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
        Makefile.config:840: No alternatives command found, you need to set JDIR= to point to the root of your Java directory
          GEN      /tmp/build/perf/common-cmds.h
        <SNIP>
          CC       /tmp/build/perf/util/syscalltbl.o
        <SNIP>
          LD       /tmp/build/perf/libperf-in.o
          AR       /tmp/build/perf/libperf.a
          LINK     /tmp/build/perf/perf
        make: Leaving directory '/git/linux/tools/perf'
        perfbuilder@d7a7af166a80:/git/perf$ head /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_64.c
        static const char *syscalltbl_powerpc_64[] = {
        	[0] = "restart_syscall",
        	[1] = "exit",
        	[2] = "fork",
        	[3] = "read",
        	[4] = "write",
        	[5] = "open",
        	[6] = "close",
        	[7] = "waitpid",
        	[8] = "creat",
        perfbuilder@d7a7af166a80:/git/perf$ tail /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_64.c
        	[381] = "pwritev2",
        	[382] = "kexec_file_load",
        	[383] = "statx",
        	[384] = "pkey_alloc",
        	[385] = "pkey_free",
        	[386] = "pkey_mprotect",
        	[387] = "rseq",
        	[388] = "io_pgetevents",
        };
        #define SYSCALLTBL_POWERPC_64_MAX_ID 388
        perfbuilder@d7a7af166a80:/git/perf$ head /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_32.c
        static const char *syscalltbl_powerpc_32[] = {
        	[0] = "restart_syscall",
        	[1] = "exit",
        	[2] = "fork",
        	[3] = "read",
        	[4] = "write",
        	[5] = "open",
        	[6] = "close",
        	[7] = "waitpid",
        	[8] = "creat",
        perfbuilder@d7a7af166a80:/git/perf$ tail /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_32.c
        	[381] = "pwritev2",
        	[382] = "kexec_file_load",
        	[383] = "statx",
        	[384] = "pkey_alloc",
        	[385] = "pkey_free",
        	[386] = "pkey_mprotect",
        	[387] = "rseq",
        	[388] = "io_pgetevents",
        };
        #define SYSCALLTBL_POWERPC_32_MAX_ID 388
        perfbuilder@d7a7af166a80:/git/perf$
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/20190110094936.3132-1-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      02061318
    • A
      perf symbols: Add 'arch_cpu_idle' to the list of kernel idle symbols · 549aff77
      Arnaldo Carvalho de Melo 提交于
      When testing 'perf top' on a armhf system (32-bit, Orange Pi Zero), I
      noticed that 'arch_cpu_idle' dominated, add it to the list of idle
      symbols, so that we can see what is that being done when not idle.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-4q2b5g4p2hrstrhp9t2mrlho@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      549aff77
  4. 09 1月, 2019 7 次提交
  5. 05 1月, 2019 1 次提交
  6. 04 1月, 2019 6 次提交
    • A
      perf python: Make sure the python binding output directory is in place · f712a86c
      Arnaldo Carvalho de Melo 提交于
      Instead of doing an unconditional mkdir, use a dummy Makefile variable
      to check if the directory is there and if not, create it.
      
      This is better than what we had and will help with other python bindings
      that are in development, like one involved with python backtraces.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-iis6us2nocw3y4uuoon9osd7@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f712a86c
    • M
      perf strbuf: Remove redundant va_end() in strbuf_addv() · 099be748
      Mattias Jacobsson 提交于
      Each call to va_copy() should have one, and only one, corresponding call
      to va_end(). In strbuf_addv() some code paths result in va_end() getting
      called multiple times. Remove the superfluous va_end().
      Signed-off-by: NMattias Jacobsson <2pi@mok.nu>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sanskriti Sharma <sansharm@redhat.com>
      Link: http://lkml.kernel.org/r/20181229141750.16945-1-2pi@mok.nu
      Fixes: ce49d843 ("perf strbuf: Match va_{add,copy} with va_end")
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      099be748
    • I
      perf annotate: Pass filename to objdump via execl · 442b4eb3
      Ivan Krylov 提交于
      The symbol__disassemble() function uses shell to launch objdump and
      filter its output via grep. Passing filenames by interpolating them into
      the command line via "%s" may lead to problems if said filenames contain
      special characters.
      
      Instead, pass the filename as a command line argument where it is not
      subject to any kind of interpretation, then use quoted shell
      interpolation to build the strings we need safely.
      Signed-off-by: NIvan Krylov <krylov.r00t@gmail.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20181014111803.5d83b806@TarkusSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      442b4eb3
    • J
      perf report: Fix wrong iteration count in --branch-history · a3366db0
      Jin Yao 提交于
      By calculating the removed loops, we can get the iteration count.
      
      But the iteration count could be reported incorrectly, reporting
      impossibly high counts.
      
      That's because previous code uses the number of removed LBR entries for
      the iteration count. That's not good. Fix this by increasing the
      iteration count when a loop is detected.
      
      When matching the chain, the iteration count would be added up, finally we need
      to compute the average value when printing out.
      
      For example,
      
        $ perf report --branch-history --stdio --no-children
      
      Before:
      
        ---f2 +0
           |
           |--33.62%--f1 +9 (cycles:1)
           |          f1 +0
           |          main +22 (cycles:1)
           |          main +17
           |          main +38 (cycles:1)
           |          main +27
           |          f1 +26 (cycles:1)
           |          f1 +24
           |          f2 +27 (cycles:7)
           |          f2 +0
           |          f1 +19 (cycles:1)
           |          f1 +14
           |          f2 +27 (cycles:11)
           |          f2 +0
           |          f1 +9 (cycles:1 iter:2968 avg_cycles:3)
           |          f1 +0
           |          main +22 (cycles:1 iter:2968 avg_cycles:3)
           |          main +17
           |          main +38 (cycles:1 iter:2968 avg_cycles:3)
      
      2968 is an impossible high iteration count and avg_cycles is too small.
      
      After:
      
        ---f2 +0
           |
           |--33.62%--f1 +9 (cycles:1)
           |          f1 +0
           |          main +22 (cycles:1)
           |          main +17
           |          main +38 (cycles:1)
           |          main +27
           |          f1 +26 (cycles:1)
           |          f1 +24
           |          f2 +27 (cycles:7)
           |          f2 +0
           |          f1 +19 (cycles:1)
           |          f1 +14
           |          f2 +27 (cycles:11)
           |          f2 +0
           |          f1 +9 (cycles:1 iter:1 avg_cycles:23)
           |          f1 +0
           |          main +22 (cycles:1 iter:1 avg_cycles:23)
           |          main +17
           |          main +38 (cycles:1 iter:1 avg_cycles:23)
      
      avg_cycles:23 is the average cycles of this iteration.
      
      Fixes: c4ee0625 ("perf report: Calculate the average cycles of iterations")
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1546582230-17507-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a3366db0
    • L
      Remove 'type' argument from access_ok() function · 96d4f267
      Linus Torvalds 提交于
      Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
      of the user address range verification function since we got rid of the
      old racy i386-only code to walk page tables by hand.
      
      It existed because the original 80386 would not honor the write protect
      bit when in kernel mode, so you had to do COW by hand before doing any
      user access.  But we haven't supported that in a long time, and these
      days the 'type' argument is a purely historical artifact.
      
      A discussion about extending 'user_access_begin()' to do the range
      checking resulted this patch, because there is no way we're going to
      move the old VERIFY_xyz interface to that model.  And it's best done at
      the end of the merge window when I've done most of my merges, so let's
      just get this done once and for all.
      
      This patch was mostly done with a sed-script, with manual fix-ups for
      the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.
      
      There were a couple of notable cases:
      
       - csky still had the old "verify_area()" name as an alias.
      
       - the iter_iov code had magical hardcoded knowledge of the actual
         values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
         really used it)
      
       - microblaze used the type argument for a debug printout
      
      but other than those oddities this should be a total no-op patch.
      
      I tried to fix up all architectures, did fairly extensive grepping for
      access_ok() uses, and the changes are trivial, but I may have missed
      something.  Any missed conversion should be trivially fixable, though.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96d4f267
    • A
      tools beauty: Make the prctl option table generator catch all PR_ options · 805e4c8b
      Arnaldo Carvalho de Melo 提交于
      In ba830885 ("arm64: add prctl control for resetting ptrauth keys")
      the PR_PAC_RESET_KEYS prctl option was introduced, get that into the
      regex in addition to PR_GET_* and PR_SET_*:
      
      So just get everything that matches '^#define PR_\w+' this ends up
      adding these entries:
      
        $ tools/perf/trace/beauty/prctl_option.sh  > after
        $ diff -u before after
        --- before	2019-01-03 14:58:51.541807353 -0300
        +++ after	2019-01-03 15:17:05.909583804 -0300
        @@ -19,12 +19,18 @@
                [20] = "SET_ENDIAN",
                [21] = "GET_SECCOMP",
                [22] = "SET_SECCOMP",
        +       [23] = "CAPBSET_READ",
        +       [24] = "CAPBSET_DROP",
                [25] = "GET_TSC",
                [26] = "SET_TSC",
                [27] = "GET_SECUREBITS",
                [28] = "SET_SECUREBITS",
                [29] = "SET_TIMERSLACK",
                [30] = "GET_TIMERSLACK",
        +       [31] = "TASK_PERF_EVENTS_DISABLE",
        +       [32] = "TASK_PERF_EVENTS_ENABLE",
        +       [33] = "MCE_KILL",
        +       [34] = "MCE_KILL_GET",
                [35] = "SET_MM",
                [36] = "SET_CHILD_SUBREAPER",
                [37] = "GET_CHILD_SUBREAPER",
        @@ -33,8 +39,13 @@
                [40] = "GET_TID_ADDRESS",
                [41] = "SET_THP_DISABLE",
                [42] = "GET_THP_DISABLE",
        +       [43] = "MPX_ENABLE_MANAGEMENT",
        +       [44] = "MPX_DISABLE_MANAGEMENT",
                [45] = "SET_FP_MODE",
                [46] = "GET_FP_MODE",
        +       [47] = "CAP_AMBIENT",
        +       [50] = "SVE_SET_VL",
        +       [51] = "SVE_GET_VL",
                [52] = "GET_SPECULATION_CTRL",
                [53] = "SET_SPECULATION_CTRL",
                [54] = "PAC_RESET_KEYS",
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kristina Martsenko <kristina.martsenko@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: https://lkml.kernel.org/n/tip-sg2pkmtjr5988bhbcp4yp6sw@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      805e4c8b
  7. 03 1月, 2019 1 次提交
    • J
      perf stat: Fix endless wait for child process · 8a99255a
      Jin Yao 提交于
      We hit a 'perf stat' issue by using following script:
      
        #!/bin/bash
      
        sleep 1000 &
        exec perf stat -a -e cycles -I1000 -- sleep 5
      
      Since "perf stat" is launched by exec, the "sleep 1000" would be the
      child process of "perf stat". The wait4() call will not return because
      it's waiting for the child process "sleep 1000" to end. So 'perf stat'
      doesn't return even after 5s passes.
      
      This patch lets 'perf stat' return when the specified child process ends
      (in this case, the specified child process is "sleep 5").
      
      Committer testing:
      
        # cat test.sh
        #!/bin/bash
      
        sleep 10 &
        exec perf stat -a -e cycles -I1000 -- sleep 5
        #
      
      Before:
      
        # time ./test.sh
        #           time             counts unit events
             1.001113090        108,453,351      cycles
             2.002062196        142,075,435      cycles
             3.002896194        164,801,068      cycles
             4.003731666        107,062,140      cycles
             5.002068867        112,241,832      cycles
      
        real	0m10.066s
        user	0m0.016s
        sys	0m0.101s
        #
      
      After:
      
        # time ./test.sh
        #           time             counts unit events
             1.001016096         91,412,027      cycles
             2.002014963        124,063,708      cycles
             3.002883964        125,993,929      cycles
             4.003706470        120,465,734      cycles
             5.002006778        163,560,355      cycles
      
        real	0m5.123s
        user	0m0.014s
        sys	0m0.105s
        #
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Reviewed-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1546501245-4512-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8a99255a
  8. 02 1月, 2019 8 次提交