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] [PATCH] Add statement ranges to kernel.statement


Hi Stan,

This looks good -- I have just a few comments:

Stan Cox wrote:
> This adds two types of statement ranges to kernel.statement:
>  kernel.statement("bio_put@fs/bio.c:*")
>  kernel.statement("bio_put@fs/bio.c:212-219"

Can you make this work for the relative syntax?  I would imagine that
"+*" should work identically to ":*", and "+1-42" seems reasonable too.

> +	if (line_type == WILDCARD || line_type == RANGE)
> +	  {
> +	    Dwarf_Addr line_addr;
> +	    dwarf_lineno (srcsp [0], &lineno);
> +	    if (lineno != l)
> +	      continue;
> +	    dwarf_lineaddr (srcsp [0], &line_addr);
> +	    if (dwarf_haspc (function, line_addr) != 1)
> +	      break;
> +	  }

It wasn't obvious to me what this is trying to check, so I would
appreciate a brief explanation in comments.

Also, when the specified range is out of bounds, it should probably
throw an error.

> +	if (line_type != WILDCARD && l == lines[1])
> +	  break;
> +      }

I think this will break for relative probes, because the incoming
lines[2] are relative, but 'l' is absolute.


Hope that's helpful...

Josh


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