]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
tracing: Remove lookups from tracing_map hitcount
authorTom Zanussi <tom.zanussi@linux.intel.com>
Fri, 22 Sep 2017 19:58:18 +0000 (14:58 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 4 Oct 2017 17:05:42 +0000 (13:05 -0400)
Lookups inflate the hitcount, making it essentially useless.  Only
inserts and updates should really affect the hitcount anyway, so
explicitly filter lookups out.

Link: http://lkml.kernel.org/r/c8d9dc39d269a8abf88bf4102d0dfc65deb0fc7f.1506105045.git.tom.zanussi@linux.intel.com
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/tracing_map.c

index 305039b122fafba242f73b5982289ce4a12a6e20..07e75344725ba254f5c42a314659142f0fd48528 100644 (file)
@@ -428,7 +428,8 @@ __tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only)
 
                if (test_key && test_key == key_hash && entry->val &&
                    keys_match(key, entry->val->key, map->key_size)) {
-                       atomic64_inc(&map->hits);
+                       if (!lookup_only)
+                               atomic64_inc(&map->hits);
                        return entry->val;
                }