Skip to content

Commit 75fcbd3

Browse files
committed
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
2 parents ca5e83e + 27730c8 commit 75fcbd3

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

tools/perf/Makefile.perf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,8 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
787787
$(Q)$(MKDIR) -p $(OUTPUT)dlfilters
788788
$(QUIET_CC)$(CC) -c -Iinclude $(EXTRA_CFLAGS) -o $@ -fpic $<
789789

790+
.SECONDARY: $(DLFILTERS:.so=.o)
791+
790792
$(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
791793
$(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $<
792794

tools/perf/arch/powerpc/util/skip-callchain-idx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static const Dwfl_Callbacks offline_callbacks = {
4545
*/
4646
static int check_return_reg(int ra_regno, Dwarf_Frame *frame)
4747
{
48-
Dwarf_Op ops_mem[2];
48+
Dwarf_Op ops_mem[3];
4949
Dwarf_Op dummy;
5050
Dwarf_Op *ops = &dummy;
5151
size_t nops;

tools/perf/builtin-script.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
459459
return -EINVAL;
460460

461461
if (PRINT_FIELD(WEIGHT) &&
462-
evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT", PERF_OUTPUT_WEIGHT))
462+
evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT_TYPE, "WEIGHT", PERF_OUTPUT_WEIGHT))
463463
return -EINVAL;
464464

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

40414041
uname(&uts);
4042-
if (data.is_pipe || /* assume pipe_mode indicates native_arch */
4043-
!strcmp(uts.machine, session->header.env.arch) ||
4044-
(!strcmp(uts.machine, "x86_64") &&
4045-
!strcmp(session->header.env.arch, "i386")))
4042+
if (data.is_pipe) { /* Assume pipe_mode indicates native_arch */
40464043
native_arch = true;
4044+
} else if (session->header.env.arch) {
4045+
if (!strcmp(uts.machine, session->header.env.arch))
4046+
native_arch = true;
4047+
else if (!strcmp(uts.machine, "x86_64") &&
4048+
!strcmp(session->header.env.arch, "i386"))
4049+
native_arch = true;
4050+
}
40474051

40484052
script.session = session;
40494053
script__setup_sample_type(&script);

0 commit comments

Comments
 (0)