1. 21 Dec, 2022 35 commits
  2. 20 Dec, 2022 5 commits
    • Namhyung Kim's avatar
      perf lock contention: Factor out lock_type_table · 59119c09
      Namhyung Kim authored
      Move it out of get_type_str() so that we can reuse the table for others
      later.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Blake Jones <blakejones@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20221219201732.460111-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      59119c09
    • Yang Jihong's avatar
      perf probe: Check -v and -q options in the right place · 8b269b75
      Yang Jihong authored
      Check the -q and -v options first to return earlier on error.
      
      Before:
      
        # perf probe -q -v test
        probe-definition(0): test
        symbol:test file:(null) line:0 offset:0 return:0 lazy:(null)
        0 arguments
          Error: -v and -q are exclusive.
      
      After:
      
        # perf probe -q -v test
          Error: -v and -q are exclusive.
      
      Fixes: 5e17b28f ("perf probe: Add --quiet option to suppress output result message")
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Carsten Haitzler <carsten.haitzler@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Link: https://lore.kernel.org/r/20221220035702.188413-4-yangjihong1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8b269b75
    • Yang Jihong's avatar
      perf tools: Fix usage of the verbose variable · 7c0a6144
      Yang Jihong authored
      The data type of the verbose variable is integer and can be negative,
      replace improperly used cases in a unified manner:
       1. if (verbose)        => if (verbose > 0)
       2. if (!verbose)       => if (verbose <= 0)
       3. if (XX && verbose)  => if (XX && verbose > 0)
       4. if (XX && !verbose) => if (XX && verbose <= 0)
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Carsten Haitzler <carsten.haitzler@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Link: https://lore.kernel.org/r/20221220035702.188413-3-yangjihong1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7c0a6144
    • Yang Jihong's avatar
      perf debug: Set debug_peo_args and redirect_to_stderr variable to correct... · 188ac720
      Yang Jihong authored
      perf debug: Set debug_peo_args and redirect_to_stderr variable to correct values in perf_quiet_option()
      
      When perf uses quiet mode, perf_quiet_option() sets the 'debug_peo_args'
      variable to -1, and display_attr() incorrectly determines the value of
      'debug_peo_args'.  As a result, unexpected information is displayed.
      
      Before:
      
        # perf record --quiet -- ls > /dev/null
        ------------------------------------------------------------
        perf_event_attr:
          size                             128
          { sample_period, sample_freq }   4000
          sample_type                      IP|TID|TIME|PERIOD
          read_format                      ID|LOST
          disabled                         1
          inherit                          1
          mmap                             1
          comm                             1
          freq                             1
          enable_on_exec                   1
          task                             1
          precise_ip                       3
          sample_id_all                    1
          exclude_guest                    1
          mmap2                            1
          comm_exec                        1
          ksymbol                          1
          bpf_event                        1
        ------------------------------------------------------------
        ...
      
      After:
        # perf record --quiet -- ls > /dev/null
        #
      
      redirect_to_stderr is a similar problem.
      
      Fixes: f78eaef0 ("perf tools: Allow to force redirect pr_debug to stderr.")
      Fixes: ccd26741 ("perf tool: Provide an option to print perf_event_open args and return value")
      Suggested-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Carsten Haitzler <carsten.haitzler@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: martin.lau@kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Link: https://lore.kernel.org/r/20221220035702.188413-2-yangjihong1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      188ac720
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync linux/kvm.h with the kernel sources · b235e5b5
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        86bdf3eb ("KVM: Support dirty ring in conjunction with bitmap")
      
      That just rebuilds perf, as these patches don't add any new KVM ioctl to
      be harvested for the the 'perf trace' ioctl syscall argument
      beautifiers.
      
      This is also by now used by tools/testing/selftests/kvm/, a simple test
      build didn't succeed, but for another reason:
      
        lib/kvm_util.c: In function ‘vm_enable_dirty_ring’:
        lib/kvm_util.c:125:30: error: ‘KVM_CAP_DIRTY_LOG_RING_ACQ_REL’ undeclared (first use in this function); did you mean ‘KVM_CAP_DIRTY_LOG_RING’?
          125 |         if (vm_check_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL))
              |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |                              KVM_CAP_DIRTY_LOG_RING
      
      I'll send a separate patch for that.
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
        diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Gavin Shan <gshan@redhat.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: http://lore.kernel.org/lkml/Y6H3b1Q4Msjy5Yz3@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b235e5b5