perf list segfaults on the v4.4-rc8 (bisect log added)

From: Srikar Dronamraju
Date: Fri Jan 08 2016 - 15:39:55 EST

With latest mainline perf, perf list results in a Segmentation fault on
a powerpc machine.

$ ./perf list
Segmentation fault (core dumped)

git bisect start
# bad: [02006f7a7a715af10974a30b7ad8e6ee340f954c] Merge branch 'drm-fixes' of git://
git bisect bad 02006f7a7a715af10974a30b7ad8e6ee340f954c
# good: [9fb4765451f22c5e782c1590747717550bff34b2] perf tools: Fix build break on powerpc due to sample_reg_masks
git bisect good 9fb4765451f22c5e782c1590747717550bff34b2
# bad: [e880e87488d5bbf630dd716e6de8a53585614568] Merge tag 'driver-core-4.4-rc1' of git://
git bisect bad e880e87488d5bbf630dd716e6de8a53585614568
# bad: [b0f85fa11aefc4f3e03306b4cd47f113bd57dcba] Merge git://
git bisect bad b0f85fa11aefc4f3e03306b4cd47f113bd57dcba
# good: [c0859e2f4ca530c0bf6a333ca3eb8430008e62c9] Bluetooth: btmrvl: add missing of_node_put
git bisect good c0859e2f4ca530c0bf6a333ca3eb8430008e62c9
# good: [105ff3cbf225036b75a6a46c96d1ddce8e7bdc66] atomic: remove all traces of READ_ONCE_CTRL() and atomic*_read_ctrl()
git bisect good 105ff3cbf225036b75a6a46c96d1ddce8e7bdc66
# good: [ccc9d4a6d640cbde05d519edeb727881646cf71b] Merge branch 'linus' of git://
git bisect good ccc9d4a6d640cbde05d519edeb727881646cf71b
# bad: [371e59adcebf9953385bf46d5325ac39a53c5520] switchdev: Make flood to CPU optional
git bisect bad 371e59adcebf9953385bf46d5325ac39a53c5520
# bad: [c1ab3f1dea3df566ad38caf98baf69c656679090] tipc: make struct tipc_link generic to support broadcast
git bisect bad c1ab3f1dea3df566ad38caf98baf69c656679090
# bad: [c7fc9eb79a89049214f9870a6cf978050aaea43a] net: hisilicon: deals with the sub ctrl by syscon
git bisect bad c7fc9eb79a89049214f9870a6cf978050aaea43a
# good: [eb9fae328faff9807a4ab5c1834b19f34dd155d4] Merge branch 'tcp-rack'
git bisect good eb9fae328faff9807a4ab5c1834b19f34dd155d4
# bad: [721daebbdb9ba44756a9695878ecca8aad38009b] Merge branch 'bpf-perf'
git bisect bad 721daebbdb9ba44756a9695878ecca8aad38009b
# good: [844338e5a46f5d80566fa853c6168a78cdadab01] ARM: gemini: remove unnecessary mdio-gpio includes
git bisect good 844338e5a46f5d80566fa853c6168a78cdadab01
# good: [63b11e757d6dae570bc22450ec58a5b68cdf5c3c] ipvlan: read direct ifindex instead of iflink
git bisect good 63b11e757d6dae570bc22450ec58a5b68cdf5c3c
# bad: [a43eec304259a6c637f4014a6d4767159b6a3aa3] bpf: introduce bpf_perf_event_output() helper
git bisect bad a43eec304259a6c637f4014a6d4767159b6a3aa3
# good: [fa128e6a148a0a58355bd6814c6283515bbd028a] perf: pad raw data samples automatically
git bisect good fa128e6a148a0a58355bd6814c6283515bbd028a
# first bad commit: [a43eec304259a6c637f4014a6d4767159b6a3aa3] bpf: introduce bpf_perf_event_output() helper

I have done a clean build with fa128e6a148a0a58355bd6814c6283515bbd028a
(which is a43eec304259a6c637f4014a6d4767159b6a3aa3's parent) to verify
that the problem indeed occurs with this patch.

Attached is the patch that causes this issue for quick reference.