On Wed, Nov 16, 2011 at 5:23 AM, Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> wrote: > Hi, > > Is it possible to ask "graph" to generate a call graph of all calls > from main() to specific function? If "graph" does not support it (I > suspect so after looking at graph.c), could you please give me a few > hints how to do it? I'm completely new to sparse. Hi Duy, In order to find out all the call graphs, you need to at least run very file in sparse. Then for each function, after linearization, you can find out all the "call" instruction. A easier but not so precise way is examine the "access" list in the entry point. That will include every symbol rather than just function called. e.g. struct entrypoint *ep; pseudo_t p; expand_symbol(sym); ep = linearize_symbol(sym); FOR_EACH_PTR(ep->accesses, p) { printf(" pseudo: %p type %d %s\n", p, p->type, show_pseudo(p)); } END_FOR_EACH_PTR(p); You just filter out the non-function symbols. However you need to write some code to do that recursively. Hope that helps. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html