From: Philippe E. <ph...@us...> - 2003-10-26 00:26:41
|
Update of /cvsroot/oprofile/oprofile/daemon In directory sc8-pr-cvs1:/tmp/cvs-serv21081/daemon Modified Files: opd_cookie.c opd_cookie.h opd_sfile.c opd_sfile.h opd_trans.c opd_util.c opd_util.h Log Message: dae/ daemon/ s/filtered/ignored/ Index: opd_cookie.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_cookie.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -p -d -r1.5 -r1.6 --- opd_cookie.c 25 Oct 2003 23:40:46 -0000 1.5 +++ opd_cookie.c 26 Oct 2003 00:21:07 -0000 1.6 @@ -61,7 +61,7 @@ static inline int lookup_dcookie(cookie_ struct cookie_entry { cookie_t value; char * name; - int filtered; + int ignored; struct list_head list; }; @@ -86,9 +86,9 @@ static struct cookie_entry * create_cook cookie, errno); free(entry->name); entry->name = NULL; - entry->filtered = 0; + entry->ignored = 0; } else { - entry->filtered = is_image_filtered(entry->name); + entry->ignored = is_image_ignored(entry->name); } return entry; @@ -124,7 +124,7 @@ out: } -int is_cookie_filtered(cookie_t cookie) +int is_cookie_ignored(cookie_t cookie) { unsigned long hash = hash_cookie(cookie); struct list_head * pos; @@ -136,9 +136,10 @@ int is_cookie_filtered(cookie_t cookie) goto out; } - return 0; + /* The cookie isn't found. We assume it's ignored. */ + return 1; out: - return entry->filtered; + return entry->ignored; } Index: opd_cookie.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_cookie.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -p -d -r1.14 -r1.15 --- opd_cookie.h 25 Oct 2003 23:40:47 -0000 1.14 +++ opd_cookie.h 26 Oct 2003 00:21:07 -0000 1.15 @@ -27,8 +27,8 @@ typedef unsigned long long cookie_t; */ char const * find_cookie(cookie_t cookie); -/** return non zero if we must record sample for this cookie */ -int is_cookie_filtered(cookie_t cookie); +/** return true if this cookie should be ignored */ +int is_cookie_ignored(cookie_t cookie); /** give a textual description of the cookie */ char const * verbose_cookie(cookie_t cookie); Index: opd_sfile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_sfile.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -p -d -r1.10 -r1.11 --- opd_sfile.c 25 Oct 2003 23:40:47 -0000 1.10 +++ opd_sfile.c 26 Oct 2003 00:21:07 -0000 1.11 @@ -137,14 +137,14 @@ create_sfile(struct transient const * tr if (separate_kernel || (separate_lib && !ki)) sf->app_cookie = trans->app_cookie; - sf->filtered = 0; + sf->ignored = 1; if (separate_lib && trans->app_cookie != INVALID_COOKIE) - sf->filtered = is_cookie_filtered(trans->app_cookie); - if (!sf->filtered) { + sf->ignored = is_cookie_ignored(trans->app_cookie); + if (sf->ignored) { if (!ki) - sf->filtered = is_cookie_filtered(trans->cookie); + sf->ignored = is_cookie_ignored(trans->cookie); else - sf->filtered = is_image_filtered(ki->name); + sf->ignored = is_image_ignored(ki->name); } return sf; Index: opd_sfile.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_sfile.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -p -d -r1.4 -r1.5 --- opd_sfile.h 25 Oct 2003 23:40:47 -0000 1.4 +++ opd_sfile.h 26 Oct 2003 00:21:07 -0000 1.5 @@ -48,8 +48,8 @@ struct sfile { struct list_head hash; /** lru list */ struct list_head lru; - /** non zero if samples must be filtered */ - int filtered; + /** true if this file should be ignored in profiles */ + int ignored; /** opened sample files */ samples_odb_t files[OP_MAX_COUNTERS]; }; Index: opd_trans.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_trans.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -p -d -r1.4 -r1.5 --- opd_trans.c 25 Oct 2003 23:40:47 -0000 1.4 +++ opd_trans.c 26 Oct 2003 00:21:07 -0000 1.5 @@ -89,8 +89,10 @@ static void opd_put_sample(struct transi if (!trans->current) return; - if (trans->current->filtered) - sfile_log_sample(trans->current, trans->pc, event); + if (trans->current->ignored) + return; + + sfile_log_sample(trans->current, trans->pc, event); } Index: opd_util.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_util.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -p -d -r1.11 -r1.12 --- opd_util.c 25 Oct 2003 23:40:47 -0000 1.11 +++ opd_util.c 26 Oct 2003 00:21:07 -0000 1.12 @@ -383,13 +383,13 @@ static void opd_parse_image_filter(void) } -int is_image_filtered(char const * name) +int is_image_ignored(char const * name) { size_t hash; struct list_head * pos; if (!binary_name_filter) - return 1; + return 0; hash = opd_hash_name(name); @@ -397,10 +397,10 @@ int is_image_filtered(char const * name) struct opd_hashed_name * hashed_name = list_entry(pos, struct opd_hashed_name, next); if (!strcmp(hashed_name->name, name)) - return 1; + return 0; } - return 0; + return 1; } Index: opd_util.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/daemon/opd_util.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -p -d -r1.8 -r1.9 --- opd_util.h 25 Oct 2003 23:40:47 -0000 1.8 +++ opd_util.h 26 Oct 2003 00:21:07 -0000 1.9 @@ -66,13 +66,12 @@ size_t opd_hash_name(char const * name); /** - * is_image_filtered - check if we must profile this image - * @param name the name to check + * is_image_ignored - check if we must ignore this image + * @param name the name to check * - * return non zero if name has been specified through --image= option or user - * didn't ask for image filtering + * Return true if the image should not be profiled */ -int is_image_filtered(char const * name); +int is_image_ignored(char const * name); /** |