1. 06 10月, 2021 2 次提交
  2. 04 10月, 2021 1 次提交
  3. 02 10月, 2021 5 次提交
  4. 01 10月, 2021 1 次提交
  5. 30 9月, 2021 4 次提交
  6. 29 9月, 2021 12 次提交
  7. 28 9月, 2021 11 次提交
  8. 27 9月, 2021 4 次提交
    • L
      perf iostat: Fix Segmentation fault from NULL 'struct perf_counts_values *' · 4da8b121
      Like Xu 提交于
      If the 'perf iostat' user specifies two or more iio_root_ports and also
      specifies the cpu(s) by -C which is not *connected to all* the above iio
      ports, the iostat_print_metric() will run into trouble:
      
      For example:
      
        $ perf iostat list
        S0-uncore_iio_0<0000:16>
        S1-uncore_iio_0<0000:97> # <--- CPU 1 is located in the socket S0
      
        $ perf iostat 0000:16,0000:97 -C 1 -- ls
        port 	Inbound Read(MB)	Inbound Write(MB)	Outbound Read(MB)	Outbound
        Write(MB) ../perf-iostat: line 12: 104418 Segmentation fault
        (core dumped) perf stat --iostat$DELIMITER$*
      
      The core-dump stack says, in the above corner case, the returned
      (struct perf_counts_values *) count will be NULL, and the caller
      iostat_print_metric() apparently doesn't not handle this case.
      
        433	struct perf_counts_values *count = perf_counts(evsel->counts, die, 0);
        434
        435	if (count->run && count->ena) {
        (gdb) p count
        $1 = (struct perf_counts_values *) 0x0
      
      The deeper reason is that there are actually no statistics from the user
      specified pair "iostat 0000:X, -C (disconnected) Y ", but let's fix it with
      minimum cost by adding a NULL check in the user space.
      
      Fixes: f9ed693e ("perf stat: Enable iostat mode for x86 platforms")
      Signed-off-by: NLike Xu <likexu@tencent.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20210927081115.39568-2-likexu@tencent.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4da8b121
    • L
      perf iostat: Use system-wide mode if the target cpu_list is unspecified · e4fe5d73
      Like Xu 提交于
      An iostate use case like "perf iostat 0000:16,0000:97 -- ls" should be
      implemented to work in system-wide mode to ensure that the output from
      print_header() is consistent with the user documentation perf-iostat.txt,
      rather than incorrectly assuming that the kernel does not support it:
      
       Error:
       The sys_perf_event_open() syscall returned with 22 (Invalid argument) \
       for event (uncore_iio_0/event=0x83,umask=0x04,ch_mask=0xF,fc_mask=0x07/).
       /bin/dmesg | grep -i perf may provide additional information.
      
      This error is easily fixed by assigning system-wide mode by default
      for IOSTAT_RUN only when the target cpu_list is unspecified.
      
      Fixes: f07952b1 ("perf stat: Basic support for iostat in perf")
      Signed-off-by: NLike Xu <likexu@tencent.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20210927081115.39568-1-likexu@tencent.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e4fe5d73
    • L
      perf config: Refine error message to eliminate confusion · a827c007
      Like Xu 提交于
      If there is no configuration file at first, the user can write any pair
      of "key.subkey=value" to the newly created configuration file, while
      value validation against a valid configurable key is *deferred* until
      the next execution or the implied execution of "perf config ... ".
      
      For example:
      
        $ rm ~/.perfconfig
        $ perf config call-graph.dump-size=65529
        $ cat ~/.perfconfig
        # this file is auto-generated.
        [call-graph]
       	dump-size = 65529
        $ perf config call-graph.dump-size=2048
        callchain: Incorrect stack dump size (max 65528): 65529
        Error: wrong config key-value pair call-graph.dump-size=65529
      
      The user might expect that the second value 2048 is valid and can be
      updated to the configuration file, but the error message is very
      confusing because the first value 65529 is not reported as an error
      during the last configuration.
      
      It is recommended not to change the current behavior of delayed
      validation (as more effort is needed), but to refine the original error
      message to *clearly indicate* that the cause of the error is the
      configuration file.
      Signed-off-by: NLike Xu <likexu@tencent.com>
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210924115817.58689-1-likexu@tencent.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a827c007
    • L
      perf doc: Fix typos all over the place · 4da6552c
      Like Xu 提交于
      Considering that perf and its subcommands have so many parameters, the
      documentation is always the first stop for perf beginners. Fixing some
      spelling errors will relax the eyes of some readers a little bit.
      
       s/specicfication/specification/
       s/caheline/cacheline/
       s/tranasaction/transaction/
       s/complan/complain/
       s/sched_wakep/sched_wakeup/
       s/possble/possible/
       s/methology/methodology/
      Signed-off-by: NLike Xu <likexu@tencent.com>
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20210924081942.38368-1-likexu@tencent.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4da6552c