From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757592AbcCCNPi (ORCPT ); Thu, 3 Mar 2016 08:15:38 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:39674 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbcCCNPf (ORCPT ); Thu, 3 Mar 2016 08:15:35 -0500 To: , , , , , CC: , , , From: Hekuang Subject: [BUG ARM64/perf] Perf record on hardware breakpoint causes application to hang Message-ID: <56D83771.2090101@huawei.com> Date: Thu, 3 Mar 2016 21:09:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.110.55.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.56D8388C.0063,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b2fa2a27fa2c94113d0dcd171f34b63d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This problem can be reproduced as follows: We know cat /proc/version will read the memory of symbol linux_proc_banner, then we make a hardware memory access breakpoint on that address. on terminal 1: $ perf record -e mem:0x$(cat /proc/kallsyms|grep linux_proc_banner|cut -d " " -f 1):rw --no-buffer -a on terminal 2: $ cat /proc/version Then our 'cat' process on terminal 2 will be hanged, until we press '^C' to stop perf from recording events. The sample numbers recorded by perf is extraordinary too: [ perf record: Captured and wrote 0.879 MB perf.data (22691 samples) ] The right result can be produced by removing the 'no-buffer' argument in perf command line, and the result should be like this: $ perf record -e mem:0x$(cat /proc/kallsyms|grep linux_proc_ banner|cut -d " " -f 1):rw -a ^C [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.013 MB perf.data (10 samples) ] Report this bug to you and hope for answers. Thanks.