From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751978AbcAEIxn (ORCPT ); Tue, 5 Jan 2016 03:53:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44469 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbcAEIxl (ORCPT ); Tue, 5 Jan 2016 03:53:41 -0500 Date: Tue, 5 Jan 2016 09:53:38 +0100 From: Jiri Olsa To: Wang Nan Cc: will.deacon@arm.com, takahiro.akashi@linaro.org, guohanjun@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, fengguang.wu@intel.com, pi3orama@163.com, Jiri Olsa , Arnaldo Carvalho de Melo Subject: Re: [RFC PATCH] arm64: perf test: Improbe bp_signal Message-ID: <20160105085338.GB2192@krava.brq.redhat.com> References: <20160104165535.GI1616@arm.com> <1451969880-14877-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1451969880-14877-1-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 05, 2016 at 04:58:00AM +0000, Wang Nan wrote: SNIP > diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c > index fb80c9e..0bc4f76 100644 > --- a/tools/perf/tests/bp_signal.c > +++ b/tools/perf/tests/bp_signal.c > @@ -29,14 +29,55 @@ > > static int fd1; > static int fd2; > +static int fd3; > static int overflows; > +static int overflows_2; > + > +volatile long the_var; > + > + please put comment in here explaning the assembly is used to have watchpoint and breakpoint on single instruction IIUC ;-) thanks, jirka > +#if defined (__x86_64__) > +extern void __test_function(volatile long *ptr); > +asm ( > + ".globl __test_function\n" > + "__test_function:\n" > + "incq (%rdi)\n" > + "ret\n"); > +#elif defined (__aarch64__) > +extern void __test_function(volatile long *ptr); > +asm ( > + ".globl __test_function\n" > + "__test_function:\n" > + "str x30, [x0]\n" > + "ret\n"); > + > +#else > +static void __test_function(volatile long *ptr) > +{ > + *ptr++; > +} > +#endif > > __attribute__ ((noinline)) > static int test_function(void) > { > + __test_function(&the_var); > + the_var++; > return time(NULL); > } SNIP