callgraph

runtime callgraph generator
git clone git://git.2f30.org/callgraph
Log | Files | Refs | README | LICENSE

commit ce1bf7b0423244d600ef309d7589e051aafe9a89
parent a600f2ed91ca4f369fb22fa242dc7e48ef40567b
Author: lostd <lostd@2f30.org>
Date:   Thu, 14 Nov 2013 18:51:05 +0200

Change types that hold/print addresses: s/64/ptr/

Diffstat:
Mcallgraph.c | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/callgraph.c b/callgraph.c @@ -12,12 +12,12 @@ #include <assert.h> struct fnode_t { - uint64_t addr; + uintptr_t addr; struct fnode_t *next; }; struct fpair_t { - uint64_t l, r; /* l is the caller, r is the callee */ + uintptr_t l, r; /* l is the caller, r is the callee */ struct fpair_t *next; }; @@ -95,7 +95,7 @@ deinit_logging(void) p = fpair_head; while (p) { snprintf(logbuf, sizeof logbuf, - "\t \"%"PRIx64"\" -> \"%"PRIx64"\"\n", p->l, p->r); + "\t \"%"PRIxPTR"\" -> \"%"PRIxPTR"\"\n", p->l, p->r); writelog(fd, logbuf, strlen(logbuf)); p = p->next; } @@ -120,7 +120,7 @@ deinit_logging(void) } static void -push_fnode(uint64_t addr) +push_fnode(uintptr_t addr) { if (!fnode_head) { fnode_head = xmalloc(sizeof(struct fnode_t)); @@ -156,7 +156,7 @@ get_top(void) { } static void -add_fpair(uint64_t r) +add_fpair(uintptr_t r) { struct fnode_t *curfun; @@ -183,8 +183,9 @@ __cyg_profile_func_enter(void *func_address, struct fnode_t *n; n = get_top(); - if (n) add_fpair((uint64_t)func_address); - push_fnode((uint64_t)func_address); + if (n) + add_fpair((uintptr_t)func_address); + push_fnode((uintptr_t)func_address); } void