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: [PATCH] Fix sematic error: empty struct


On Fri, 2008-06-27 at 14:13 -0400, Frank Ch. Eigler wrote:
> Hi -
> 
> By the way, for the $qc->scsi.... expression problem in the first
> case, did you consider/try using embedded-C code to do the pointer
> dereferencing?

Yes, but it's a completely awful solution ... it's also what led to the
crashes on FC9.

If a structure is resolvable it should be usable via the systemtap
language.  Users complain enough about the interface anyway, telling
them they have to use ad hoc C fragment constructions in certain cases
they won't even be able to distinguish until they run into them is a
recipe for usability problems.

> as in:
> 
> %{
> #include "linux/scsi-whatever."
> %}
> function filter_p:long (ptr:long)  %{ 
>    struct scsi_device* q = (struct scsi_device*) THIS->ptr;

Actually, it has to be

struct scsi_device* q = (struct scsi_device*)(unsigned long) THIS->ptr;

because of systemtap and C on x86 differning on the sizeof long.

>    THIS->__retvalue = (q->scsicmd->.... & ... );
> %}
> 
> probe module("libata").function("ata_qc_issue") {
>    if (filter_p ($qc)) next;
> }

James



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