4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
31 #include <glib-object.h>
41 /* hacking TcoreQueue */
42 struct tcore_queue_type {
47 static void _monitor_plugin(Server *s)
55 list = tcore_server_ref_plugins(s);
62 msg("Name: [%s]", tcore_plugin_get_description(p)->name);
64 str = tcore_plugin_get_filename(p);
65 msg(" - file: %s", str);
69 msg(" - addr: %p", p);
70 msg(" - ref_hal: %p", tcore_plugin_ref_hal(p));
71 if (tcore_plugin_ref_hal(p)) {
72 str = tcore_hal_get_name(tcore_plugin_ref_hal(p));
73 msg(" - ref_hal_name: %s", str);
77 msg(" - userdata: %p", tcore_plugin_ref_user_data(p));
85 static void _monitor_storage(Server *s)
91 msg("-- Storages --");
93 list = tcore_server_ref_storages(s);
100 msg("Name: [%s]", tcore_storage_ref_name(strg));
101 msg(" - addr: %p", strg);
108 static void _monitor_communicator(Server *s)
113 msg("-- Coomunicators --");
115 list = tcore_server_ref_communicators(s);
122 msg("Name: [%s]", tcore_communicator_ref_name(comm));
123 msg(" - addr: %p", comm);
124 msg(" - parent_plugin: %p", tcore_communicator_ref_plugin(comm));
125 msg(" - userdata: %p", tcore_communicator_ref_user_data(comm));
132 static void _monitor_hal(Server *s)
137 TcorePending *pending;
142 unsigned int data_len;
146 list = tcore_server_ref_hals(s);
153 str = tcore_hal_get_name(h);
154 msg("Name: [%s]", str);
155 msg(" - addr: %p", h);
156 msg(" - parent_plugin: %p", tcore_hal_ref_plugin(h));
157 msg(" - userdata: %p", tcore_hal_ref_user_data(h));
159 q = tcore_hal_ref_queue(h);
172 qlen = tcore_queue_get_length(q);
173 msg(" - queue: %p, length: %d", q, qlen);
174 msg(" queue_head: %p", g_queue_peek_head(q->gq));
175 for (i = 0; i < qlen; i++) {
176 pending = g_queue_peek_nth(q->gq, i);
177 msg(" [%02d] pending=%p, id=0x%x, ur=%p", i, pending, tcore_pending_get_id(pending), tcore_pending_ref_user_request(pending));
179 data = tcore_pending_ref_request_data(pending, &data_len);
180 msg(" data=%p, data_len=%d", data, data_len);
182 msg(" queue_tail: %p", g_queue_peek_tail(q->gq));
189 void monitor_server_state(Server *s)
193 _monitor_communicator(s);