All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wang, Yalin" <Yalin.Wang@sonymobile.com>
To: 'Will Deacon' <will.deacon@arm.com>
Cc: "'linux-mmc@vger.kernel.org'" <linux-mmc@vger.kernel.org>,
	"'linux-arch-owner@vger.kernel.org'"
	<linux-arch-owner@vger.kernel.org>
Subject: RE: how to creat watchpoint  in kernel for data access debug
Date: Wed, 4 Jun 2014 11:05:03 +0800	[thread overview]
Message-ID: <35FD53F367049845BC99AC72306C23D1029A27656A2F@CNBJMBX05.corpusers.net> (raw)
In-Reply-To: <20140603164512.GT23149@arm.com>

Hi  Will,

Thanks for your proposal,
The patch google made is just like
The one I tried before ,
Then the problems come :
After register the perf_event callback,
In the callback function ,
In google's patch , it is  function crbug_345917_handler( ),
It just call panic( ) ,
But My callback function will do some check ,
Sometimes, I want to bypass this time's breakpoint,
Problems is that I don't know how to bypass it,
If I return directly in the callback function ,
The breakpoint will trap again and again endless ..

Thank you very much .


-----Original Message-----
From: Will Deacon [mailto:will.deacon@arm.com] 
Sent: Wednesday, June 04, 2014 12:45 AM
To: Wang, Yalin
Cc: 'linux-mmc@vger.kernel.org'; 'linux-arch-owner@vger.kernel.org'
Subject: Re: how to creat watchpoint in kernel for data access debug

On Sat, May 24, 2014 at 04:48:20AM +0100, Wang, Yalin wrote:
> Hi  Will,

Hello,

Sorry for the delayed reply, it took me a while to work out what your issue is.

> Thanks for your suggestion,
> The scenario that I encounter is a little special :
> I found our kernel memory will be corrupt in stability test , Seems 
> that someone write a memory that doesn't belong to it .
> But I can't find who does it , the bug is hard to reproduce , So I 
> want make a debug SW in kernel , which can monitor some data access, 
> When someone access it , the callback function can check if it's right .
> If it's wrong, then crash the kernel do get a ram dump .
> 
> 
> So kgdb or perf seems not suitable in this condition , We need users 
> to use devices, not just test the device in Lab .

I think Google did something similar to this with ChromeOS on the Exynos5-based chromebooks:

  https://chromium-review.googlesource.com/#/c/188479/3/arch/arm/kernel/hw_breakpoint.c

I don't think that has a place in the mainline kernel, but you could certainly adapt it for your debugging purposes.

Will

  reply	other threads:[~2014-06-04  3:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  2:50 (unknown), Wang, Yalin
2014-05-23  2:51 ` how to creat watchpoint in kernel for data access debug Wang, Yalin
2014-05-23 13:45   ` Will Deacon
2014-05-24  3:48     ` Wang, Yalin
2014-06-03 16:45       ` Will Deacon
2014-06-04  3:05         ` Wang, Yalin [this message]
2014-06-04 18:01           ` Will Deacon
2014-06-05  3:40             ` Wang, Yalin
2014-06-16 12:55               ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35FD53F367049845BC99AC72306C23D1029A27656A2F@CNBJMBX05.corpusers.net \
    --to=yalin.wang@sonymobile.com \
    --cc=linux-arch-owner@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.