1. 17 Jul, 2022 6 commits
    • Naveen N. Rao's avatar
      perf trace: Fix SIGSEGV when processing syscall args · 4b335e1e
      Naveen N. Rao authored
      On powerpc, 'perf trace' is crashing with a SIGSEGV when trying to
      process a perf.data file created with 'perf trace record -p':
      
        #0  0x00000001225b8988 in syscall_arg__scnprintf_augmented_string <snip> at builtin-trace.c:1492
        #1  syscall_arg__scnprintf_filename <snip> at builtin-trace.c:1492
        #2  syscall_arg__scnprintf_filename <snip> at builtin-trace.c:1486
        #3  0x00000001225bdd9c in syscall_arg_fmt__scnprintf_val <snip> at builtin-trace.c:1973
        #4  syscall__scnprintf_args <snip> at builtin-trace.c:2041
        #5  0x00000001225bff04 in trace__sys_enter <snip> at builtin-trace.c:2319
      
      That points to the below code in tools/perf/builtin-trace.c:
      	/*
      	 * If this is raw_syscalls.sys_enter, then it always comes with the 6 possible
      	 * arguments, even if the syscall being handled, say "openat", uses only 4 arguments
      	 * this breaks syscall__augmented_args() check for augmented args, as we calculate
      	 * syscall->args_size using each syscalls:sys_enter_NAME tracefs format file,
      	 * so when handling, say the openat syscall, we end up getting 6 args for the
      	 * raw_syscalls:sys_enter event, when we expected just 4, we end up mistakenly
      	 * thinking that the extra 2 u64 args are the augmented filename, so just check
      	 * here and avoid using augmented syscalls when the evsel is the raw_syscalls one.
      	 */
      	if (evsel != trace->syscalls.events.sys_enter)
      		augmented_args = syscall__augmented_args(sc, sample, &augmented_args_size, trace->raw_augmented_syscalls_args_size);
      
      As the comment points out, we should not be trying to augment the args
      for raw_syscalls. However, when processing a perf.data file, we are not
      initializing those properly. Fix the same.
      Reported-by: default avatarClaudio Carvalho <cclaudio@linux.ibm.com>
      Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/20220707090900.572584-1-naveen.n.rao@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4b335e1e
    • Adrian Hunter's avatar
      perf tests: Fix Convert perf time to TSC test for hybrid · deb44a62
      Adrian Hunter authored
      The test does not always correctly determine the number of events for
      hybrids, nor allow for more than 1 evsel when parsing.
      
      Fix by iterating the events actually created and getting the correct
      evsel for the events processed.
      
      Fixes: d9da6f70 ("perf tests: Support 'Convert perf time to TSC' test for hybrid")
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: https://lore.kernel.org/r/20220713123459.24145-3-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      deb44a62
    • Adrian Hunter's avatar
      perf tests: Stop Convert perf time to TSC test opening events twice · 498c7a54
      Adrian Hunter authored
      Do not call evlist__open() twice.
      
      Fixes: 5bb017d4 ("perf test: Fix error message for test case 71 on s390, where it is not supported")
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: https://lore.kernel.org/r/20220713123459.24145-2-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      498c7a54
    • Arnaldo Carvalho de Melo's avatar
      tools arch x86: Sync the msr-index.h copy with the kernel sources · 91d248c3
      Arnaldo Carvalho de Melo authored
      To pick up the changes from these csets:
      
        4ad3278d ("x86/speculation: Disable RRSBA behavior")
        d7caac99 ("x86/cpu/amd: Add Spectral Chicken")
      
      That cause no changes to tooling:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        $
      
      Just silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h'
        diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/lkml/YtQTm9wsB3hxQWvy@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      91d248c3
    • Arnaldo Carvalho de Melo's avatar
      tools headers cpufeatures: Sync with the kernel sources · f098addb
      Arnaldo Carvalho de Melo authored
      To pick the changes from:
      
        f43b9876 ("x86/retbleed: Add fine grained Kconfig knobs")
        a149180f ("x86: Add magic AMD return-thunk")
        15e67227 ("x86: Undo return-thunk damage")
        369ae6ff ("x86/retpoline: Cleanup some #ifdefery")
        4ad3278d x86/speculation: Disable RRSBA behavior
        26aae8cc x86/cpu/amd: Enumerate BTC_NO
        9756bba2 x86/speculation: Fill RSB on vmexit for IBRS
        3ebc1700 x86/bugs: Add retbleed=ibpb
        2dbb887e x86/entry: Add kernel IBRS implementation
        6b80b59b x86/bugs: Report AMD retbleed vulnerability
        a149180f x86: Add magic AMD return-thunk
        15e67227 x86: Undo return-thunk damage
        a883d624 x86/cpufeatures: Move RETPOLINE flags to word 11
        51802186 x86/speculation/mmio: Enumerate Processor MMIO Stale Data bug
      
      This only causes these perf files to be rebuilt:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h'
        diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org
      Link: https://lore.kernel.org/lkml/YtQM40VmiLTkPND2@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f098addb
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync linux/kvm.h with the kernel sources · eee51fe3
      Arnaldo Carvalho de Melo authored
      To pick the changes in:
      
        1b870fa5 ("kvm: stats: tell userspace which values are boolean")
      
      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 succeeded.
      
      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: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: http://lore.kernel.org/lkml/YtQLDvQrBhJNl3n5@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      eee51fe3
  2. 16 Jul, 2022 11 commits
  3. 15 Jul, 2022 19 commits
  4. 14 Jul, 2022 4 commits