linux-stable/tools
Christophe Leroy 21b8732eb4 perf tools: Allow overriding MAX_NR_CPUS at compile time
After update of kernel, the perf tool doesn't run anymore on my 32MB RAM
powerpc board, but still runs on a 128MB RAM board:

  ~# strace perf
  execve("/usr/sbin/perf", ["perf"], [/* 12 vars */]) = -1 ENOMEM (Cannot allocate memory)
  --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
  +++ killed by SIGSEGV +++
  Segmentation fault

objdump -x shows that .bss section has a huge size of 24Mbytes:

 27 .bss          016baca8  101cebb8  101cebb8  001cd988  2**3

With especially the following objects having quite big size:

  10205f80 l     O .bss	00140000     runtime_cycles_stats
  10345f80 l     O .bss	00140000     runtime_stalled_cycles_front_stats
  10485f80 l     O .bss	00140000     runtime_stalled_cycles_back_stats
  105c5f80 l     O .bss	00140000     runtime_branches_stats
  10705f80 l     O .bss	00140000     runtime_cacherefs_stats
  10845f80 l     O .bss	00140000     runtime_l1_dcache_stats
  10985f80 l     O .bss	00140000     runtime_l1_icache_stats
  10ac5f80 l     O .bss	00140000     runtime_ll_cache_stats
  10c05f80 l     O .bss	00140000     runtime_itlb_cache_stats
  10d45f80 l     O .bss	00140000     runtime_dtlb_cache_stats
  10e85f80 l     O .bss	00140000     runtime_cycles_in_tx_stats
  10fc5f80 l     O .bss	00140000     runtime_transaction_stats
  11105f80 l     O .bss	00140000     runtime_elision_stats
  11245f80 l     O .bss	00140000     runtime_topdown_total_slots
  11385f80 l     O .bss	00140000     runtime_topdown_slots_retired
  114c5f80 l     O .bss	00140000     runtime_topdown_slots_issued
  11605f80 l     O .bss	00140000     runtime_topdown_fetch_bubbles
  11745f80 l     O .bss	00140000     runtime_topdown_recovery_bubbles

This is due to commit 4d255766d2 ("perf: Bump max number of cpus
to 1024"), because many tables are sized with MAX_NR_CPUS

This patch gives the opportunity to redefine MAX_NR_CPUS via

  $ make EXTRA_CFLAGS=-DMAX_NR_CPUS=1

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20170922112043.8349468C57@po15668-vm-win7.idsi0.si.c-s.fr
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-08-01 12:33:24 -03:00
..
accounting
arch Merge remote-tracking branch 'tip/perf/urgent' into perf/core 2018-07-31 09:55:45 -03:00
bpf tools/bpftool: Fix segfault case regarding 'pin' arguments 2018-07-20 10:16:54 +02:00
build tools: build: Use HOSTLDFLAGS with fixdep 2018-07-13 00:48:18 +09:00
cgroup tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
firewire
gpio Linux 4.16-rc5 2018-03-18 17:48:59 +01:00
hv tools: hv: include string.h in hv_fcopy_daemon 2018-03-06 09:57:16 -08:00
iio tools: iio: iio_generic_buffer: allow continuous looping 2018-05-20 14:55:58 +01:00
include tools include uapi: Grab a copy of linux/in.h 2018-07-31 10:52:37 -03:00
kvm/kvm_stat tools/kvm_stat: Remove unused function 2018-03-28 22:47:06 +02:00
laptop tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
leds tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
lib docs: Fix some broken references 2018-06-15 18:10:01 -03:00
memory-model tools/memory-model: Add reference for 'Simplifying ARM concurrency' 2018-05-15 08:11:19 +02:00
nfsd
objtool objtool: Use '.strtab' if '.shstrtab' doesn't exist, to support ORC tables on Clang 2018-07-14 14:59:42 +02:00
pci
pcmcia
perf perf tools: Allow overriding MAX_NR_CPUS at compile time 2018-08-01 12:33:24 -03:00
power Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2018-06-21 00:37:04 +02:00
scripts Kbuild: fix # escaping in .cmd files for future Make 2018-04-11 00:03:02 +09:00
spi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
testing Various fixes to the tracing infrastructure: 2018-07-27 09:50:33 -07:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-03-27 09:51:23 +02:00
time
usb tools: usb: ffs-test: Fix build on big endian systems 2018-07-17 10:12:51 +03:00
virtio sg: remove ->sg_magic member 2018-06-29 08:48:06 -06:00
vm mm: mark pages in use for page tables 2018-06-07 17:34:37 -07:00
wmi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
Makefile