1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:set expandtab ts=4 shiftwidth=4: */
4 * Copyright (C) 2008 Sun Microsystems, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 * Boston, MA 02111-1307, USA.
21 * Authors: Lin Ma <lin.ma@sun.com>
26 #include <glib/gprintf.h>
29 #include "fen-kernel.h"
30 #include "fen-missing.h"
33 G_LOCK_EXTERN (fen_lock);
35 /*-------------------- node ------------------*/
37 dump_node (node_t* node, gpointer data)
39 if (data && node->user_data) {
42 g_printf ("[%s] < 0x%p : 0x%p > %s\n", __func__, node, node->user_data, NODE_NAME(node));
46 dump_node_tree (node_t* node, gpointer user_data)
48 node_op_t op = {dump_node, NULL, NULL, user_data};
51 if (G_TRYLOCK (fen_lock)) {
53 travel_nodes (node, &op);
60 /* ------------------ fdata port hash --------------------*/
62 dump_hash_cb (gpointer key,
66 g_printf ("[%s] < 0x%p : 0x%p >\n", __func__, key, value);
70 dump_hash (GHashTable* hash, gpointer user_data)
72 if (G_TRYLOCK (fen_lock)) {
73 if (g_hash_table_size (hash) > 0) {
74 g_hash_table_foreach (hash, dump_hash_cb, user_data);
81 /* ------------------ event --------------------*/
83 dump_event (fnode_event_t* ev, gpointer user_data)
85 fdata* data = ev->user_data;
86 g_printf ("[%s] < 0x%p : 0x%p > [ %10s ] %s\n", __func__, ev, ev->user_data, _event_string (ev->e), FN_NAME(data));
90 dump_event_queue (fdata* data, gpointer user_data)
92 if (G_TRYLOCK (fen_lock)) {
94 g_queue_foreach (data->eventq, (GFunc)dump_event, user_data);