g_quark_to_string(ts->soft_irq_names[value]));
} else if (info->name == LTT_EVENT_KPROBE
&& f->name == LTT_FIELD_IP) {
- GQuark symbol = g_hash_table_lookup(ts->kprobe_hash,
+#if (__SIZEOF_LONG__ == 4)
+ GQuark symbol = (GQuark)g_hash_table_lookup(ts->kprobe_hash,
+ (gconstpointer)&value);
+#else
+ GQuark symbol = (GQuark)g_hash_table_lookup(ts->kprobe_hash,
(gconstpointer)value);
+#endif
if (symbol)
g_string_append_printf(s, " [%s]", g_quark_to_string(symbol));
}
static LttvBdevState *bdevstate_copy(LttvBdevState *bds);
+#if (__SIZEOF_LONG__ == 4)
+guint guint64_hash(gconstpointer key)
+{
+ guint64 ukey = *(const guint64 *)key;
+
+ return (guint)ukey ^ (guint)(ukey >> 32);
+}
+
+gboolean guint64_equal(gconstpointer a, gconstpointer b)
+{
+ guint64 ua = *(const guint64 *)a;
+ guint64 ub = *(const guint64 *)b;
+
+ return ua == ub;
+}
+#endif
+
void lttv_state_save(LttvTraceState *self, LttvAttribute *container)
{
LTTV_TRACE_STATE_GET_CLASS(self)->state_save(self, container);
static void expand_kprobe_table(LttvTraceState *ts, guint64 ip, char *symbol)
{
+#if (__SIZEOF_LONG__ == 4)
+ guint64 *ip_ptr = g_new(guint64, 1);
+ g_hash_table_insert(ts->kprobe_hash, ip_ptr,
+ (gpointer)(glong)g_quark_from_string(symbol));
+#else
g_hash_table_insert(ts->kprobe_hash, (gpointer)ip,
(gpointer)(glong)g_quark_from_string(symbol));
+#endif
}
static void expand_trap_table(LttvTraceState *ts, int id)
g_string_free(fe_name, TRUE);
+#if (__SIZEOF_LONG__ == 4)
+ name_tables->kprobe_hash = g_hash_table_new_full(guint64_hash, guint64_equal,
+ g_free, NULL);
+#else
name_tables->kprobe_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
+#endif
}