This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC] [PATCH] Add statement ranges to kernel.statement
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: Stan Cox <scox at redhat dot com>
- Cc: SystemTap List <systemtap at sources dot redhat dot com>
- Date: Fri, 20 Jun 2008 15:16:18 -0700
- Subject: Re: [RFC] [PATCH] Add statement ranges to kernel.statement
- References: <1213989653.25984.15.camel@multics.rdu.redhat.com>
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