From: John L. <mov...@us...> - 2005-05-26 00:00:11
|
Update of /cvsroot/oprofile/oprofile/daemon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9931/daemon Modified Files: opd_cookie.c opd_sfile.c opd_trans.c Log Message: image filtering fixes Index: opd_cookie.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_cookie.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -p -d -r1.18 -r1.19 --- opd_cookie.c 2 May 2005 15:06:57 -0000 1.18 +++ opd_cookie.c 26 May 2005 00:00:02 -0000 1.19 @@ -148,7 +148,7 @@ int is_cookie_ignored(cookie_t cookie) struct cookie_entry * entry; if (cookie == INVALID_COOKIE || cookie == NO_COOKIE) - return 0; + return 1; list_for_each(pos, &hashes[hash]) { entry = list_entry(pos, struct cookie_entry, list); Index: opd_sfile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_sfile.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -p -d -r1.34 -r1.35 --- opd_sfile.c 9 May 2005 14:43:34 -0000 1.34 +++ opd_sfile.c 26 May 2005 00:00:02 -0000 1.35 @@ -134,6 +134,29 @@ sfile_equal(struct sfile const * sf, str } +static int +is_sf_ignored(struct sfile const * sf) +{ + if (sf->kernel) { + if (!is_image_ignored(sf->kernel->name)) + return 0; + + /* Let a dependent kernel image redeem the sf if we're + * executing on behalf of an application. + */ + return is_cookie_ignored(sf->app_cookie); + } + + /* Anon regions are always dependent on the application. + * Otherwise, let a dependent image redeem the sf. + */ + if (sf->anon || is_cookie_ignored(sf->cookie)) + return is_cookie_ignored(sf->app_cookie); + + return 0; +} + + /** create a new sfile matching the current transient parameters */ static struct sfile * create_sfile(unsigned long hash, struct transient const * trans, @@ -174,14 +197,7 @@ create_sfile(unsigned long hash, struct if (separate_kernel || ((trans->anon || separate_lib) && !ki)) sf->app_cookie = trans->app_cookie; - if (!ki) - sf->ignored = is_cookie_ignored(sf->cookie); - else - sf->ignored = is_image_ignored(ki->name); - - /* give a dependent sfile a chance to redeem itself */ - if (sf->ignored && sf->app_cookie != INVALID_COOKIE) - sf->ignored = is_cookie_ignored(sf->app_cookie); + sf->ignored = is_sf_ignored(sf); return sf; } Index: opd_trans.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_trans.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -p -d -r1.11 -r1.12 --- opd_trans.c 2 May 2005 15:06:58 -0000 1.11 +++ opd_trans.c 26 May 2005 00:00:02 -0000 1.12 @@ -123,7 +123,8 @@ static void opd_put_sample(struct transi if (!trans->current) goto out; - if (trans->current->ignored) + /* FIXME: this logic is perhaps too harsh? */ + if (trans->current->ignored || (trans->last && trans->last->ignored)) goto out; /* log the sample or arc */ |