Commit 75fcbd38 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'perf-tools-fixes-for-v5.15-2021-10-31' of...

Merge tag 'perf-tools-fixes-for-v5.15-2021-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull perf tools fixes from Arnaldo Carvalho de Melo:

 - Fix compilation of callchain related code on powerpc with gcc11+

 - Fix PERF_SAMPLE_WEIGHT_STRUCT support in 'perf script'

 - Check session->header.env.arch before using it, fixing a segmentation
   fault

 - Suppress 'rm dlfilter' build messages

* tag 'perf-tools-fixes-for-v5.15-2021-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
  perf script: Fix PERF_SAMPLE_WEIGHT_STRUCT support
  perf callchain: Fix compilation on powerpc with gcc11+
  perf script: Check session->header.env.arch before using it
  perf build: Suppress 'rm dlfilter' build message
parents ca5e83ed 27730c8c
...@@ -787,6 +787,8 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h ...@@ -787,6 +787,8 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
$(Q)$(MKDIR) -p $(OUTPUT)dlfilters $(Q)$(MKDIR) -p $(OUTPUT)dlfilters
$(QUIET_CC)$(CC) -c -Iinclude $(EXTRA_CFLAGS) -o $@ -fpic $< $(QUIET_CC)$(CC) -c -Iinclude $(EXTRA_CFLAGS) -o $@ -fpic $<
.SECONDARY: $(DLFILTERS:.so=.o)
$(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o $(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
$(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $< $(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $<
......
...@@ -45,7 +45,7 @@ static const Dwfl_Callbacks offline_callbacks = { ...@@ -45,7 +45,7 @@ static const Dwfl_Callbacks offline_callbacks = {
*/ */
static int check_return_reg(int ra_regno, Dwarf_Frame *frame) static int check_return_reg(int ra_regno, Dwarf_Frame *frame)
{ {
Dwarf_Op ops_mem[2]; Dwarf_Op ops_mem[3];
Dwarf_Op dummy; Dwarf_Op dummy;
Dwarf_Op *ops = &dummy; Dwarf_Op *ops = &dummy;
size_t nops; size_t nops;
......
...@@ -459,7 +459,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session) ...@@ -459,7 +459,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
return -EINVAL; return -EINVAL;
if (PRINT_FIELD(WEIGHT) && if (PRINT_FIELD(WEIGHT) &&
evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT", PERF_OUTPUT_WEIGHT)) evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT))
return -EINVAL; return -EINVAL;
if (PRINT_FIELD(SYM) && if (PRINT_FIELD(SYM) &&
...@@ -4039,11 +4039,15 @@ int cmd_script(int argc, const char **argv) ...@@ -4039,11 +4039,15 @@ int cmd_script(int argc, const char **argv)
goto out_delete; goto out_delete;
uname(&uts); uname(&uts);
if (data.is_pipe || /* assume pipe_mode indicates native_arch */ if (data.is_pipe) { /* Assume pipe_mode indicates native_arch */
!strcmp(uts.machine, session->header.env.arch) ||
(!strcmp(uts.machine, "x86_64") &&
!strcmp(session->header.env.arch, "i386")))
native_arch = true; native_arch = true;
} else if (session->header.env.arch) {
if (!strcmp(uts.machine, session->header.env.arch))
native_arch = true;
else if (!strcmp(uts.machine, "x86_64") &&
!strcmp(session->header.env.arch, "i386"))
native_arch = true;
}
script.session = session; script.session = session;
script__setup_sample_type(&script); script__setup_sample_type(&script);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment