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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -787,6 +787,8 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
	$(Q)$(MKDIR) -p $(OUTPUT)dlfilters
	$(QUIET_CC)$(CC) -c -Iinclude $(EXTRA_CFLAGS) -o $@ -fpic $<

.SECONDARY: $(DLFILTERS:.so=.o)

$(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
	$(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $<

+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ static const Dwfl_Callbacks offline_callbacks = {
 */
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 *ops = &dummy;
	size_t nops;
+9 −5
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
		return -EINVAL;

	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;

	if (PRINT_FIELD(SYM) &&
@@ -4039,11 +4039,15 @@ int cmd_script(int argc, const char **argv)
		goto out_delete;

	uname(&uts);
	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")))
	if (data.is_pipe) { /* Assume pipe_mode indicates native_arch */
		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__setup_sample_type(&script);