@@ -50,8 +50,6 @@ const char *_odp_int_name_tbl_name(_odp_int_name_t odp_name);
uint64_t _odp_int_name_tbl_user_data(_odp_int_name_t odp_name);
-void _odp_int_name_tbl_stats_print(void);
-
int _odp_int_name_tbl_init_global(void);
int _odp_int_name_tbl_term_global(void);
@@ -46,7 +46,6 @@
/* The number of name tables should not be changed. */
#define NUM_NAME_TBLS 16
-#define SECONDARY_HASH_HISTO_PRINT 1
#define SECONDARY_HASH_DUMP 0
typedef struct name_tbl_entry_s name_tbl_entry_t;
@@ -984,203 +983,6 @@ _odp_int_name_t _odp_int_name_tbl_lookup(const char *name, uint8_t name_kind)
return name_tbl_id;
}
-#ifdef SECONDARY_HASH_HISTO_PRINT
-
-static uint32_t level2_hash_histo(secondary_hash_tbl_t *hash_tbl,
- uint32_t level2_histo[])
-{
- name_tbl_entry_t *name_tbl_entry;
- hash_tbl_entry_t hash_tbl_entry;
- uint32_t idx, collisions, total_collisions;
-
- total_collisions = 0;
- for (idx = 0; idx < SECONDARY_HASH_TBL_SIZE; idx++) {
- hash_tbl_entry = hash_tbl->hash_entries[idx];
- if (hash_tbl_entry == 0) {
- collisions = 0;
- } else {
- name_tbl_entry = (name_tbl_entry_t *)
- (uintptr_t)(hash_tbl_entry & ~0x3F);
- collisions = linked_list_len(name_tbl_entry);
- }
-
- level2_histo[MIN(collisions, 256)]++;
- total_collisions += collisions;
- }
-
- return total_collisions;
-}
-
-static uint32_t level1_hash_histo(secondary_hash_tbl_t *hash_tbl,
- uint32_t level1_histo[],
- uint32_t level2_histo[])
-{
- secondary_hash_tbl_t *secondary_hash;
- name_tbl_entry_t *name_tbl_entry;
- hash_tbl_entry_t hash_tbl_entry;
- uint32_t idx, collisions, total_collisions;
-
- total_collisions = 0;
- for (idx = 0; idx < SECONDARY_HASH_TBL_SIZE; idx++) {
- hash_tbl_entry = hash_tbl->hash_entries[idx];
- if (hash_tbl_entry == 0) {
- collisions = 0;
- } else if ((hash_tbl_entry & 0x3F) != 0) {
- name_tbl_entry = (name_tbl_entry_t *)
- (uintptr_t)(hash_tbl_entry & ~0x3F);
- collisions = linked_list_len(name_tbl_entry);
- } else {
- secondary_hash = (secondary_hash_tbl_t *)
- (uintptr_t)hash_tbl_entry;
- collisions = level2_hash_histo(secondary_hash,
- level2_histo);
- }
-
- level1_histo[MIN(collisions, 256)]++;
- total_collisions += collisions;
- }
-
- return total_collisions;
-}
-
-static void secondary_hash_histo_print(void)
-{
- secondary_hash_tbl_t *secondary_hash;
- hash_tbl_entry_t hash_tbl_entry;
- uint32_t level1_histo[257], level2_histo[257];
- uint32_t avg, idx, count, total_count;
-
- memset(level1_histo, 0, sizeof(level1_histo));
- memset(level2_histo, 0, sizeof(level2_histo));
-
- for (idx = 0; idx < PRIMARY_HASH_TBL_SIZE; idx++) {
- hash_tbl_entry = name_hash_tbl.hash_entries[idx];
- if ((hash_tbl_entry != 0) && ((hash_tbl_entry & 0x3F) == 0)) {
- /* This hash_tbl_entry references a level 0 secondary
- * hash table
- */
- secondary_hash = (secondary_hash_tbl_t *)
- (uintptr_t)hash_tbl_entry;
- level1_hash_histo(secondary_hash, level1_histo,
- level2_histo);
- }
- }
-
- if (name_hash_tbl.num_secondary_tbls[0] == 0)
- return;
-
- ODP_DBG(" level1 secondary hash histogram:\n");
- total_count = 0;
- for (idx = 0; idx < 256; idx++) {
- count = level1_histo[idx];
- if (idx != 0)
- total_count += count * idx;
-
- if (count != 0)
- ODP_DBG(" num collisions=%02u count=%u\n",
- idx, count);
- }
-
- count = level1_histo[256];
- total_count += count;
- if (count != 0)
- ODP_DBG(" num collisions >=256 count=%u\n", count);
-
- avg = (100 * total_count) / name_hash_tbl.num_secondary_tbls[0];
- avg = avg / SECONDARY_HASH_TBL_SIZE;
- ODP_DBG(" avg collisions=%02u.%02u total=%u\n\n",
- avg / 100, avg % 100, total_count);
-
- if (name_hash_tbl.num_secondary_tbls[1] == 0)
- return;
-
- ODP_DBG(" level2 secondary hash histogram:\n");
- total_count = 0;
- for (idx = 0; idx < 256; idx++) {
- count = level2_histo[idx];
- if (idx != 0)
- total_count += count * idx;
-
- if (count != 0)
- ODP_DBG(" num collisions=%02u count=%u\n",
- idx, count);
- }
-
- count = level2_histo[256];
- total_count += count;
- if (count != 0)
- ODP_DBG(" num collisions >=256 count=%u\n", count);
-
- avg = (100 * total_count) / name_hash_tbl.num_secondary_tbls[1];
- avg = avg / SECONDARY_HASH_TBL_SIZE;
- ODP_DBG(" avg collisions=%02u.%02u total=%u\n\n",
- avg / 100, avg % 100, total_count);
-}
-
-#endif
-
-void _odp_int_name_tbl_stats_print(void)
-{
- name_tbl_t *name_tbl;
- uint32_t primary_hash_histo[257], idx, collisions,
- count, total_count;
- uint32_t avg;
-
- ODP_DBG("\nname table stats:\n");
- ODP_DBG(" num_names=%u num_adds=%lu "
- "num_deletes=%lu num_name_tbls=%u\n",
- name_tbls.current_num_names, name_tbls.num_adds,
- name_tbls.num_deletes, name_tbls.num_name_tbls);
- for (idx = 0; idx < NUM_NAME_TBLS; idx++) {
- name_tbl = name_tbls.tbls[idx];
- if ((name_tbl) && (name_tbl->num_used != 0))
- ODP_DBG(" name_tbl %u num_allocd=%7u "
- "num_added_to_free_list=%7u "
- "num_used=%7u num_avail_to_add=%7u\n", idx,
- name_tbl->num_allocd,
- name_tbl->num_added_to_free_list,
- name_tbl->num_used,
- name_tbl->num_avail_to_add);
- }
-
- memset(primary_hash_histo, 0, sizeof(primary_hash_histo));
- for (idx = 0; idx < PRIMARY_HASH_TBL_SIZE; idx++) {
- collisions = MIN(name_hash_tbl.hash_collisions[idx], 256);
- primary_hash_histo[collisions]++;
- }
-
- ODP_DBG(" name_tbl primary hash histogram:\n");
- total_count = 0;
- for (idx = 0; idx < 256; idx++) {
- count = primary_hash_histo[idx];
- if (idx != 0)
- total_count += count * idx;
-
- if (count != 0)
- ODP_DBG(" num collisions=%02u count=%u\n",
- idx, count);
- }
-
- count = primary_hash_histo[256];
- total_count += count;
- if (count != 0)
- ODP_DBG(" num collisions >=256 count=%u\n", count);
-
- avg = (100 * total_count) / PRIMARY_HASH_TBL_SIZE;
- ODP_DBG(" avg collisions=%02u.%02u total=%u\n\n",
- avg / 100, avg % 100, total_count);
-
- ODP_DBG(" num of first level secondary hash tbls=%u "
- "second level tbls=%u\n",
- name_hash_tbl.num_secondary_tbls[0],
- name_hash_tbl.num_secondary_tbls[1]);
-
-#ifdef SECONDARY_HASH_HISTO_PRINT
- if (name_hash_tbl.num_secondary_tbls[0] != 0)
- secondary_hash_histo_print();
-#endif
-}
-
int _odp_int_name_tbl_init_global(void)
{
name_tbl_t *new_name_tbl;
Remove dead debug print code. Signed-off-by: Matias Elo <matias.elo@nokia.com> --- .../include/odp_name_table_internal.h | 2 - platform/linux-generic/odp_name_table.c | 198 --------------------- 2 files changed, 200 deletions(-)