Re: [PATCH 1/2] perf tools: Add support for MIPS userspace DWARF callchains.

From: Jiri Olsa
Date: Wed Apr 08 2015 - 05:48:37 EST


On Wed, Apr 08, 2015 at 01:58:46AM +0200, David Daney wrote:
> From: David Daney <david.daney@xxxxxxxxxx>
>
> Hack up the Makefile and add support code for mips unwinding
> and dwarf-regs.

hi,
we changed our build system just recently and this patch
is made over the old one.. comments below

>
> Signed-off-by: David Daney <david.daney@xxxxxxxxxx>
> Cc: linux-mips@xxxxxxxxxxxxxx
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> Cc: Paul Mackerras <paulus@xxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxxxx>
> Patchwork: https://patchwork.linux-mips.org/patch/5249/
> Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
> ---
> tools/perf/Makefile | 3 ++
> tools/perf/arch/mips/Makefile | 7 +++
> tools/perf/arch/mips/include/perf_regs.h | 84 ++++++++++++++++++++++++++++++++
> tools/perf/arch/mips/util/dwarf-regs.c | 37 ++++++++++++++
> tools/perf/arch/mips/util/unwind.c | 20 ++++++++
> 5 files changed, 151 insertions(+)
> create mode 100644 tools/perf/arch/mips/Makefile
> create mode 100644 tools/perf/arch/mips/include/perf_regs.h
> create mode 100644 tools/perf/arch/mips/util/dwarf-regs.c
> create mode 100644 tools/perf/arch/mips/util/unwind.c
>
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index cb2e586..c2a089a 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -28,6 +28,9 @@ ifeq ($(JOBS),)
> ifeq ($(JOBS),)
> JOBS := 1
> endif
> + ifeq ($(ARCH),mips)
> + LIB_H += arch/mips/include/perf_regs.h
> + endif
> endif

LIB_H is no longer supported, the build now detects
all headers automatically


>
> #
> diff --git a/tools/perf/arch/mips/Makefile b/tools/perf/arch/mips/Makefile
> new file mode 100644
> index 0000000..fe9b61e
> --- /dev/null
> +++ b/tools/perf/arch/mips/Makefile
> @@ -0,0 +1,7 @@
> +ifndef NO_DWARF
> +PERF_HAVE_DWARF_REGS := 1
> +LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
> +endif
> +ifndef NO_LIBUNWIND
> +LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/unwind.o
> +endif

the tools/perf/arch/mips/Makefile now provides make arch's
dependent variables setup, so your's should be:

---
ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
---

from building side mips seems similar to arch/powerpc/ setup:

---
[jolsa@krava perf]$ cat arch/powerpc/Build
libperf-y += util/
[jolsa@krava perf]$ cat arch/powerpc/util/Build
libperf-y += header.o

libperf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_DWARF) += skip-callchain-idx.o
---

so arch/mips/Build should be identical to arch/powerpc/Build
and arch/mips/util/Build should look like:

---
libperf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_LIBUNWIND) += unwind.o
---

could you please also rename 'unwind.c' to 'unwind-libunwind.c',
cause we have also libdw unwind and we try to keep them separated

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/