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,
31 /* XXX Nic TBD: add handling of gnm_u ? */
32 libcfs_debug_vmsg2(msgdata, fmt, args,
33 " msg@0x%p m/v/ty/ck/pck/pl %08x/%d/%d/%x/%x/%d x%d:%s\n",
34 msg, msg->gnm_magic, msg->gnm_version, msg->gnm_type,
35 msg->gnm_cksum, msg->gnm_payload_cksum,
36 msg->gnm_payload_len, msg->gnm_seq,
37 kgnilnd_msgtype2str(msg->gnm_type));
42 _kgnilnd_debug_conn(kgn_conn_t *conn, struct libcfs_debug_msg_data *msgdata,
48 libcfs_debug_vmsg2(msgdata, fmt, args,
49 " conn@0x%p->%s:%s cq %u, to %ds, "
50 " RX %d @ %lu/%lus; TX %d @ %lus/%lus; "
51 " NOOP %lus/%lu/%lus; sched %lus/%lus/%lus ago \n",
52 conn, conn->gnc_peer ? libcfs_nid2str(conn->gnc_peer->gnp_nid) :
53 "<?>", kgnilnd_conn_state2str(conn),
54 conn->gnc_cqid, conn->gnc_timeout,
55 atomic_read(&conn->gnc_rx_seq),
56 cfs_duration_sec(jiffies - conn->gnc_last_rx),
57 cfs_duration_sec(jiffies - conn->gnc_last_rx_cq),
58 atomic_read(&conn->gnc_tx_seq),
59 cfs_duration_sec(jiffies - conn->gnc_last_tx),
60 cfs_duration_sec(jiffies - conn->gnc_last_tx_cq),
61 cfs_duration_sec(jiffies - conn->gnc_last_noop_want),
62 cfs_duration_sec(jiffies - conn->gnc_last_noop_sent),
63 cfs_duration_sec(jiffies - conn->gnc_last_noop_cq),
64 cfs_duration_sec(jiffies - conn->gnc_last_sched_ask),
65 cfs_duration_sec(jiffies - conn->gnc_last_sched_do),
66 cfs_duration_sec(jiffies - conn->gnc_device->gnd_sched_alive));
73 _kgnilnd_debug_tx(kgn_tx_t *tx, struct libcfs_debug_msg_data *msgdata,
76 kgn_tx_ev_id_t *id = &tx->tx_id;
80 if (tx->tx_conn && tx->tx_conn->gnc_peer) {
81 nid = libcfs_nid2str(tx->tx_conn->gnc_peer->gnp_nid);
85 libcfs_debug_vmsg2(msgdata, fmt, args,
86 " tx@0x%p->%s id %#llx"
87 "/%u/%d:%d msg %x/%s/%d x%d q %s@%lds->0x%p f %x re %d\n",
88 tx, nid, id->txe_cookie, id->txe_smsg_id, id->txe_cqid,
89 id->txe_idx, tx->tx_msg.gnm_type,
90 kgnilnd_msgtype2str(tx->tx_msg.gnm_type), tx->tx_buftype,
92 kgnilnd_tx_state2str(tx->tx_list_state),
93 cfs_duration_sec((long)jiffies - tx->tx_qtime), tx->tx_list_p,
94 tx->tx_state, tx->tx_retrans);
99 _kgnilnd_api_rc_lbug(const char* rcstr, int rc, struct libcfs_debug_msg_data *msgdata,
100 const char *fmt, ...)
105 libcfs_debug_vmsg2(msgdata, fmt, args,
106 " GNI API violated? Unexpected rc %s(%d)!\n",