1. 17 11月, 2017 1 次提交
  2. 13 11月, 2017 17 次提交
  3. 11 11月, 2017 1 次提交
    • I
      tooling/headers: Sync the tools/include/uapi/drm/i915_drm.h UAPI header · 505ee767
      Ingo Molnar 提交于
      Last minute upstream update to one of the UAPI headers - sync it with tooling,
      to address this warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h'
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      505ee767
  4. 09 11月, 2017 3 次提交
    • A
      perf trace: Call machine__exit() at exit · 33974a41
      Andrei Vagin 提交于
      Otherwise 'perf trace' leaves a temporary file /tmp/perf-vdso.so-XXXXXX.
      
        $ perf trace -o log true
        $ ls -l /tmp/perf-vdso.*
        -rw------- 1 root root 8192 Nov  8 03:08 /tmp/perf-vdso.so-5bCpD0
      Signed-off-by: NAndrei Vagin <avagin@openvz.org>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Vasily Averin <vvs@virtuozzo.com>
      Link: http://lkml.kernel.org/r/20171108002246.8924-1-avagin@openvz.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      33974a41
    • J
      perf tools: Fix eBPF event specification parsing · a271bfaf
      Jiri Olsa 提交于
      Looks like I've reached the new level of stupidity, adding missing braces.
      
      Committer testing:
      
      Given the following eBPF C filter, that will add a record when it
      returns true, i.e. when the tv_nsec variable is > 2000ns, should be
      built and installed via sys_bpf(), but fails to do so before this patch:
      
        # cat filter.c
        #include <uapi/linux/bpf.h>
        #define SEC(NAME) __attribute__((section(NAME), used))
      
        SEC("func=hrtimer_nanosleep rqtp->tv_nsec")
        int func(void *ctx, int err, long nsec)
        {
      	  return nsec > 1000;
        }
        char _license[] SEC("license") = "GPL";
        int _version SEC("version") = LINUX_VERSION_CODE;
        #
      
        # perf trace -e nanosleep,filter.c usleep 1
        invalid or unsupported event: 'filter.c'
        Run 'perf list' for a list of valid events
      
         Usage: perf trace [<options>] [<command>]
            or: perf trace [<options>] -- <command> [<options>]
            or: perf trace record [<options>] [<command>]
            or: perf trace record [<options>] -- <command> [<options>]
      
            -e, --event <event>   event/syscall selector. use 'perf list' to list available events
        #
      
      And works again after it is applied, the nothing is inserted when the co
      
        # perf trace -e *sleep,filter.c usleep 1
           0.000 ( 0.066 ms): usleep/23994 nanosleep(rqtp: 0x7ffead94a0d0) = 0
        # perf trace -e *sleep,filter.c usleep 2
           0.000 ( 0.008 ms): usleep/24378 nanosleep(rqtp: 0x7fffa021ba50) ...
           0.008 (         ): perf_bpf_probe:func:(ffffffffb410cb30) tv_nsec=2000)
           0.000 ( 0.066 ms): usleep/24378  ... [continued]: nanosleep()) = 0
        #
      
      The intent of 9445464b is kept:
      
        # perf stat -e 'cpu/uops_executed.core,krava/'  true
        event syntax error: '..cuted.core,krava/'
                                          \___ unknown term
      
        valid terms: cmask,pc,event,edge,in_tx,any,ldlat,inv,umask,in_tx_cp,offcore_rsp,config,config1,config2,name,period
        Run 'perf list' for a list of valid events
      
         Usage: perf stat [<options>] [<command>]
      
            -e, --event <event>   event selector. use 'perf list' to list available events
        #
        # perf stat -e 'cpu/uops_executed.core,period=1/'  true
      
         Performance counter stats for 'true':
      
                 808,332      cpu/uops_executed.core,period=1/
      
             0.002997237 seconds time elapsed
      
        #
      Reported-by: NArnaldo Carvalho de Melo <acme@kernel.org>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 9445464b ("perf tools: Unwind properly location after REJECT")
      Link: http://lkml.kernel.org/n/tip-diea0ihbwpxfw6938huv3whj@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a271bfaf
    • J
      perf tools: Add "reject" option for parse-events.l · b6af53b7
      Jiri Olsa 提交于
      Arnaldo reported broken builds in some distros using a newer flex
      release, 2.6.4, found in Alpine Linux 3.6 and Edge, with flex not
      spotting the REJECT macro:
      
        CC       /tmp/build/perf/util/parse-events-flex.o
        util/parse-events.l: In function 'parse_events_lex':
        /tmp/build/perf/util/parse-events-flex.c:4734:16: error: \
        'reject_used_but_not_detected' undeclared (first use in this function)
      
      It's happening because we put the REJECT under another USER_REJECT macro
      in following commit:
      
        9445464b perf tools: Unwind properly location after REJECT
      
      Fortunately flex provides option for force it to use REJECT, adding it
      to parse-events.l.
      Reported-by: NArnaldo Carvalho de Melo <acme@kernel.org>
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Reviewed-by: NAndi Kleen <andi@firstfloor.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 9445464b ("perf tools: Unwind properly location after REJECT")
      Link: http://lkml.kernel.org/n/tip-7kdont984mw12ijk7rji6b8p@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b6af53b7
  5. 04 11月, 2017 2 次提交
    • I
      tools/headers: Synchronize kernel ABI headers · fb7df12d
      Ingo Molnar 提交于
      After the SPDX license tags were added a number of tooling headers got out of
      sync with their kernel variants, generating lots of build warnings.
      
      Sync them:
      
       - tools/arch/x86/include/asm/disabled-features.h,
         tools/arch/x86/include/asm/required-features.h,
         tools/include/linux/hash.h:
      
           Remove the SPDX tag where the kernel version does not have it.
      
       - tools/include/asm-generic/bitops/__fls.h,
         tools/include/asm-generic/bitops/arch_hweight.h,
         tools/include/asm-generic/bitops/const_hweight.h,
         tools/include/asm-generic/bitops/fls.h,
         tools/include/asm-generic/bitops/fls64.h,
         tools/include/uapi/asm-generic/ioctls.h,
         tools/include/uapi/asm-generic/mman-common.h,
         tools/include/uapi/sound/asound.h,
         tools/include/uapi/linux/kvm.h,
         tools/include/uapi/linux/perf_event.h,
         tools/include/uapi/linux/sched.h,
         tools/include/uapi/linux/vhost.h,
         tools/include/uapi/sound/asound.h:
      
           Add the SPDX tag of the respective kernel header.
      
       - tools/include/uapi/linux/bpf_common.h,
         tools/include/uapi/linux/fcntl.h,
         tools/include/uapi/linux/hw_breakpoint.h,
         tools/include/uapi/linux/mman.h,
         tools/include/uapi/linux/stat.h,
      
           Change the tag to the kernel header version:
      
             -/* SPDX-License-Identifier: GPL-2.0 */
             +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
      
      Also sync other header details:
      
       - include/uapi/sound/asound.h:
      
           Fix pointless end of line whitespace noise the header grew in this cycle.
      
       - tools/arch/x86/lib/memcpy_64.S:
      
           Sync the code and add tools/include/asm/export.h with dummy wrappers
           to support building the kernel side code in a tooling header environment.
      
       - tools/include/uapi/asm-generic/mman.h,
         tools/include/uapi/linux/bpf.h:
      
           Sync other details that don't impact tooling's use of the ABIs.
      Acked-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      fb7df12d
    • J
      objtool: Resync objtool's instruction decoder source code copy with the kernel's latest version · da0db32b
      Josh Poimboeuf 提交于
      This fixes the following warning:
      
        warning: objtool: x86 instruction decoder differs from kernel
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/013315a808ccf5580abc293808827c8e2b5e1354.1509719152.git.jpoimboe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      da0db32b
  6. 02 11月, 2017 3 次提交
    • G
      License cleanup: add SPDX license identifier to uapi header files with a license · e2be04c7
      Greg Kroah-Hartman 提交于
      Many user space API headers have licensing information, which is either
      incomplete, badly formatted or just a shorthand for referring to the
      license under which the file is supposed to be.  This makes it hard for
      compliance tools to determine the correct license.
      
      Update these files with an SPDX license identifier.  The identifier was
      chosen based on the license information in the file.
      
      GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
      identifier with the added 'WITH Linux-syscall-note' exception, which is
      the officially assigned exception identifier for the kernel syscall
      exception:
      
         NOTE! This copyright does *not* cover user programs that use kernel
         services by normal system calls - this is merely considered normal use
         of the kernel, and does *not* fall under the heading of "derived work".
      
      This exception makes it possible to include GPL headers into non GPL
      code, without confusing license compliance tools.
      
      Headers which have either explicit dual licensing or are just licensed
      under a non GPL license are updated with the corresponding SPDX
      identifier and the GPLv2 with syscall exception identifier.  The format
      is:
              ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)
      
      SPDX license identifiers are a legally binding shorthand, which can be
      used instead of the full boiler plate text.  The update does not remove
      existing license information as this has to be done on a case by case
      basis and the copyright holders might have to be consulted. This will
      happen in a separate step.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.  See the previous patch in this series for the
      methodology of how this patch was researched.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2be04c7
    • G
      License cleanup: add SPDX license identifier to uapi header files with no license · 6f52b16c
      Greg Kroah-Hartman 提交于
      Many user space API headers are missing licensing information, which
      makes it hard for compliance tools to determine the correct license.
      
      By default are files without license information under the default
      license of the kernel, which is GPLV2.  Marking them GPLV2 would exclude
      them from being included in non GPLV2 code, which is obviously not
      intended. The user space API headers fall under the syscall exception
      which is in the kernels COPYING file:
      
         NOTE! This copyright does *not* cover user programs that use kernel
         services by normal system calls - this is merely considered normal use
         of the kernel, and does *not* fall under the heading of "derived work".
      
      otherwise syscall usage would not be possible.
      
      Update the files which contain no license information with an SPDX
      license identifier.  The chosen identifier is 'GPL-2.0 WITH
      Linux-syscall-note' which is the officially assigned identifier for the
      Linux syscall exception.  SPDX license identifiers are 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.  See the previous patch in this series for the
      methodology of how this patch was researched.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6f52b16c
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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 <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  7. 01 11月, 2017 8 次提交
    • N
      perf srcline: Show correct function name for srcline of callchains · 7285cf33
      Namhyung Kim 提交于
      When libbfd is not used, it doesn't show proper function name and reuse
      the original symbol of the sample.  That's because it passes the
      original sym to inline_list__append().  As `addr2line -f` returns
      function names as well, use that to create an inline_sym and pass it to
      inline_list__append().
      
      For example, following data shows that inlined entries of main have same
      name (main).
      
      Before:
        $ perf report -g srcline -q | head
            45.22%  inlining     libm-2.26.so      [.] __hypot_finite
                    |
                    ---__hypot_finite ??:0
                       |
                       |--44.15%--hypot ??:0
                       |          main complex:589
                       |          main complex:597
                       |          main complex:654
                       |          main complex:664
                       |          main inlining.cpp:14
      
      After:
        $ perf report -g srcline -q | head
            45.22%  inlining     libm-2.26.so      [.] __hypot_finite
                    |
                    ---__hypot_finite
                       |
                       |--44.15%--hypot
                       |          std::__complex_abs complex:589 (inlined)
                       |          std::abs<double> complex:597 (inlined)
                       |          std::_Norm_helper<true>::_S_do_it<double> complex:654 (inlined)
                       |          std::norm<double> complex:664 (inlined)
                       |          main inlining.cpp:14
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Reviewed-by: NJiri Olsa <jolsa@kernel.org>
      Reviewed-by: NMilian Wolff <milian.wolff@kdab.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: kernel-team@lge.com
      Link: http://lkml.kernel.org/r/20171031020654.31163-2-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7285cf33
    • N
      perf srcline: Fix memory leak in addr2inlines() · b7b75a60
      Namhyung Kim 提交于
      When libbfd is not used, addr2inlines() executes `addr2line -i` and
      process output line by line.  But it resets filename to NULL in the loop
      so getline() allocates additional memory everytime instead of realloc.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: kernel-team@lge.com
      Link: http://lkml.kernel.org/r/20171031020654.31163-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b7b75a60
    • J
      bpf: remove SK_REDIRECT from UAPI · 04686ef2
      John Fastabend 提交于
      Now that SK_REDIRECT is no longer a valid return code. Remove it
      from the UAPI completely. Then do a namespace remapping internal
      to sockmap so SK_REDIRECT is no longer externally visible.
      
      Patchs primary change is to do a namechange from SK_REDIRECT to
      __SK_REDIRECT
      Reported-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      04686ef2
    • S
      selftests: lib.mk: print individual test results to console by default · a323335e
      Shuah Khan 提交于
      Change run_tests to print individual test results to console by default.
      Introduce "summary" option to print individual test results to a file
      /tmp/test_name and just print the summary to the console.
      
      This change is necessary to support use-cases where test machines get
      rebooted once tests are run and the console log should contain the full
      results.
      
      In the following example, individual test results with "summary=1" option
      are written to /tmp/kcmp_test
      
      make --silent TARGETS=kcmp kselftest
      
      TAP version 13
      selftests: kcmp_test
      ========================================
      pid1:  30126 pid2:  30127 FD:  2 FILES:  2 VM:  1 FS:  2 SIGHAND:  2 IO:
      0 SYSVSEM:  0 INV: -1
      PASS: 0 returned as expected
      PASS: 0 returned as expected
      FAIL: 0 expected but -1 returned (Invalid argument)
      Pass 2 Fail 1 Xfail 0 Xpass 0 Skip 0 Error 0
      1..3
      Bail out!
      Pass 2 Fail 1 Xfail 0 Xpass 0 Skip 0 Error 0
      1..3
      Pass 0 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0
      1..0
      ok 1..1 selftests: kcmp_test [PASS]
      
      make --silent TARGETS=kcmp summary=1 kselftest
      TAP version 13
      selftests: kcmp_test
      ========================================
      ok 1..1 selftests: kcmp_test [PASS]
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      a323335e
    • A
      perf trace beauty kcmp: Beautify arguments · 1de3038d
      Arnaldo Carvalho de Melo 提交于
      For some unknown reason there is no entry in tracefs's syscalls for
      kcmp, i.e. no tracefs/events/syscalls/sys_{enter,exit}_kcmp, so we need
      to provide a data dictionary for the fields.
      
      To beautify the 'type' argument we automatically generate a strarray
      from tools/include/uapi/kcmp.h, the idx1 and idx2 args, nowadays used
      only if type == KCMP_FILE, are masked for all the other types and a
      lookup is made for the thread and fd to show the path, if possible,
      getting it from the probe:vfs_getname if in place or from procfs, races
      allowing.
      
      A system wide strace like tracing session, with callchains shows just
      one user so far in this fedora 25 machine:
      
        # perf trace --max-stack 5 -e kcmp
        <SNIP>
        1502914.400 ( 0.001 ms): systemd/1 kcmp(pid1: 1 (systemd), pid2: 1 (systemd), type: FILE, idx1: 271<socket:[4723475]>, idx2: 25<socket:[4788686]>) = -1 ENOSYS Function not implemented
                                               syscall (/usr/lib64/libc-2.25.so)
                                               same_fd (/usr/lib/systemd/libsystemd-shared-233.so)
                                               service_add_fd_store (/usr/lib/systemd/systemd)
                                               service_notify_message.lto_priv.127 (/usr/lib/systemd/systemd)
        1502914.407 ( 0.001 ms): systemd/1 kcmp(pid1: 1 (systemd), pid2: 1 (systemd), type: FILE, idx1: 270<socket:[4726396]>, idx2: 25<socket:[4788686]>) = -1 ENOSYS Function not implemented
                                               syscall (/usr/lib64/libc-2.25.so)
                                               same_fd (/usr/lib/systemd/libsystemd-shared-233.so)
                                               service_add_fd_store (/usr/lib/systemd/systemd)
                                               service_notify_message.lto_priv.127 (/usr/lib/systemd/systemd)
        <SNIP>
      
      The backtraces seem to agree this is really kcmp(), but this system
      doesn't have the sys_kcmp(), bummer:
      
        # uname -a
        Linux jouet 4.14.0-rc3+ #1 SMP Fri Oct 13 12:21:12 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
        # grep kcmp /proc/kallsyms
        ffffffffb60b8890 W sys_kcmp
        $ grep CONFIG_CHECKPOINT_RESTORE ../build/v4.14.0-rc3+/.config
        # CONFIG_CHECKPOINT_RESTORE is not set
        $
      
      So systemd uses it, good fedora kernel config has it:
      
        $ grep CONFIG_CHECKPOINT_RESTORE /boot/config-4.13.4-200.fc26.x86_64
        CONFIG_CHECKPOINT_RESTORE=y
        [acme@jouet linux]$
      
      /me goes to rebuild a kernel...
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andrey Vagin <avagin@openvz.org>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      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: http://lkml.kernel.org/n/tip-gz5fca968viw8m7hryjqvrln@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1de3038d
    • A
      perf trace beauty: Implement pid_fd beautifier · 0a2f7540
      Arnaldo Carvalho de Melo 提交于
      One that given a pid and a fd, will try to get the path for that fd.
      Will be used in the upcoming kcmp's KCMP_FILE beautifier.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andrey Vagin <avagin@openvz.org>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      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: http://lkml.kernel.org/n/tip-7ketygp2dvs9h13wuakfncws@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a2f7540
    • A
      tools include uapi: Grab a copy of linux/kcmp.h · 735e215e
      Arnaldo Carvalho de Melo 提交于
      We will use it to generate tables for beautifying kcmp's 'type' arg.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andrey Vagin <avagin@openvz.org>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      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: http://lkml.kernel.org/n/tip-r35zr79invmpinfe1zu57cas@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      735e215e
    • N
      perf callchain: Fix double mapping al->addr for children without self period · d6332a17
      Namhyung Kim 提交于
      Milian Wolff found a problem he described in [1] and that for him would
      get fixed:
      
      "Note how most of the large offset values are now gone. Most notably, we
      get proper srcline resolution for the random.h and complex headers."
      
      Then Namhyung found the root cause:
      
      "I looked into it and found a bug handling cumulative (children)
      entries.  For children entries that have no self period, the al->addr (so
      he->ip) ends up having an doubly-mapped address.
      
      It seems to be there from the beginning but only affects entries that
      have no srclines - finding srcline itself is done using a different
      address but it will show the invalid address if no srcline was found.  I
      think we should fix the commit c7405d85 ("perf tools: Update cpumode
      for each cumulative entry")."
      
      [1] https://lkml.kernel.org/r/20171018185350.14893-7-milian.wolff@kdab.comReported-by: NMilian Wolff <milian.wolff@kdab.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NMilian Wolff <milian.wolff@kdab.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: kernel-team@lge.com
      Fixes: c7405d85 ("perf tools: Update cpumode for each cumulative entry")
      Link: https://lkml.kernel.org/r/20171020051533.GA2746@sejongSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d6332a17
  8. 31 10月, 2017 5 次提交