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. All rights reserved.
5 * Use is subject to license terms.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307, USA.
22 * Authors: Lin Ma <lin.ma@sun.com>
27 #include <glib/gprintf.h>
30 #include "fen-kernel.h"
31 #include "fen-missing.h"
34 G_LOCK_EXTERN (fen_lock);
36 /*-------------------- node ------------------*/
38 dump_node (node_t* node, gpointer data)
40 if (data && node->user_data) {
43 g_printf ("[%s] < 0x%p : 0x%p > %s\n", __func__, node, node->user_data, NODE_NAME(node));
47 dump_node_tree (node_t* node, gpointer user_data)
49 node_op_t op = {dump_node, NULL, NULL, user_data};
52 if (G_TRYLOCK (fen_lock)) {
54 travel_nodes (node, &op);
61 /* ------------------ fdata port hash --------------------*/
63 dump_hash_cb (gpointer key,
67 g_printf ("[%s] < 0x%p : 0x%p >\n", __func__, key, value);
71 dump_hash (GHashTable* hash, gpointer user_data)
73 if (G_TRYLOCK (fen_lock)) {
74 if (g_hash_table_size (hash) > 0) {
75 g_hash_table_foreach (hash, dump_hash_cb, user_data);
82 /* ------------------ event --------------------*/
84 dump_event (fnode_event_t* ev, gpointer user_data)
86 fdata* data = ev->user_data;
87 g_printf ("[%s] < 0x%p : 0x%p > [ %10s ] %s\n", __func__, ev, ev->user_data, _event_string (ev->e), FN_NAME(data));
91 dump_event_queue (fdata* data, gpointer user_data)
93 if (G_TRYLOCK (fen_lock)) {
95 g_queue_foreach (data->eventq, (GFunc)dump_event, user_data);