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


Groups > linux.kernel > #1737792

[PATCH 4/9] tracing: Remove lookups from tracing_map hitcount

From Tom Zanussi <tom.zanussi@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 4/9] tracing: Remove lookups from tracing_map hitcount
Date 2017-09-22 22:00 +0200
Message-ID <usChd-1IF-25@gated-at.bofh.it> (permalink)
References <usChc-1IF-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 305039b..07e7534 100644
--- a/kernel/trace/tracing_map.c
+++ b/kernel/trace/tracing_map.c
@@ -428,7 +428,8 @@ static inline bool keys_match(void *key, void *test_key, unsigned key_size)
 
 		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;
 		}
 
-- 
1.9.3

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


Thread

[PATCH 0/9] tracing: Bug fixes and minor cleanup Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:00 +0200
  [PATCH 5/9] tracing: Increase tracing map KEYS_MAX size Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:00 +0200
  [PATCH 3/9] tracing: Exclude 'generic fields' from histograms Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:00 +0200
  [PATCH 1/9] tracing: Steve's unofficial trace_recursive_lock() patch Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:00 +0200
  [PATCH 4/9] tracing: Remove lookups from tracing_map hitcount Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:00 +0200
  [PATCH 9/9] tracing: Reimplement log2 Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:10 +0200
  [PATCH 7/9] tracing: Clean up hist_field_flags enum Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:10 +0200
  [PATCH 8/9] tracing: Add hist_field_name() accessor Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:10 +0200
  [PATCH 2/9] tracing: Reverse the order of trace_types_lock and event_mutex Tom Zanussi <tom.zanussi@linux.intel.com> - 2017-09-22 22:20 +0200

csiph-web