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


Groups > linux.kernel > #1727043 > unrolled thread

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

Started byTom Zanussi <tom.zanussi@linux.intel.com>
First post2017-09-06 00:10 +0200
Last post2017-09-06 00:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 36/40] tracing: Remove lookups from tracing_map hitcount Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-06 00:10 +0200

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

FromTom Zanussi <tom.zanussi@linux.intel.com>
Date2017-09-06 00:10 +0200
Subject[PATCH v2 36/40] tracing: Remove lookups from tracing_map hitcount
Message-ID<umucH-oz-63@gated-at.bofh.it>
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);
 				return entry->val;
 			} else if (unlikely(!entry->val)) {
 				/*
-- 
1.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web