Thread (90 messages) 90 messages, 8 authors, 2017-09-21
STALE3175d
Revisions (7)
  1. v2 current
  2. v4 [diff vs current]
  3. v5 [diff vs current]
  4. v6 [diff vs current]
  5. v7 [diff vs current]
  6. v8 [diff vs current]
  7. v9 [diff vs current]

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

From: Tom Zanussi <hidden>
Date: 2017-09-05 22:01:13
Also in: lkml
Subsystem: the rest, tracing · Maintainers: Linus Torvalds, Steven Rostedt, Masami Hiramatsu

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 <redacted>
---
 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);
 				return entry->val;
 			} else if (unlikely(!entry->val)) {
 				/*
-- 
1.9.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help