diff options
| author | Marius Strobl <marius@FreeBSD.org> | 2017-05-14 14:21:11 +0000 |
|---|---|---|
| committer | Marius Strobl <marius@FreeBSD.org> | 2017-05-14 14:21:11 +0000 |
| commit | 6781118ae0face75fa487cf50263948b9d24b925 (patch) | |
| tree | 9b7a7da29aabef3116f921e038e19e7023283d89 | |
| parent | 34db7e0114ad2675ac0b2ad21b7508d4ad483092 (diff) | |
Notes
| -rw-r--r-- | sys/kern/subr_kobj.c | 12 | ||||
| -rw-r--r-- | sys/sys/kobj.h | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/sys/kern/subr_kobj.c b/sys/kern/subr_kobj.c index 5be746ad00a7..15a7b8ac35f7 100644 --- a/sys/kern/subr_kobj.c +++ b/sys/kern/subr_kobj.c @@ -213,19 +213,11 @@ kobj_lookup_method(kobj_class_t cls, { kobj_method_t *ce; -#ifdef KOBJ_STATS - /* - * Correct for the 'hit' assumption in KOBJOPLOOKUP and record - * a 'miss'. - */ - kobj_lookup_hits--; - kobj_lookup_misses++; -#endif - ce = kobj_lookup_method_mi(cls, desc); if (!ce) ce = &desc->deflt; - *cep = ce; + if (cep) + *cep = ce; return ce; } diff --git a/sys/sys/kobj.h b/sys/sys/kobj.h index 0cb25fbc95a3..34a56fc0b4ba 100644 --- a/sys/sys/kobj.h +++ b/sys/sys/kobj.h @@ -226,10 +226,12 @@ extern u_int kobj_lookup_misses; kobj_method_t **_cep = \ &OPS->cache[_desc->id & (KOBJ_CACHE_SIZE-1)]; \ kobj_method_t *_ce = *_cep; \ - kobj_lookup_hits++; /* assume hit */ \ - if (_ce->desc != _desc) \ + if (_ce->desc != _desc) { \ _ce = kobj_lookup_method(OPS->cls, \ _cep, _desc); \ + kobj_lookup_misses++; \ + } else \ + kobj_lookup_hits++; \ _m = _ce->func; \ } while(0) #else |
