Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730609

Re: [PATCH v2 36/40] tracing: Remove lookups from tracing_map hitcount

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 36/40] tracing: Remove lookups from tracing_map hitcount
Date 2017-09-12 04:20 +0200
Message-ID <uoIXT-3tO-1@gated-at.bofh.it> (permalink)
References <umu2Z-5m-5@gated-at.bofh.it> <umucH-oz-63@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Tom,

On Tue,  5 Sep 2017 16:57:48 -0500
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:

> Lookups inflate the hitcount, making it essentially useless.  Only
> inserts and updates should really affect the hitcount anyway, so
> explicitly filter lookups out.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> ---
>  kernel/trace/tracing_map.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c
> index a4e5a56..f8e2338 100644
> --- a/kernel/trace/tracing_map.c
> +++ b/kernel/trace/tracing_map.c
> @@ -538,7 +538,8 @@ static inline bool keys_match(void *key, void *test_key, unsigned key_size)
>  		if (test_key && test_key == key_hash) {
>  			if (entry->val &&
>  			    keys_match(key, entry->val->key, map->key_size)) {
> -				atomic64_inc(&map->hits);
> +				if (!lookup_only)
> +					atomic64_inc(&map->hits);

Is this a kind of bugfix for current code?
If so, such patch can be posted in separate series.

Thank you,

>  				return entry->val;
>  			} else if (unlikely(!entry->val)) {
>  				/*
> -- 
> 1.9.3
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 36/40] tracing: Remove lookups from tracing_map  hitcount Masami Hiramatsu <mhiramat@kernel.org> - 2017-09-12 04:20 +0200
  Re: [PATCH v2 36/40] tracing: Remove lookups from tracing_map  hitcount Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-12 16:20 +0200

csiph-web