1. 17 Jan, 2019 11 commits
  2. 16 Jan, 2019 10 commits
    • Davide Caratti's avatar
      selftests: tc-testing: fix parsing of ife type · 91fa038d
      Davide Caratti authored
      In iproute2 commit 90c5c969f0b9 ("fix print_0xhex on 32 bit"), the format
      specifier for the ife type changed from 0x%X to %#llX, causing systematic
      failures in the following TDC test cases:
      
       7682 - Create valid ife encode action with mark and pass control
       ef47 - Create valid ife encode action with mark and pipe control
       df43 - Create valid ife encode action with mark and continue control
       e4cf - Create valid ife encode action with mark and drop control
       ccba - Create valid ife encode action with mark and reclassify control
       a1cf - Create valid ife encode action with mark and jump control
       cb3d - Create valid ife encode action with mark value at 32-bit maximum
       95ed - Create valid ife encode action with prio and pass control
       aa17 - Create valid ife encode action with prio and pipe control
       74c7 - Create valid ife encode action with prio and continue control
       7a97 - Create valid ife encode action with prio and drop control
       f66b - Create valid ife encode action with prio and reclassify control
       3056 - Create valid ife encode action with prio and jump control
       7dd3 - Create valid ife encode action with prio value at 32-bit maximum
       05bb - Create valid ife encode action with tcindex and pass control
       ce65 - Create valid ife encode action with tcindex and pipe control
       09cd - Create valid ife encode action with tcindex and continue control
       8eb5 - Create valid ife encode action with tcindex and continue control
       451a - Create valid ife encode action with tcindex and drop control
       d76c - Create valid ife encode action with tcindex and reclassify control
       e731 - Create valid ife encode action with tcindex and jump control
       b7b8 - Create valid ife encode action with tcindex value at 16-bit maximum
       2a9c - Create valid ife encode action with mac src parameter
       cf5c - Create valid ife encode action with mac dst parameter
       2353 - Create valid ife encode action with mac src and mac dst parameters
       552c - Create valid ife encode action with mark and type parameters
       0421 - Create valid ife encode action with prio and type parameters
       4017 - Create valid ife encode action with tcindex and type parameters
       fac3 - Create valid ife encode action with index at 32-bit maximnum
       7c25 - Create valid ife decode action with pass control
       dccb - Create valid ife decode action with pipe control
       7bb9 - Create valid ife decode action with continue control
       d9ad - Create valid ife decode action with drop control
       219f - Create valid ife decode action with reclassify control
       8f44 - Create valid ife decode action with jump control
       b330 - Create ife encode action with cookie
      
      Change 'matchPattern' values, allowing '0' and '0x0' if ife type is equal
      to 0, and accepting both '0x' and '0X' otherwise, to let these tests pass
      both with old and new tc binaries.
      While at it, fix a small typo in test case fac3 ('maximnum'->'maximum').
      Signed-off-by: 's avatarDavide Caratti <dcaratti@redhat.com>
      Acked-by: 's avatarStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
      91fa038d
    • Geert Uytterhoeven's avatar
      selftests: gpio-mockup-chardev: Check asprintf() for error · 508cacd7
      Geert Uytterhoeven authored
      With gcc 7.3.0:
      
          gpio-mockup-chardev.c: In function ‘get_debugfs’:
          gpio-mockup-chardev.c:62:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
             asprintf(path, "%s/gpio", mnt_fs_get_target(fs));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Handle asprintf() failures to fix this.
      Signed-off-by: 's avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: 's avatarShuah Khan <shuah@kernel.org>
      508cacd7
    • Yonghong Song's avatar
      tools/bpf: support __int128 in bpftool map pretty dumper · e86e5138
      Yonghong Song authored
      For formatted output, currently when json is enabled, the decimal
      number is required. Similar to kernel bpffs printout,
      for int128 numbers, only hex numbers are dumped, which are
      quoted as strings.
      
      The below is an example to show plain and json pretty print
      based on the map in test_btf pretty print test.
      
        $ bpftool m s
        75: hash  name pprint_test_has  flags 0x0
              key 4B  value 112B  max_entries 4  memlock 4096B
        $ bpftool m d id 75
        ......
          {
              "key": 3,
              "value": {
                  "ui32": 3,
                  "ui16": 0,
                  "si32": -3,
                  "unused_bits2a": 0x3,
                  "bits28": 0x3,
                  "unused_bits2b": 0x3,
                  "": {
                      "ui64": 3,
                      "ui8a": [3,0,0,0,0,0,0,0
                      ]
                  },
                  "aenum": 3,
                  "ui32b": 4,
                  "bits2c": 0x1,
                  "si128a": 0x3,
                  "si128b": 0xfffffffd,
                  "bits3": 0x3,
                  "bits80": 0x10000000000000003,
                  "ui128": 0x20000000000000003
              }
          },
        ......
      
        $ bptfool -p -j m d id 75
        ......
        {
              "key": ["0x03","0x00","0x00","0x00"
              ],
              "value": ["0x03","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0xfd","0xff","0xff","0xff","0x0f","0x00","0x00","0xc0",
                        "0x03","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x03","0x00","0x00","0x00","0x04","0x00","0x00","0x00",
                        "0x01","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x03","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0xfd","0xff","0xff","0xff","0x00","0x00","0x00","0x00",
                        "0x00","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x1b","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x08","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x03","0x00","0x00","0x00","0x00","0x00","0x00","0x00",
                        "0x02","0x00","0x00","0x00","0x00","0x00","0x00","0x00"
              ],
              "formatted": {
                  "key": 3,
                  "value": {
                      "ui32": 3,
                      "ui16": 0,
                      "si32": -3,
                      "unused_bits2a": "0x3",
                      "bits28": "0x3",
                      "unused_bits2b": "0x3",
                      "": {
                          "ui64": 3,
                          "ui8a": [3,0,0,0,0,0,0,0
                          ]
                      },
                      "aenum": 3,
                      "ui32b": 4,
                      "bits2c": "0x1",
                      "si128a": "0x3",
                      "si128b": "0xfffffffd",
                      "bits3": "0x3",
                      "bits80": "0x10000000000000003",
                      "ui128": "0x20000000000000003"
                  }
              }
          }
        ......
      Acked-by: 's avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: 's avatarYonghong Song <yhs@fb.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      e86e5138
    • Yonghong Song's avatar
      tools/bpf: add bpffs pretty print test for int128 · 4df3a1d0
      Yonghong Song authored
      The bpffs pretty print test is extended to cover int128 types.
      Tested on an x64 machine.
        $ test_btf -p
        ......
        BTF pretty print array(#3)......OK
        PASS:9 SKIP:0 FAIL:0
      Acked-by: 's avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: 's avatarYonghong Song <yhs@fb.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      4df3a1d0
    • Yonghong Song's avatar
      tools/bpf: refactor test_btf pretty printing for multiple map value formats · ce6ec47a
      Yonghong Song authored
      The test_btf pretty print is refactored in order to easily
      support multiple map value formats. The next patch will
      add __int128 type tests which needs macro guard __SIZEOF_INT128__.
      There is no functionality change with this patch.
      Acked-by: 's avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: 's avatarYonghong Song <yhs@fb.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      ce6ec47a
    • Yonghong Song's avatar
      tools/bpf: add int128 raw test in test_btf · a80eba20
      Yonghong Song authored
      Several int128 raw type tests are added to test_btf.
      Currently these tests are enabled only for x64 and arm64
      for which kernel has CONFIG_ARCH_SUPPORTS_INT128 set.
      
        $ test_btf
        ......
        BTF raw test[106] (128-bit int): OK
        BTF raw test[107] (struct, 128-bit int member): OK
        BTF raw test[108] (struct, 120-bit int member bitfield): OK
        BTF raw test[109] (struct, kind_flag, 128-bit int member): OK
        BTF raw test[110] (struct, kind_flag, 120-bit int member bitfield): OK
        ......
      Acked-by: 's avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: 's avatarYonghong Song <yhs@fb.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      a80eba20
    • Stanislav Fomichev's avatar
      libbpf: don't define CC and AR · eeedd352
      Stanislav Fomichev authored
      We are already including tools/scripts/Makefile.include which correctly
      handles CROSS_COMPILE, no need to define our own vars.
      
      See related commit 7ed1c190 ("tools: fix cross-compile var clobbering")
      for more details.
      Signed-off-by: 's avatarStanislav Fomichev <sdf@google.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      eeedd352
    • Fathi Boudra's avatar
      selftests: seccomp: use LDLIBS instead of LDFLAGS · 5bbc73a8
      Fathi Boudra authored
      seccomp_bpf fails to build due to undefined reference errors:
      
       aarch64-linaro-linux-gcc --sysroot=/build/tmp-rpb-glibc/sysroots/hikey
       -O2 -pipe -g -feliminate-unused-debug-types -Wl,-no-as-needed -Wall
       -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lpthread seccomp_bpf.c -o
       /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf
       /tmp/ccrlR3MW.o: In function `tsync_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1920: undefined reference to `sem_post'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1920: undefined reference to `sem_post'
       /tmp/ccrlR3MW.o: In function `TSYNC_setup':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1863: undefined reference to `sem_init'
       /tmp/ccrlR3MW.o: In function `TSYNC_teardown':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1904: undefined reference to `sem_destroy'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1897: undefined reference to `pthread_kill'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1898: undefined reference to `pthread_cancel'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1899: undefined reference to `pthread_join'
       /tmp/ccrlR3MW.o: In function `tsync_start_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /tmp/ccrlR3MW.o: In function `TSYNC_siblings_fail_prctl':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1978: undefined reference to `sem_wait'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1990: undefined reference to `pthread_join'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1992: undefined reference to `pthread_join'
       /tmp/ccrlR3MW.o: In function `tsync_start_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_with_ancestor':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2016: undefined reference to `sem_wait'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2032: undefined reference to `pthread_join'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2034: undefined reference to `pthread_join'
       /tmp/ccrlR3MW.o: In function `tsync_start_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /tmp/ccrlR3MW.o: In function `TSYNC_two_sibling_want_nnp':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2046: undefined reference to `sem_wait'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2058: undefined reference to `pthread_join'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2060: undefined reference to `pthread_join'
       /tmp/ccrlR3MW.o: In function `tsync_start_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_with_no_filter':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2073: undefined reference to `sem_wait'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2098: undefined reference to `pthread_join'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2100: undefined reference to `pthread_join'
       /tmp/ccrlR3MW.o: In function `tsync_start_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_with_one_divergence':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2125: undefined reference to `sem_wait'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2143: undefined reference to `pthread_join'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2145: undefined reference to `pthread_join'
       /tmp/ccrlR3MW.o: In function `tsync_start_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
       /tmp/ccrlR3MW.o: In function `TSYNC_two_siblings_not_under_filter':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2169: undefined reference to `sem_wait'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2202: undefined reference to `pthread_join'
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:2227: undefined reference to `pthread_join'
       /tmp/ccrlR3MW.o: In function `tsync_start_sibling':
       /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/seccomp/seccomp_bpf.c:1941: undefined reference to `pthread_create'
      
      It's GNU Make and linker specific.
      
      The default Makefile rule looks like:
      
      $(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS)
      
      When linking is done by gcc itself, no issue, but when it needs to be passed
      to proper ld, only LDLIBS follows and then ld cannot know what libs to link
      with.
      
      More detail:
      https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
      
      LDFLAGS
      Extra flags to give to compilers when they are supposed to invoke the linker,
      ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable
      instead.
      
      LDLIBS
      Library flags or names given to compilers when they are supposed to invoke the
      linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to
      LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS
      variable.
      
      https://lkml.org/lkml/2010/2/10/362
      
      tools/perf: libraries must come after objects
      
      Link order matters, use LDLIBS instead of LDFLAGS to properly link against
      libpthread.
      Signed-off-by: 's avatarFathi Boudra <fathi.boudra@linaro.org>
      Acked-by: 's avatarKees Cook <keescook@chromium.org>
      Signed-off-by: 's avatarShuah Khan <shuah@kernel.org>
      5bbc73a8
    • Davide Caratti's avatar
      selftests: tc-testing: fix tunnel_key failure if dst_port is unspecified · 5216bd77
      Davide Caratti authored
      After commit 1c25324c ("net/sched: act_tunnel_key: Don't dump dst port
      if it wasn't set"), act_tunnel_key doesn't dump anymore the destination
      port, unless it was explicitly configured. This caused systematic failures
      in the following TDC test case:
      
       7a88 - Add tunnel_key action with cookie parameter
      
      Avoid matching zero values of TCA_TUNNEL_KEY_ENC_DST_PORT to let the test
      pass again.
      Signed-off-by: 's avatarDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
      5216bd77
    • Davide Caratti's avatar
      selftests: tc-testing: drop test on missing tunnel key id · e4136155
      Davide Caratti authored
      After merge of commit 80ef0f22 ("net/sched: act_tunnel_key: Allow
      key-less tunnels"), act_tunnel_key does not reject anymore requests to
      install 'set' rules where the key id is missing. Therefore, drop the
      following TDC testcase:
      
       ba4e - Add tunnel_key set action with missing mandatory id parameter
      
      because it's going to become a systematic fail as soon as userspace
      iproute2 will start supporting key-less tunnels.
      Signed-off-by: 's avatarDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
      e4136155
  3. 15 Jan, 2019 11 commits
  4. 11 Jan, 2019 3 commits
  5. 10 Jan, 2019 5 commits
    • Luc Maranget's avatar
      tools/memory-model: Dynamically check SRCU lock-to-unlock matching · dbb12fb0
      Luc Maranget authored
      This commit checks that the return value of srcu_read_lock() is passed
      to the matching srcu_read_unlock(), where "matching" is determined by
      nesting.  This check operates as follows:
      
         1. srcu_read_lock() creates an integer token, which is stored into
            the generated events.
         2. srcu_read_unlock() records its second (token) argument into the
            generated event.
         3. A new herd primitive 'different-values' filters out pairs of events
            with identical values from the relation passed as its argument.
         4. The bell file applies the above primitive to the (srcu)
            read-side-critical-section relation 'srcu-rscs' and flags non-empty
            results.
      
      BEWARE: Works only with herd version 7.51+6 and onwards.
      Signed-off-by: 's avatarLuc Maranget <Luc.Maranget@inria.fr>
      Signed-off-by: 's avatarPaul E. McKenney <paulmck@linux.ibm.com>
      [ paulmck: Apply Andrea Parri's off-list feedback. ]
      Acked-by: 's avatarAlan Stern <stern@rowland.harvard.edu>
      dbb12fb0
    • Anders Roxell's avatar
      selftests: bpf: install files tcp_(server|client)*.py · f98937c6
      Anders Roxell authored
      When test_tcpbpf_user runs it complains that it can't find files
      tcp_server.py and tcp_client.py.
      
      Rework so that tcp_server.py and tcp_client.py gets installed, added them
      to the variable TEST_PROGS_EXTENDED.
      
      Fixes: d6d4f60c ("bpf: add selftest for tcpbpf")
      Signed-off-by: 's avatarAnders Roxell <anders.roxell@linaro.org>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      f98937c6
    • Stanislav Fomichev's avatar
      selftests/bpf: add missing executables to .gitignore · e3ca63de
      Stanislav Fomichev authored
      We build test_libbpf with CXX to make sure linking against C++ works.
      
      $ make -s -C tools/lib/bpf
      $ git status -sb
      ? tools/lib/bpf/test_libbpf
      $ make -s -C tools/testing/selftests/bpf
      $ git status -sb
      ? tools/lib/bpf/test_libbpf
      ? tools/testing/selftests/bpf/test_libbpf
      
      Fixes: 8c4905b9 ("libbpf: make sure bpf headers are c++ include-able")
      Signed-off-by: 's avatarStanislav Fomichev <sdf@google.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      e3ca63de
    • Ravi Bangoria's avatar
      tools headers powerpc: Remove unistd.h · 15c03092
      Ravi Bangoria authored
      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: 's avatarRavi 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: 's avatarArnaldo Carvalho de Melo <acme@redhat.com>
      15c03092
    • Ravi Bangoria's avatar
      perf powerpc: Rework syscall table generation · 02061318
      Ravi Bangoria authored
      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: 's avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Reported-by: 's avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: 's avatarArnaldo 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: 's avatarArnaldo Carvalho de Melo <acme@redhat.com>
      02061318