This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Systemtap translator support for hw breakpoints on x86


On Fri, Jan 08, 2010 at 10:21:12AM -0500, Frank Ch. Eigler wrote:
> Prerna Saxena <prerna@linux.vnet.ibm.com> writes:
<snipped>
> 
> > [...]  For now, I had designed the probes to error out if a user
> > defined a length that was not supported by architecture (eg a length
> > 3 on x86, as this supports lengths like 1,2,4 bytes only) [...]
> 
> My concern with the above was not the script language interface or
> mappings, but only the cleanliness / simplicity of the generated code.
> If the translator neglects to filter out unsupported lengths, and the
> generated code propagates the value 3, will the kernel's registration
> function check and reject such requests at run time?  If so, then
> there is no need for the generated code to contain preemptive checks /
> filters / error messages.  Just let it listen to the result code from
> the kernel's registration function.
> 
> As to having the translator filter for parameters expected to be
> valid, that is fine, but those checks need not show up redundantly in
> generated C code.
>

The hw-breakpoint API for registration returns success only after a
successful sanity check for alignment, breakpoint length (supported or
not), improper addresses (user vs kernel-space) among a few others.

So unless the translator wants to show more meaningful error messages
that states the exact cause (given that the bkpt API will return -EINVAL
in all of these cases), it can rely upon the kernel's registration
function.

Thanks,
K.Prasad
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]