Em Sun, Aug 14, 2005 at 01:01:17AM -0300, Arnaldo Carvalho de Melo escreveu:
> > What alternative preprocessor output stuff do you want, anyway?
>
> Its a hack in the ostra thing, but don't even try to look at it at this
> point, you would be way more disgusted, so can I submit a changeset calling
> the preprocessor with the whole list of tokens?
Describing the _need_ not the implementation that uses a huge hack using
this list of tokens:
ostra-patch is a tool that inserts hooks in functions that meet some
criteria, currently this criteria is "does this function receive an
argument of type struct foo *?", quick example:
int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
{
... implementation ...
}
Meets this criteria, so I change it to:
int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
{
int __ostra_tcp_transmit_skb_ret;
int __ostra_do_ret = ostra_entry_hook(function_id, sk,
list-of-collected-fields);
... implementation ...
__ostra_tcp_transmit_skb_ret = existing_return_expression;
if (__ostra_ret)
ostra_exit_hook(function_id, sk);
return __ostra_tcp_transmit_skb_ret;
}
The hack-from-hell-don't-look-at-it-with-an-empty-stomach proof of concept
implementation for ostra-patch traverses the token list returned by sparse
to do this source patching when one uses "make CC=ostra-patch", this is
the idea, the implementation surely is just a hack right now.
Yes, I know about kprobes and in fact I'm using it as well in another tool,
but with source patching I can do more things, like see the exact exit
point in functions with more than one return, etc and anyway, the proof
of concept works and with some other tools to process the collected data
I already get very nice things such as this callgraph:
http://oops.ghostprotocols.net:81/ostra/ostra-trace-of-scp-linux-2.6.11.tar.bz2-to-master.kernel.org/
- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html