2 * Copyright (C) 2009-2012 Cray, Inc.
4 * Author: Nic Henke <nic@cray.com>
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre 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
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 _kgnilnd_debug_msg(kgn_msg_t *msg, struct libcfs_debug_msg_data *msgdata,
35 /* XXX Nic TBD: add handling of gnm_u ? */
36 libcfs_debug_msg(msgdata,
37 "%pV msg@0x%p m/v/ty/ck/pck/pl %08x/%d/%d/%x/%x/%d x%d:%s\n",
38 &vaf, msg, msg->gnm_magic, msg->gnm_version,
39 msg->gnm_type, msg->gnm_cksum, msg->gnm_payload_cksum,
40 msg->gnm_payload_len, msg->gnm_seq,
41 kgnilnd_msgtype2str(msg->gnm_type));
46 _kgnilnd_debug_conn(kgn_conn_t *conn, struct libcfs_debug_msg_data *msgdata,
56 libcfs_debug_msg(msgdata,
57 "%pV conn@0x%p->%s:%s cq %u, to %ds, RX %d @ %lu/%lus; TX %d @ %lus/%lus; NOOP %lus/%lu/%lus; sched %lus/%lus/%lus ago \n",
59 conn->gnc_peer ? libcfs_nid2str(conn->gnc_peer->gnp_nid) :
60 "<?>", kgnilnd_conn_state2str(conn),
61 conn->gnc_cqid, conn->gnc_timeout,
62 atomic_read(&conn->gnc_rx_seq),
63 cfs_duration_sec(jiffies - conn->gnc_last_rx),
64 cfs_duration_sec(jiffies - conn->gnc_last_rx_cq),
65 atomic_read(&conn->gnc_tx_seq),
66 cfs_duration_sec(jiffies - conn->gnc_last_tx),
67 cfs_duration_sec(jiffies - conn->gnc_last_tx_cq),
68 cfs_duration_sec(jiffies - conn->gnc_last_noop_want),
69 cfs_duration_sec(jiffies - conn->gnc_last_noop_sent),
70 cfs_duration_sec(jiffies - conn->gnc_last_noop_cq),
71 cfs_duration_sec(jiffies - conn->gnc_last_sched_ask),
72 cfs_duration_sec(jiffies - conn->gnc_last_sched_do),
73 cfs_duration_sec(jiffies - conn->gnc_device->gnd_sched_alive));
78 _kgnilnd_debug_tx(kgn_tx_t *tx, struct libcfs_debug_msg_data *msgdata,
81 kgn_tx_ev_id_t *id = &tx->tx_id;
86 if (tx->tx_conn && tx->tx_conn->gnc_peer) {
87 nid = libcfs_nid2str(tx->tx_conn->gnc_peer->gnp_nid);
94 libcfs_debug_msg(msgdata,
95 "%pV tx@0x%p->%s id %#llx/%u/%d:%d msg %x/%s/%d x%d q %s@%lds->0x%p f %x re %d\n",
96 &vaf, tx, nid, id->txe_cookie, id->txe_smsg_id, id->txe_cqid,
97 id->txe_idx, tx->tx_msg.gnm_type,
98 kgnilnd_msgtype2str(tx->tx_msg.gnm_type), tx->tx_buftype,
100 kgnilnd_tx_state2str(tx->tx_list_state),
101 cfs_duration_sec((long)jiffies - tx->tx_qtime), tx->tx_list_p,
102 tx->tx_state, tx->tx_retrans);
107 _kgnilnd_api_rc_lbug(const char* rcstr, int rc, struct libcfs_debug_msg_data *msgdata,
108 const char *fmt, ...)
110 struct va_format vaf;
117 libcfs_debug_msg(msgdata,
118 "%pV GNI API violated? Unexpected rc %s(%d)!\n",