1. 13 Nov, 2021 29 commits
  2. 12 Nov, 2021 11 commits
    • Ian Rogers's avatar
      perf test: Use macro for "suite" definitions · 54df5c8e
      Ian Rogers authored
      Add a macro to simplify later refactoring. No functional change.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarSohaib Mohamed <sohaib.amhmd@gmail.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Brendan Higgins <brendanhiggins@google.com>
      Cc: Daniel Latypov <dlatypov@google.com>
      Cc: David Gow <davidgow@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20211104064208.3156807-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      54df5c8e
    • Ian Rogers's avatar
      perf test: Use macro for "suite" declarations · fe90d378
      Ian Rogers authored
      Currently tests are setup in builtin-test with function pointers. Kunit
      exposes tests as a kunit_suite with a null terminated array of test
      cases. Use a macro to aid transition from one to the other in later
      changes.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarSohaib Mohamed <sohaib.amhmd@gmail.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Brendan Higgins <brendanhiggins@google.com>
      Cc: Daniel Latypov <dlatypov@google.com>
      Cc: David Gow <davidgow@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20211104064208.3156807-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fe90d378
    • Arnaldo Carvalho de Melo's avatar
      perf beauty: Add socket level scnprintf that handles ARCH specific SOL_SOCKET · 66aee54b
      Arnaldo Carvalho de Melo authored
      SOL_SOCKET has a different value according to the architecture, some
      have it as 0xffff while all the others have it as 1, so a simple string
      array isn't usable, add a scnprintf routine that treats it as a special
      case, using the array for other values.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      66aee54b
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Beautify the 'level' argument of setsockopt · 0826b7fd
      Arnaldo Carvalho de Melo authored
        # perf trace -e setsockopt
           0.000 ( 0.019 ms): systemd-resolv/1121 setsockopt(fd: 22, level: IP, optname: 50, optval: 0x7ffee2c0c134, optlen: 4) = 0
           0.022 ( 0.003 ms): systemd-resolv/1121 setsockopt(fd: 22, level: IP, optname: 11, optval: 0x7ffee2c0c114, optlen: 4) = 0
           0.027 ( 0.003 ms): systemd-resolv/1121 setsockopt(fd: 22, level: IP, optname: 8, optval: 0x7ffee2c0c134, optlen: 4) = 0
           0.032 ( 0.002 ms): systemd-resolv/1121 setsockopt(fd: 22, level: IP, optname: 10, optval: 0x7ffee2c0c134, optlen: 4) = 0
           0.036 ( 0.002 ms): systemd-resolv/1121 setsockopt(fd: 22, level: IP, optname: 25, optval: 0x7ffee2c0c114, optlen: 4) = 0
           0.043 ( 0.003 ms): systemd-resolv/1121 setsockopt(fd: 22, level: 1, optname: 62, optval: 0x7ffee2c0c0fc, optlen: 4) = 0
           0.055 ( 0.003 ms): systemd-resolv/1121 setsockopt(fd: 22, level: 1, optname: 25)
        ^C#
      
      So the simple straight STRARRAY method is not enough as SOL_SOCKET is
      '1' in most architectures but some use 0xffff (alpha, mips, parisc and
      sparc), so a followup patch will create a specialized scnprintf to cover
      that.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0826b7fd
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Beautify the 'level' argument of getsockopt · f1c1e45e
      Arnaldo Carvalho de Melo authored
        # perf trace -e getsockopt
             0.000 ( 0.006 ms): systemd-resolv/1121 getsockopt(fd: 21, level: 1, optname: 17, optval: 0x7ffee2c0c6cc, optlen: 0x7ffee2c0c6c8) = 0
             0.301 ( 0.003 ms): systemd-resolv/1121 getsockopt(fd: 22, level: IP, optname: 14, optval: 0x7ffee2c0c1a0, optlen: 0x7ffee2c0c1a4) = -1 ENOTCONN (Transport endpoint is not connected)
             2.215 ( 0.005 ms): systemd-resolv/1121 getsockopt(fd: 21, level: 1, optname: 17, optval: 0x7ffee2c0c6cc, optlen: 0x7ffee2c0c6c8) = 0
             2.422 ( 0.005 ms): systemd-resolv/1121 getsockopt(fd: 22, level: IP, optname: 14, optval: 0x7ffee2c0c1a0, optlen: 0x7ffee2c0c1a4) = -1 ENOTCONN (Transport endpoint is not connected)
          1001.308 ( 0.006 ms): systemd-resolv/1121 getsockopt(fd: 21, level: 1, optname: 17, optval: 0x7ffee2c0c6cc, optlen: 0x7ffee2c0c6c8) = 0
          1001.586 ( 0.003 ms): systemd-resolv/1121 getsockopt(fd: 22, level: IP, optname: 14, optval: 0x7ffee2c0c1a0, optlen: 0x7ffee2c0c1a4) = -1 ENOTCONN (Transport endpoint is not connected)
          1001.647 ( 0.002 ms): systemd-resolv/1121 getsockopt(fd: 23, level: IP, optname: 14, optval: 0x7ffee2c0c1a0, optlen: 0x7ffee2c0c1a4) = -1 ENOTCONN (Transport endpoint is not connected)
          1003.868 ( 0.010 ms): systemd-resolv/1121 getsockopt(fd: 21, level: 1, optname: 17, optval: 0x7ffee2c0c6cc, optlen: 0x7ffee2c0c6c8) = 0
          1004.036 ( 0.006 ms): systemd-resolv/1121 getsockopt(fd: 22, level: IP, optname: 14, optval: 0x7ffee2c0c1a0, optlen: 0x7ffee2c0c1a4) = -1 ENOTCONN (Transport endpoint is not connected)
          1004.087 ( 0.002 ms): systemd-resolv/1121 getsockopt(fd: 23, level: IP, optname: 14, optval: 0x7ffee2c0c1a0, optlen: 0x7ffee2c0c1a4) = -1 ENOTCONN (Transport endpoint is not connected)
        ^C#
      
      So the simple straight STRARRAY method is not enough as SOL_SOCKET is
      '1' in most architectures but some use 0xffff (alpha, mips, parisc and
      sparc), so a followup patch will create a specialized scnprintf to cover
      that.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f1c1e45e
    • Arnaldo Carvalho de Melo's avatar
      perf beauty socket: Add generator for socket level (SOL_*) string table · ecf0a35b
      Arnaldo Carvalho de Melo authored
        $ tools/perf/trace/beauty/socket.sh
        static const char *socket_ipproto[] = {
        	[0] = "IP",
        	[1] = "ICMP",
        <SNIP>
        	[255] = "RAW",
        	[262] = "MPTCP",
        };
      
        static const char *socket_level[] = {
        	[0] = "IP",
        	[6] = "TCP",
        	[17] = "UDP",
        	[41] = "IPV6",
        	[58] = "ICMPV6",
        	[132] = "SCTP",
        	[136] = "UDPLITE",
        	[255] = "RAW",
        	[256] = "IPX",
        	[257] = "AX25",
        	[258] = "ATALK",
        	[259] = "NETROM",
        	[260] = "ROSE",
        	[261] = "DECNET",
        	[262] = "X25",
        	[263] = "PACKET",
        	[264] = "ATM",
        	[265] = "AAL",
        	[266] = "IRDA",
        	[267] = "NETBEUI",
        	[268] = "LLC",
        	[269] = "DCCP",
        	[270] = "NETLINK",
        	[271] = "TIPC",
        	[272] = "RXRPC",
        	[273] = "PPPOL2TP",
        	[274] = "BLUETOOTH",
        	[275] = "PNPIPE",
        	[276] = "RDS",
        	[277] = "IUCV",
        	[278] = "CAIF",
        	[279] = "ALG",
        	[280] = "NFC",
        	[281] = "KCM",
        	[282] = "TLS",
        	[283] = "XDP",
        	[284] = "MPTCP",
        	[285] = "MCTP",
        };
        $
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ecf0a35b
    • Arnaldo Carvalho de Melo's avatar
      perf beauty socket: Sort the ipproto array entries · d3f82839
      Arnaldo Carvalho de Melo authored
      Just tidying up the output for human consumption.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d3f82839
    • Arnaldo Carvalho de Melo's avatar
      perf beauty socket: Rename 'regex' to 'ipproto_regex' · 82e3664b
      Arnaldo Carvalho de Melo authored
      Paving the way for more regexps to be used here.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      82e3664b
    • Arnaldo Carvalho de Melo's avatar
      perf beauty socket: Prep to receive more input header files · 1a1edf33
      Arnaldo Carvalho de Melo authored
      Move from ternary like expression to an if block, this way we'll
      have just the extra lines for new files in the following patches.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1a1edf33
    • Arnaldo Carvalho de Melo's avatar
      perf beauty socket: Rename header_dir to uapi_header_dir · 012e5690
      Arnaldo Carvalho de Melo authored
      Paving the way to pass more headers to be consumed, like
      tools/perf/trace/beauty/include/linux/socket.h in addition to the
      current tools/include/uapi/linux/in.h, to get the SOL_* defines.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      012e5690
    • Arnaldo Carvalho de Melo's avatar
      perf beauty: Rename socket_ipproto.sh to socket.sh to hold more socket table generators · 795f91db
      Arnaldo Carvalho de Melo authored
      To avoid having to add new entries to tools/perf/Makefile.perf prep
      socket.sh so that it can generate other socket table generators, such as
      the upcoming SOL_ socket level one.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      795f91db