/*
- * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define _LGPL_SOURCE
return hash_match_key_two_u64((void *) &match_node->key, (void *) key);
}
+static inline
+const char *lttng_ht_type_str(enum lttng_ht_type type)
+{
+ switch (type) {
+ case LTTNG_HT_TYPE_STRING:
+ return "STRING";
+ case LTTNG_HT_TYPE_ULONG:
+ return "ULONG";
+ case LTTNG_HT_TYPE_U64:
+ return "U64";
+ case LTTNG_HT_TYPE_TWO_U64:
+ return "TWO_U64";
+ default:
+ ERR("Unknown lttng hashtable type %d", type);
+ abort();
+ }
+}
+
/*
* Return an allocated lttng hashtable.
*/
goto error;
}
- DBG3("Created hashtable size %lu at %p of type %d", size, ht->ht, type);
+ DBG3("Created hashtable size %lu at %p of type %s", size, ht->ht,
+ lttng_ht_type_str(type));
return ht;
* Lookup function in hashtable.
*/
LTTNG_HIDDEN
-void lttng_ht_lookup(struct lttng_ht *ht, void *key,
+void lttng_ht_lookup(struct lttng_ht *ht, const void *key,
struct lttng_ht_iter *iter)
{
assert(ht);