From: John L. <mov...@us...> - 2005-04-24 18:51:48
|
Update of /cvsroot/oprofile/oprofile/daemon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4058/daemon Modified Files: Tag: BRANCH_ANON_MAPPING opd_mangling.c opd_sfile.c opd_sfile.h opd_trans.c Log Message: several more fixes Index: opd_mangling.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_mangling.c,v retrieving revision 1.20.4.3 retrieving revision 1.20.4.4 diff -u -p -d -r1.20.4.3 -r1.20.4.4 --- opd_mangling.c 24 Apr 2005 10:47:45 -0000 1.20.4.3 +++ opd_mangling.c 24 Apr 2005 18:51:39 -0000 1.20.4.4 @@ -139,6 +139,7 @@ int opd_open_sample_file(odb_t * file, s { char * mangled; char const * binary; + vma_t last_start = 0; int err; mangled = mangle_filename(last, sf, counter, cg); @@ -176,9 +177,11 @@ retry: else binary = sf->kernel->name; + if (last && last->anon) + last_start = last->anon->start; + fill_header(odb_get_data(file), counter, - sf->anon ? sf->anon->start : 0, - last->anon ? last->anon->start : 0, + sf->anon ? sf->anon->start : 0, last_start, !!sf->kernel, last ? !!last->kernel : 0, binary ? op_get_mtime(binary) : 0); Index: opd_sfile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_sfile.c,v retrieving revision 1.29.4.3 retrieving revision 1.29.4.4 diff -u -p -d -r1.29.4.3 -r1.29.4.4 --- opd_sfile.c 24 Apr 2005 09:40:33 -0000 1.29.4.3 +++ opd_sfile.c 24 Apr 2005 18:51:39 -0000 1.29.4.4 @@ -230,11 +230,17 @@ lru: static void init_cg_id(cg_id * id, struct sfile const * sf) { id->cookie = sf->cookie; - id->start = 0; - id->end = (vma_t)-1; + id->kernel = !!sf->kernel; + id->anon = !!sf->anon; if (sf->kernel) { id->start = sf->kernel->start; id->end = sf->kernel->end; + } else if (sf->anon) { + id->start = sf->anon->start; + id->end = sf->anon->end; + } else { + id->start = 0; + id->end = (vma_t)-1; } } @@ -266,10 +272,13 @@ get_file(struct transient const * trans, size_t hash = cg_hash(last->cookie, sf->cookie, trans->event); struct list_head * pos; list_for_each(pos, &sf->cg_files[hash]) { - // FIXME: anon temp = list_entry(pos, struct cg_hash_entry, next); if (temp->from.cookie == sf->cookie && temp->to.cookie == last->cookie && + temp->from.kernel == !!sf->kernel && + temp->to.kernel == !!last->kernel && + temp->from.anon == !!sf->anon && + temp->to.anon == !!last->anon && from >= temp->from.start && from < temp->from.end && to >= temp->to.start && to < temp->to.end && temp->counter == trans->event) @@ -446,8 +455,9 @@ static void sfile_clear(int kernel) list_for_each_safe(pos, pos2, &sf->cg_files[i]) { struct cg_hash_entry * cg = list_entry(pos, struct cg_hash_entry, next); - // FIXME - if (cg->from.start || cg->to.start) + int kern = (cg->from.kernel || cg->to.kernel); + int anon = (cg->from.anon || cg->to.anon); + if ((kernel && kern) || (!kernel && anon)) kill_cg_file(cg); } } Index: opd_sfile.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_sfile.h,v retrieving revision 1.9.4.1 retrieving revision 1.9.4.2 diff -u -p -d -r1.9.4.1 -r1.9.4.2 --- opd_sfile.h 24 Apr 2005 06:46:25 -0000 1.9.4.1 +++ opd_sfile.h 24 Apr 2005 18:51:39 -0000 1.9.4.2 @@ -29,9 +29,13 @@ struct transient; typedef struct { /* cookie or INVALID_COOKIE */ cookie_t cookie; - /* 0 if cookie is valid or module start address */ + /* is kernel */ + int kernel; + /* is anon region */ + int anon; + /* 0 if cookie is valid or start address */ vma_t start; - /* (vma_t)-1 if cookie is valid or module end address */ + /* (vma_t)-1 if cookie is valid or end address */ vma_t end; } cg_id; Index: opd_trans.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_trans.c,v retrieving revision 1.10.4.1 retrieving revision 1.10.4.2 diff -u -p -d -r1.10.4.1 -r1.10.4.2 --- opd_trans.c 24 Apr 2005 06:46:26 -0000 1.10.4.1 +++ opd_trans.c 24 Apr 2005 18:51:39 -0000 1.10.4.2 @@ -95,7 +95,7 @@ static void opd_put_sample(struct transi /* * can happen if kernel sample falls through the cracks, or if - * it's a sample from an anon region + * it's a sample from an anon region we couldn't find */ if (!trans->current) goto out; |