[RFC] [PATCH] Add statement ranges to kernel.statement
Stone, Joshua I
joshua.i.stone@intel.com
Sat Jun 21 14:27:00 GMT 2008
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
More information about the Systemtap
mailing list