18 Dec, 2018

2 commits

  • Go over the tools/ files that are maintained in Arnaldo's tree and
    fix common typos: half of them were in comments, the other half
    in JSON files.

    No change in functionality intended.

    Committer notes:

    This was split from a larger patch as there are code that is,
    additionally, maintained outside the kernel tree, so to ease
    cherry-picking and/or backporting, split this into multiple patches.

    Just typos in comments, no need to backport, reducing the possibility of
    possible backporting artifacts.

    Signed-off-by: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     
  • Users should never use 'pt=0', but if they do it may give a meaningless
    error:

    $ perf record -e intel_pt/pt=0/u uname
    Error:
    The sys_perf_event_open() syscall returned with 22 (Invalid argument) for
    event (intel_pt/pt=0/u).

    Fix that by forcing 'pt=1'.

    Committer testing:

    # perf record -e intel_pt/pt=0/u uname
    Error:
    The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (intel_pt/pt=0/u).
    /bin/dmesg | grep -i perf may provide additional information.

    # perf record -e intel_pt/pt=0/u uname
    pt=0 doesn't make sense, forcing pt=1
    Linux
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.020 MB perf.data ]
    #

    Signed-off-by: Adrian Hunter
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/b7c5b4e5-9497-10e5-fd43-5f3e4a0fe51d@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

22 Nov, 2018

2 commits

  • The perf tools cannot find the proper event list for the Cascadelake
    server. Because the Cascadelake server and the Skylake server have the
    same CPU model number, which are used by the perf tools to find the
    event list.

    The stepping for Skylake server is up to 4.

    The stepping for Cascadelake server starts from 5.

    The stepping can be used to distinguish between them.

    The stepping is added in get_cpuid_str().

    The stepping information for Skylake server is updated in mapfile.csv.

    A x86 specific strcmp_cpuid_cmp() function is added to handle two CPUID
    formats in mapfile.csv, "vendor-family-model-stepping" and
    "vendor-family-model":

    - If a cpuid-regular-expression from the mapfile.csv using the new
    stepping format, a cpuid-string generated on the machine must include
    stepping. Otherwise, it is a mismatch.

    - If the cpuid-regular-expression using the old non-stepping format,
    the stepping in the cpuid-string will be ignored.

    The script, using environment string "PERF_CPUID" without stepping on
    Skylake server, will be broken. If so, users must fix their scripts.

    Committer notes:

    Fixed this build error on centos:6 and debian:7:

    arch/x86/util/header.c: In function 'is_full_cpuid':
    arch/x86/util/header.c:82:39: error: declaration of 'cpuid' shadows a global declaration [-Werror=shadow]
    arch/x86/util/header.c:12:1: error: shadowed declaration is here [-Werror=shadow]
    arch/x86/util/header.c: In function 'strcmp_cpuid_str':
    arch/x86/util/header.c:98:56: error: declaration of 'cpuid' shadows a global declaration [-Werror=shadow]
    arch/x86/util/header.c:12:1: error: shadowed declaration is here [-Werror=shadow]
    cc1: all warnings being treated as errors

    Signed-off-by: Kan Liang
    Reviewed-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20181114212416.15665-1-kan.liang@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • The tool perf is useful for the performance analysis on the Hygon Dhyana
    platform. But right now there is no Hygon support for it to analyze the
    KVM guest os data. So add Hygon Dhyana support to it by checking vendor
    string to share the code path of AMD.

    Signed-off-by: Pu Wen
    Acked-by: Borislav Petkov
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1542008451-31735-1-git-send-email-puwen@hygon.cn
    Signed-off-by: Arnaldo Carvalho de Melo

    Pu Wen
     

31 Aug, 2018

1 commit

  • Adding to tests that aims on kernel breakpoint modification bugs.

    First test creates HW breakpoint, tries to change it and checks it was
    properly changed. It aims on kernel issue that prevents HW breakpoint to
    be changed via ptrace interface.

    The first test forks, the child sets itself as ptrace tracee and waits
    in signal for parent to trace it, then it calls bp_1 and quits.

    The parent does following steps:

    - creates a new breakpoint (id 0) for bp_2 function
    - changes that breakpoint to bp_1 function
    - waits for the breakpoint to hit and checks
    it has proper rip of bp_1 function

    This test aims on an issue in kernel preventing to change disabled
    breakpoints

    Second test mimics the first one except for few steps
    in the parent:
    - creates a new breakpoint (id 0) for bp_1 function
    - changes that breakpoint to bogus (-1) address
    - waits for the breakpoint to hit and checks
    it has proper rip of bp_1 function

    This test aims on an issue in kernel disabling enabled
    breakpoint after unsuccesful change.

    Committer testing:

    # uname -a
    Linux jouet 4.18.0-rc8-00002-g1236568ee3cb #12 SMP Tue Aug 7 14:08:26 -03 2018 x86_64 x86_64 x86_64 GNU/Linux
    # perf test -v "bp modify"
    62: x86 bp modify :
    --- start ---
    test child forked, pid 25671
    in bp_1
    tracee exited prematurely 2
    FAILED arch/x86/tests/bp-modify.c:209 modify test 1 failed

    test child finished with -1
    ---- end ----
    x86 bp modify: FAILED!
    #

    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: David Ahern
    Cc: Milind Chabbi
    Cc: Namhyung Kim
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20180827091228.2878-2-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

15 Aug, 2018

1 commit

  • Probably leftover from the time we introducd the check-headers.sh script.

    Committer testing:

    Remove the 'rseq' syscall from tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
    to fake a diff:

    make: Entering directory '/home/acme/git/perf/tools/perf'
    BUILD: Doing 'make -j4' parallel build
    Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
    diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
    CC /tmp/build/perf/util/syscalltbl.o
    INSTALL trace_plugins

    $ diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
    --- tools/perf/arch/x86/entry/syscalls/syscall_64.tbl 2018-08-13 15:49:50.896585176 -0300
    +++ arch/x86/entry/syscalls/syscall_64.tbl 2018-07-20 12:04:04.536858304 -0300
    @@ -342,6 +342,7 @@
    331 common pkey_free __x64_sys_pkey_free
    332 common statx __x64_sys_statx
    333 common io_pgetevents __x64_sys_io_pgetevents
    +334 common rseq __x64_sys_rseq

    #
    # x32-specific system call numbers start at 512 to avoid cache impact
    $

    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Kapshuk
    Cc: Alexander Shishkin
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20180813111504.3568-2-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

31 Jul, 2018

1 commit

  • The UAPI file byteorder/little_endian.h uses the __always_inline define
    without including the header where it is defined, linux/stddef.h, this
    ends up working in all the other distros because that file gets included
    seemingly by luck from one of the files included from little_endian.h.

    But not on Alpine:edge, that fails for all files where perf_event.h is
    included but linux/stddef.h isn't include before that.

    Adding the missing linux/stddef.h file where it breaks on Alpine:edge to
    fix that, in all other distros, that is just a very small header anyway.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: https://lkml.kernel.org/n/tip-9r1pifftxvuxms8l7ir73p5l@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

11 Jul, 2018

1 commit

  • We are getting following warnings on gcc8 that break compilation:

    $ make
    CC jvmti/jvmti_agent.o
    jvmti/jvmti_agent.c: In function ‘jvmti_open’:
    jvmti/jvmti_agent.c:252:35: error: ‘/jit-’ directive output may be truncated \
    writing 5 bytes into a region of size between 1 and 4096 [-Werror=format-truncation=]
    snprintf(dump_path, PATH_MAX, "%s/jit-%i.dump", jit_path, getpid());

    There's no point in checking the result of snprintf call in
    jvmti_open, the following open call will fail in case the
    name is mangled or too long.

    Using tools/lib/ function scnprintf that touches the return value from
    the snprintf() calls and thus get rid of those warnings.

    $ make DEBUG=1
    CC arch/x86/util/perf_regs.o
    arch/x86/util/perf_regs.c: In function ‘arch_sdt_arg_parse_op’:
    arch/x86/util/perf_regs.c:229:4: error: ‘strncpy’ output truncated before terminating nul
    copying 2 bytes from a string of the same length [-Werror=stringop-truncation]
    strncpy(prefix, "+0", 2);
    ^~~~~~~~~~~~~~~~~~~~~~~~

    Using scnprintf instead of the strncpy (which we know is safe in here)
    to get rid of that warning.

    Signed-off-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20180702134202.17745-1-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

25 Jun, 2018

1 commit

  • This updates the tools/perf/ copy of the system call table for x86 which makes
    'perf trace' become aware of the new 'io_pgetevents' and 'rseq' syscalls, no
    matter in which system it gets built, i.e. older systems where the syscalls are
    not available in the running kernel (via tracefs) or in the system headers will
    still be aware of these syscalls/.

    These are the csets introducing the source drift:

    05c17cedf85b ("x86: Wire up restartable sequence system call")
    7a074e96dee6 ("aio: implement io_pgetevents")

    This results in this build time change:

    $ diff -u /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.old /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c
    --- /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.old 2018-06-15 11:48:17.648948094 -0300
    +++ /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c 2018-06-15 11:48:22.133942480 -0300
    @@ -332,5 +332,7 @@
    [330] = "pkey_alloc",
    [331] = "pkey_free",
    [332] = "statx",
    + [333] = "io_pgetevents",
    + [334] = "rseq",
    };
    -#define SYSCALLTBL_x86_64_MAX_ID 332
    +#define SYSCALLTBL_x86_64_MAX_ID 334
    $

    This silences the following tools/perf/ build warning:

    Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'

    Cc: Adrian Hunter
    Cc: Christoph Hellwig
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Mathieu Desnoyers
    Cc: Namhyung Kim
    Cc: Thomas Gleixner
    Cc: Wang Nan
    Link: https://lkml.kernel.org/n/tip-tfvyz51sabuzemrszbrhzxni@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

23 May, 2018

2 commits

  • Like the kernel text, the location of x86 PTI entry trampolines must be
    recorded in the perf.data file. Like the kernel, synthesize a mmap event
    for that, and add processing for it.

    Signed-off-by: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: H. Peter Anvin
    Cc: Jiri Olsa
    Cc: Joerg Roedel
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: x86@kernel.org
    Link: http://lkml.kernel.org/r/1526986485-6562-10-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     
  • Create maps for x86 PTI entry trampolines, based on symbols found in
    kallsyms. It is also necessary to keep track of whether the trampolines
    have been mapped particularly when the kernel dso is kcore.

    Signed-off-by: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: H. Peter Anvin
    Cc: Jiri Olsa
    Cc: Joerg Roedel
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: x86@kernel.org
    Link: http://lkml.kernel.org/r/1526986485-6562-9-git-send-email-adrian.hunter@intel.com
    [ Fix extra_kernel_map_info.cnt designed struct initializer on gcc 4.4.7 (centos:6, etc) ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

27 Apr, 2018

2 commits


17 Apr, 2018

1 commit

  • Sync the following tooling headers with the latest kernel version:

    tools/arch/arm/include/uapi/asm/kvm.h
    - New ABI: KVM_REG_ARM_*

    tools/arch/x86/include/asm/required-features.h
    - Removal of NEED_LA57 dependency

    tools/arch/x86/include/uapi/asm/kvm.h
    - New KVM ABI: KVM_SYNC_X86_*

    tools/include/uapi/asm-generic/mman-common.h
    - New ABI: MAP_FIXED_NOREPLACE flag

    tools/include/uapi/linux/bpf.h
    - New ABI: BPF_F_SEQ_NUMBER functions

    tools/include/uapi/linux/if_link.h
    - New ABI: IFLA tun and rmnet support

    tools/include/uapi/linux/kvm.h
    - New ABI: hyperv eventfd and CONN_ID_MASK support plus header cleanups

    tools/include/uapi/sound/asound.h
    - New ABI: SNDRV_PCM_FORMAT_FIRST PCM format specifier

    tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
    - The x86 system call table description changed due to the ptregs changes and the renames, in:

    d5a00528b58c: syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()
    5ac9efa3c50d: syscalls/core, syscalls/x86: Clean up compat syscall stub naming convention
    ebeb8c82ffaf: syscalls/x86: Use 'struct pt_regs' based syscall calling for IA32_EMULATION and x32

    Also fix the x86 syscall table warning:

    -Warning: Kernel ABI header at 'tools/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
    +Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'

    None of these changes impact existing tooling code, so we only have to copy the kernel version.

    Signed-off-by: Ingo Molnar
    Cc: Adrian Hunter
    Cc: Alexander Potapenko
    Cc: Alexander Shishkin
    Cc: Alexei Starovoitov
    Cc: Alexey Budankov
    Cc: Andi Kleen
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Brian Robbins
    Cc: Clark Williams
    Cc: Daniel Borkmann
    Cc: David Ahern
    Cc: Dmitriy Vyukov
    Cc: Heiko Carstens
    Cc: Hendrik Brueckner
    Cc: Jesper Dangaard Brouer
    Cc: Jin Yao
    Cc: Jiri Olsa
    Cc: Josh Poimboeuf
    Cc: Kan Liang
    Cc: Kim Phillips
    Cc: Linus Torvalds
    Cc: Li Zhijian
    Cc: Mark Rutland
    Cc: Martin Liška
    Cc: Martin Schwidefsky
    Cc: Matthias Kaehlcke
    Cc: Miguel Bernal Marin
    Cc: Namhyung Kim
    Cc: Naveen N. Rao
    Cc: Peter Zijlstra
    Cc: Ravi Bangoria
    Cc: Sandipan Das
    Cc: Stephane Eranian
    Cc: Stephen Rothwell
    Cc: Takuya Yamamoto
    Cc: Thomas Gleixner
    Cc: Thomas Richter
    Cc: Wang Nan
    Cc: William Cohen
    Cc: Yonghong Song
    Link: http://lkml.kernel.org/r/20180416064024.ofjtrz5yuu3ykhvl@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     

13 Apr, 2018

1 commit

  • Just like is done for 'mov' and others that can have as source or
    targets variables resolved by objdump, to make them more compact:

    - orb $0x4,0x224d71(%rip) # 226ca4
    + orb $0x4,_rtld_global+0xca4

    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Jin Yao
    Cc: Jiri Olsa
    Cc: Martin Liška
    Cc: Namhyung Kim
    Cc: Ravi Bangoria
    Cc: Thomas Richter
    Cc: Wang Nan
    Link: https://lkml.kernel.org/n/tip-efex7746id4w4wa03nqxvh3m@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

08 Mar, 2018

4 commits

  • Tidy auxtrace_record__init_intel() slightly by recognizing that evlist is
    never NULL.

    Signed-off-by: Adrian Hunter
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/1520431349-30689-6-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     
  • It isn't necessary to pass the 'start', 'end' and 'overwrite' arguments
    to perf_mmap__read_init(). The data is stored in the struct perf_mmap.

    Discard the parameters.

    Signed-off-by: Kan Liang
    Suggested-by: Arnaldo Carvalho de Melo
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1520350567-80082-8-git-send-email-kan.liang@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • It isn't necessary to pass the 'overwrite', 'start' and 'end' argument
    to perf_mmap__read_event(). Discard them.

    Signed-off-by: Kan Liang
    Suggested-by: Arnaldo Carvalho de Melo
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1520350567-80082-7-git-send-email-kan.liang@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • It isn't necessary to pass the 'overwrite' argument to
    perf_mmap__consume(). Discard it.

    Signed-off-by: Kan Liang
    Suggested-by: Arnaldo Carvalho de Melo
    Acked-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1520350567-80082-6-git-send-email-kan.liang@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     

05 Mar, 2018

1 commit

  • The perf test 'time-to-tsc' still use the legacy interface.

    No functional change.

    Commiter notes:

    Testing it:

    # perf test tsc
    57: Convert perf time to TSC : Ok
    #

    Signed-off-by: Kan Liang
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1519945751-37786-10-git-send-email-kan.liang@linux.intel.com
    [ Changed bool parameters from 0 to 'false', as per Jiri comment ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     

17 Jan, 2018

1 commit

  • In x86 architecture dependend part function get_cpuid_str() mallocs a
    128 byte buffer, but does not check if the memory allocation succeeded
    or not.

    When the memory allocation fails, function __get_cpuid() is called with
    first parameter being a NULL pointer. However this function references
    its first parameter and operates on a NULL pointer which might cause
    core dumps.

    Signed-off-by: Thomas Richter
    Cc: Heiko Carstens
    Cc: Hendrik Brueckner
    Cc: Martin Schwidefsky
    Link: http://lkml.kernel.org/r/20180117131611.34319-1-tmricht@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Thomas Richter
     

08 Jan, 2018

1 commit

  • Fix a compile error:

    ...
    CC util/libunwind/x86_32.o
    In file included from util/libunwind/x86_32.c:33:0:
    util/libunwind/../../arch/x86/util/unwind-libunwind.c: In function 'libunwind__x86_reg_id':
    util/libunwind/../../arch/x86/util/unwind-libunwind.c:110:11: error: 'EINVAL' undeclared (first use in this function)
    return -EINVAL;
    ^
    util/libunwind/../../arch/x86/util/unwind-libunwind.c:110:11: note: each undeclared identifier is reported only once for each function it appears in
    mv: cannot stat 'util/libunwind/.x86_32.o.tmp': No such file or directory
    make[4]: *** [util/libunwind/x86_32.o] Error 1
    make[3]: *** [util] Error 2
    make[2]: *** [libperf-in.o] Error 2
    make[1]: *** [sub-make] Error 2
    make: *** [all] Error 2

    It happens when libunwind-x86 feature is detected.

    Signed-off-by: Wang Nan
    Link: http://lkml.kernel.org/r/20171206015040.114574-1-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

06 Dec, 2017

1 commit


05 Dec, 2017

1 commit

  • The cpuid string will not be same on all CPUs on heterogeneous platforms
    like ARM's big.LITTLE, adding provision(using pmu->cpus) to find cpuid
    string from associated CPUs of PMU CORE device.

    Also optimise arguments to function pmu_add_cpu_aliases.

    Signed-off-by: Ganapatrao Kulkarni
    Acked-by: Will Deacon
    Cc: Alexander Shishkin
    Cc: Catalin Marinas
    Cc: Jayachandran C
    Cc: Jonathan Cameron
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Shaokun Zhang
    Link: http://lkml.kernel.org/r/20171016183222.25750-2-ganapatrao.kulkarni@cavium.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ganapatrao Kulkarni
     

07 Nov, 2017

1 commit

  • Conflicts:
    tools/perf/arch/arm/annotate/instructions.c
    tools/perf/arch/arm64/annotate/instructions.c
    tools/perf/arch/powerpc/annotate/instructions.c
    tools/perf/arch/s390/annotate/instructions.c
    tools/perf/arch/x86/tests/intel-cqm.c
    tools/perf/ui/tui/progress.c
    tools/perf/util/zlib.c

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

23 Oct, 2017

1 commit

  • There's no need for extra cpuid_parse arch callback, it can be handled
    directly in init callback.

    Adding the init function to x86 to cover the cpuid initialization.

    Signed-off-by: Jiri Olsa
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20171011150158.11895-2-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

22 Sep, 2017

1 commit

  • Intel CQM perf test is obsolete for perf PMU code has been removed in
    commit c39a0e2c8850 ("x86/perf/cqm: Wipe out perf based cqm").

    Signed-off-by: Xiaochen Shen
    Cc: Alexander Shishkin
    Cc: Fenghua Yu
    Cc: Matt Fleming
    Cc: Pei P Jia
    Cc: Peter Zijlstra
    Cc: Tony Luck
    Cc: Vikas Shivappa
    Link: http://lkml.kernel.org/r/1505797057-16300-1-git-send-email-xiaochen.shen@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Xiaochen Shen
     

11 Aug, 2017

1 commit

  • This way we'll be able to pass more test specific parameters without
    having to change this function signature.

    Will be used by the upcoming 'shell tests', shell scripts that will
    call perf tools and check if they work as expected, comparing its
    effects on the system (think 'perf probe foo') the output produced, etc.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Michael Petlan
    Cc: Namhyung Kim
    Cc: Thomas Richter
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-wq250w7j1opbzyiynozuajbl@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

31 Jul, 2017

1 commit

  • In this patch we changed the header checks:

    perf build: Clarify header version warning message

    Unfortunately the header checks were copied to various places and thus the message got
    out of sync. Fix some of them here.

    Note that there's still old, misleading messages remaining in:

    tools/objtool/Makefile: || echo "warning: objtool: x86 instruction decoder differs from kernel" >&2 )) || true
    tools/objtool/Makefile: || echo "warning: objtool: orc_types.h differs from kernel" >&2 )) || true

    here objtool copied the perf message, plus:

    tools/perf/util/intel-pt-decoder/Build: || echo "Warning: Intel PT: x86 instruction decoder differs from kernel" >&2 )) || true

    here the PT code regressed over the original message and only emits a vague warning
    instead of specific file names...

    All of this should be consolidated into tools/Build/ and used in a consistent
    manner.

    Signed-off-by: Ingo Molnar
    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: David Carrillo-Cisneros
    Cc: Francis Deslauriers
    Cc: Geneviève Bastien
    Cc: Jiri Olsa
    Cc: Julien Desfossez
    Cc: Martin Liška
    Cc: Mathieu Desnoyers
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Paul Turner
    Cc: Peter Zijlstra
    Cc: Simon Que
    Cc: Stephane Eranian
    Cc: Taeung Song
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/20170730095130.bblldwxjz5hamybb@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     

20 Jul, 2017

2 commits

  • An earlier kernel patch allowed enabling PT and LBR at the same time on
    Goldmont.

    commit ccbebba4c6bf ("perf/x86/intel/pt: Bypass PT vs. LBR exclusivity
    if the core supports it")

    However, users still cannot use Intel PT and LBRs simultaneously. $
    sudo perf record -e cycles,intel_pt//u -b -- sleep 1 Error: PMU
    Hardware doesn't support sampling/overflow-interrupts.

    PT implicitly adds dummy event in perf tool. dummy event is software
    event which doesn't support LBR.

    Always setting no branch for dummy event in Intel PT.

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170630141656.1626-2-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     
  • The reason of introducing the tracking event (a dummy software event) is
    to collect side-band information. Additional sampling is wasteful.
    no_aux_samples should be set for tracking event.

    Signed-off-by: Kan Liang
    Acked-by: Jiri Olsa
    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20170630141656.1626-1-kan.liang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Kan Liang
     

19 Jul, 2017

1 commit

  • Macro fusion merges two instructions to a single micro-op. Intel core
    platform performs this hardware optimization under limited
    circumstances.

    For example, CMP + JCC can be "fused" and executed /retired together.
    While with sampling this can result in the sample sometimes being on the
    JCC and sometimes on the CMP. So for the fused instruction pair, they
    could be considered together.

    On Nehalem, fused instruction pairs:

    cmp/test + jcc.

    On other new CPU:

    cmp/test/add/sub/and/inc/dec + jcc.

    This patch adds an x86-specific function which checks if 2 instructions
    are in a "fused" pair. For non-x86 arch, the function is just NULL.

    Changelog:

    v4: Move the CPU model checking to symbol__disassemble and save the CPU
    family/model in arch structure.

    It avoids checking every time when jump arrow printed.

    v3: Add checking for Nehalem (CMP, TEST). For other newer Intel CPUs
    just check it by default (CMP, TEST, ADD, SUB, AND, INC, DEC).

    v2: Remove the original weak function. Arnaldo points out that doing it
    as a weak function that will be overridden by the host arch doesn't
    work. So now it's implemented as an arch-specific function.

    Committer fix:

    Do not access evsel->evlist->env->cpuid, ->env can be null, introduce
    perf_evsel__env_cpuid(), just like perf_evsel__env_arch(), also used in
    this function call.

    The original patch was segfaulting 'perf top' + annotation.

    But this essentially disables this fused instructions augmentation in
    'perf top', the right thing is to get the cpuid from the running kernel,
    left for a later patch tho.

    Signed-off-by: Yao Jin
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1499403995-19857-2-git-send-email-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     

27 Jun, 2017

1 commit

  • Add ptwrite to the op code map and the perf tools new instructions test.
    To run the test:

    $ tools/perf/perf test "x86 ins"
    39: Test x86 instruction decoder - new instructions : Ok

    Or to see the details:

    $ tools/perf/perf test -v "x86 ins" 2>&1 | grep ptwrite

    For information about ptwrite, refer the Intel SDM.

    Signed-off-by: Adrian Hunter
    Acked-by: Masami Hiramatsu
    Link: http://lkml.kernel.org/r/1495180230-19367-1-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

21 Jun, 2017

1 commit

  • Branch tracing is enabled by default, so a fake config bit called 'pt'
    (pass-through) was added to allow the 'branch enable' bit to have affect.
    Add default config 'pt,branch' which will allow users to disable branch
    tracing using 'branch=0' instead of having to specify 'pt,branch=0'.

    Signed-off-by: Adrian Hunter
    Cc: Andi Kleen
    Link: http://lkml.kernel.org/r/1495786658-18063-12-git-send-email-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Adrian Hunter
     

20 Jun, 2017

1 commit


25 Apr, 2017

2 commits


21 Apr, 2017

1 commit


20 Apr, 2017

1 commit

  • Removing it from util.h, part of an effort to disentangle the includes
    hell, that makes changes to util.h or something included by it to cause
    a complete rebuild of the tools.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-ztrjy52q1rqcchuy3rubfgt2@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo