1. 28 10月, 2016 1 次提交
  2. 24 10月, 2016 1 次提交
  3. 18 10月, 2016 1 次提交
    • D
      bpf: add initial suite for selftests · 5aa5bd14
      Daniel Borkmann 提交于
      Add a start of a test suite for kernel selftests. This moves test_verifier
      and test_maps over to tools/testing/selftests/bpf/ along with various
      code improvements and also adds a script for invoking test_bpf module.
      The test suite can simply be run via selftest framework, f.e.:
      
        # cd tools/testing/selftests/bpf/
        # make
        # make run_tests
      
      Both test_verifier and test_maps were kind of misplaced in samples/bpf/
      directory and we were looking into adding them to selftests for a while
      now, so it can be picked up by kbuild bot et al and hopefully also get
      more exposure and thus new test case additions.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5aa5bd14
  4. 06 10月, 2016 1 次提交
  5. 14 9月, 2016 1 次提交
    • W
      tools include: Add uapi mman.h for each architecture · f3539c12
      Wang Nan 提交于
      Some mmap related macros have different values for different
      architectures. This patch introduces uapi mman.h for each
      architectures.
      
      Three headers are cloned from kernel include to tools/include:
      
       tools/include/uapi/asm-generic/mman-common.h
       tools/include/uapi/asm-generic/mman.h
       tools/include/uapi/linux/mman.h
      
      The main part of this patch is generated by following script:
      
       macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
       for arch in `ls tools/arch`
       do
         [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
         src=arch/$arch/include/uapi/asm/mman.h
         target=tools/arch/$arch/include/uapi/asm/mman.h
         guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
         echo '#ifndef '$guard > $target
         echo '#define '$guard >> $target
      
         [ -f $src ] &&
         for m in $macros
         do
           if grep '#define[ \t]*'$m $src > /dev/null 2>&1
           then
             grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
           fi
         done
      
         if [ -f $src ]
         then
            grep '#include <asm-generic' $src >> $target
         else
            echo "#include <asm-generic/mman.h>" >> $target
         fi
         echo '#endif' >> $target
         echo "$target"
       done
      
       exit 0
       # Following macros are extracted from:
       # tools/perf/trace/beauty/mmap.c
       #
       # start macro list
       MADV_DODUMP
       MADV_DOFORK
       MADV_DONTDUMP
       MADV_DONTFORK
       MADV_DONTNEED
       MADV_HUGEPAGE
       MADV_HWPOISON
       MADV_MERGEABLE
       MADV_NOHUGEPAGE
       MADV_NORMAL
       MADV_RANDOM
       MADV_REMOVE
       MADV_SEQUENTIAL
       MADV_SOFT_OFFLINE
       MADV_UNMERGEABLE
       MADV_WILLNEED
       MAP_32BIT
       MAP_ANONYMOUS
       MAP_DENYWRITE
       MAP_EXECUTABLE
       MAP_FILE
       MAP_FIXED
       MAP_GROWSDOWN
       MAP_HUGETLB
       MAP_LOCKED
       MAP_NONBLOCK
       MAP_NORESERVE
       MAP_POPULATE
       MAP_PRIVATE
       MAP_SHARED
       MAP_STACK
       MAP_UNINITIALIZED
       MREMAP_FIXED
       MREMAP_MAYMOVE
       PROT_EXEC
       PROT_GROWSDOWN
       PROT_GROWSUP
       PROT_NONE
       PROT_READ
       PROT_SEM
       PROT_WRITE
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1473684871-209320-2-git-send-email-wangnan0@huawei.com
      [ Added new files to tools/perf/MANIFEST to fix the detached tarball build, add mman.h for ARC ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f3539c12
  6. 24 8月, 2016 2 次提交
  7. 19 8月, 2016 1 次提交
    • V
      tools lib: Reinstate strlcpy() header guard with __UCLIBC__ · 0215d59b
      Vineet Gupta 提交于
      perf tools build in recent kernels spews splat when cross compiling with uClibc:
      
      |   CC       util/alias.o
      | In file included from tools/perf/util/../ui/../util/cache.h:8:0,
      |                 from tools/perf/util/../ui/helpline.h:7,
      |                 from tools/perf/util/debug.h:8,
      |                 from arch/../util/cpumap.h:9,
      |                 from arch/../util/env.h:5,
      |                 from arch/common.h:4,
      |                 from arch/common.c:3:
      | tools/include/linux/string.h:12:15: warning: redundant redeclaration of ‘strlcpy’ [-Wredundant-decls]
      |  extern size_t strlcpy(char *dest, const char *src, size_t size);
                     ^
      This is after commit 61a6445e ("tools lib: Guard the strlcpy() header with
      __GLIBC__").
      
      The problem is uClibc also defines __GLIBC__ for exported headers for
      applications. So add that specific check to not trip for uClibc.
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petri Gynther <pgynther@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: linux-snps-arc@lists.infradead.org
      Link: http://lkml.kernel.org/r/1471537703-16439-1-git-send-email-vgupta@synopsys.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0215d59b
  8. 09 8月, 2016 1 次提交
    • A
      toops: Sync tools/include/uapi/linux/bpf.h with the kernel · 791cceb8
      Arnaldo Carvalho de Melo 提交于
      The way we're using kernel headers in tools/ now, with a copy that is
      made to the same path prefixed by "tools/" plus checking if that copy
      got stale, i.e. if the kernel counterpart changed, helps in keeping
      track with new features that may be useful for tools to exploit.
      
      For instance, looking at all the changes to bpf.h since it was last
      copied to tools/include brings this to toolers' attention:
      
      Need to investigate this one to check how to run a program via perf, setting up
      a BPF event, that will take advantage of the way perf already calls clang/LLVM,
      sets up the event and runs the workload in a single command line, helping in
      debugging such semi cooperative programs:
      
        96ae5227 ("bpf: Add bpf_probe_write_user BPF helper to be called in tracers")
      
      This one needs further investigation about using the feature it improves
      in 'perf trace' to do some tcpdumpin' mixed with syscalls, tracepoints,
      probe points, callgraphs, etc:
      
        555c8a86 ("bpf: avoid stack copy and use skb ctx for event output")
      
      Add tracing just packets that are related to some container to that mix:
      
        4a482f34 ("cgroup: bpf: Add bpf_skb_in_cgroup_proto")
        4ed8ec52 ("cgroup: bpf: Add BPF_MAP_TYPE_CGROUP_ARRAY")
      
      Definetely needs to have example programs accessing task_struct from a bpf proggie
      started from 'perf trace':
      
        606274c5 ("bpf: introduce bpf_get_current_task() helper")
      
      Core networking related, XDP:
      
        6ce96ca3 ("bpf: add XDP_TX xdp_action for direct forwarding")
        6a773a15 ("bpf: add XDP prog type for early driver filter")
        13c5c240 ("bpf: add bpf_get_hash_recalc helper")
        d2485c42 ("bpf: add bpf_skb_change_type helper")
        6578171a ("bpf: add bpf_skb_change_proto helper")
      
      Changes detected by the tools build system:
      
        $ make -C tools/perf O=/tmp/build/perf install-bin
        make: Entering directory '/home/acme/git/linux/tools/perf'
          BUILD:   Doing 'make -j4' parallel build
        Warning: tools/include/uapi/linux/bpf.h differs from kernel
          INSTALL  GTK UI
          CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        <SNIP>
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: Brenden Blanco <bblanco@plumgrid.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Sargun Dhillon <sargun@sargun.me>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-difq4ts1xvww6eyfs9e7zlft@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      791cceb8
  9. 03 8月, 2016 3 次提交
  10. 19 7月, 2016 2 次提交
  11. 16 7月, 2016 1 次提交
  12. 14 7月, 2016 2 次提交
  13. 13 7月, 2016 9 次提交
  14. 24 3月, 2016 1 次提交
  15. 09 3月, 2016 1 次提交
    • J
      tools: Copy hashtable.h into tools directory · 1698872b
      Josh Poimboeuf 提交于
      Copy hashtable.h from include/linux/tools.h.  It's needed by objtool in
      the next patch in the series.
      
      Add some includes that it needs, and remove references to
      kernel-specific features like RCU and __read_mostly.
      
      Also change some if its dependency headers' includes to use quotes
      instead of brackets so gcc can find them.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Chris J Arges <chris.j.arges@canonical.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Pedro Alves <palves@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Link: http://lkml.kernel.org/r/be3bef72f6540d8a510515408119d968a0e18179.1457502970.git.jpoimboe@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      1698872b
  16. 12 1月, 2016 1 次提交
    • J
      tools: Make list.h self-sufficient · d1b39d41
      Josh Poimboeuf 提交于
      Commit 7f5f873c ("rculist: Use WRITE_ONCE() when deleting from
      reader-visible list") added the use of the WRITE_ONCE macro to the
      kernel version of list.h, which broke the stacktool build because the
      tools list.h includes the kernel list.h.
      
      Avoid this type of situation in the future and make list.h
      self-sufficient by copying the kernel list.h routines directly into
      tools list.h.
      
      This is a straight copy except for adjustments to the include statements
      and copying of the tools-specific list routines (list_del_range and
      list_for_each_from).
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Chris J Arges <chris.j.arges@canonical.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Pedro Alves <palves@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Cc: x86@kernel.org
      Link: http://lkml.kernel.org/r/59cdc19c6589d1b5ef43d83b0e2d5a4a40301374.1450442274.git.jpoimboe@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d1b39d41
  17. 08 1月, 2016 1 次提交
  18. 17 12月, 2015 1 次提交
  19. 19 11月, 2015 2 次提交
  20. 12 11月, 2015 1 次提交
  21. 13 10月, 2015 1 次提交
    • J
      tools include: Fix strict-aliasing rules breakage · c95f3432
      Jiri Olsa 提交于
      Vinson reported build breakage with gcc 4.4 due to strict-aliasing.
      
         CC       util/annotate.o
       cc1: warnings being treated as errors
       util/annotate.c: In function ‘disasm__purge’:
       linux-next/tools/include/linux/compiler.h:66: error: dereferencing
       pointer ‘res.41’ does break strict-aliasing rules
      
      The reason is READ_ONCE/WRITE_ONCE code we took from kernel sources.  They
      intentionaly break aliasing rules. While this is ok for kernel because it's
      built with -fno-strict-aliasing, it breaks perf which is build with
      -Wstrict-aliasing=3.
      
      Using extra __may_alias__ type to allow aliasing in this case.
      Reported-and-tested-by: NVinson Lee <vlee@twopensource.com>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Martin Liska <mliska@suse.cz>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Rabin Vincent <rabin@rab.in>
      Cc: linux-next@vger.kernel.org
      Link: http://lkml.kernel.org/r/20151013085214.GB2705@krava.brq.redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c95f3432
  22. 01 10月, 2015 1 次提交
  23. 15 9月, 2015 1 次提交
  24. 03 9月, 2015 1 次提交
    • H
      perf tools: Copy linux/filter.h to tools/include · dabf626f
      He Kuang 提交于
      This patch copies filter.h from include/linux/kernel.h to
      tools/include/linux/filter.h to enable other libraries to use macros in it,
      like libbpf which will be introduced by further patches.
      
      Currently, the filter.h copy only contains the useful macros needed by
      libbpf for not introducing too much dependence.
      
      tools/perf/MANIFEST is also updated for 'make perf-*-src-pkg'.
      
      One change:
        The 'imm' field of BPF_EMIT_CALL becomes ((FUNC) - BPF_FUNC_unspec) to
        suit user space code generator.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1440822125-52691-22-git-send-email-wangnan0@huawei.comSigned-off-by: NWang Nan <wangnan0@huawei.com>
      [ Removed stylistic changes, so that a diff to the original file gets reduced ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dabf626f
  25. 25 8月, 2015 1 次提交
  26. 06 7月, 2015 1 次提交