payload_niov--;
niov++;
}
-
+
md->start = tempiov->iov;
- md->options |= PTL_MD_IOVEC;
+ md->options |= PTL_MD_IOVEC;
}else{
-
-#ifdef _USING_LUSTRE_PORTALS_
+
+#ifdef _USING_LUSTRE_PORTALS_
while (payload_offset >= payload_kiov->kiov_len) {
payload_offset -= payload_kiov->kiov_len;
payload_niov--;
niov++;
}
-
+
md->start = tempiov->kiov;
- md->options |= PTL_MD_KIOV;
-
+ md->options |= PTL_MD_KIOV;
+
#else /* _USING_CRAY_PORTALS_ */
/*
payload_niov--;
niov++;
}
-
+
md->start = tempiov->iov;
md->options |= PTL_MD_IOVEC | PTL_MD_PHYS;
-#endif
-
+#endif
+
}
/*
routing,target_is_router);
if(routing)
- STAT_UPDATE(kpx_send_routing);
+ STAT_UPDATE(kps_send_routing);
if(target_is_router)
- STAT_UPDATE(kpx_send_target_is_router);
+ STAT_UPDATE(kps_send_target_is_router);
/* NB 'private' is different depending on what we're sending.... */
if (nob <= *kptllnd_tunables.kptl_max_immd_size)
break;
+
+ STAT_UPDATE(kpt_send_put);
+
kptllnd_do_put(tx,lntmsg,kptllnd_data);
PJK_UT_MSG_DATA("<<< SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n");
if (nob <= *kptllnd_tunables.kptl_max_immd_size)
break;
+ STAT_UPDATE(kps_send_get);
+
tx->tx_payload_offset = 0;
tx->tx_payload_niov = lntmsg->msg_md->md_niov;
tx->tx_payload_nob = lntmsg->msg_md->md_length;
case LNET_MSG_REPLY:
PJK_UT_MSG_DATA("LNET_MSG_REPLY\n");
+ STAT_UPDATE(kps_send_reply);
+
+
if(routing!=0 || target_is_router!=0)
{
/*
}
+ STAT_UPDATE(kps_send_immd);
+
LASSERT (offsetof(kptl_msg_t, ptlm_u.immediate.kptlim_payload[payload_nob])
<= *kptllnd_tunables.kptl_max_immd_size);
LASSERT (!(kiov != NULL && iov != NULL));
if(delayed)
- STAT_UPDATE(kpx_recv_delayed);
+ STAT_UPDATE(kps_recv_delayed);
switch(rxmsg->ptlm_type)
{
--- /dev/null
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * Copyright (C) 2002 Cluster File Systems, Inc.
+ *
+ * This file is part of Portals
+ * http://sourceforge.net/projects/sandiaportals/
+ *
+ * Portals is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * Portals is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Portals; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include "ptllnd.h"
+#include <linux/seq_file.h>
+#include <linux/lustre_compat25.h>
+
+#define LNET_PTLLND_PROC_STATS "sys/lnet/ptllnd_stats"
+
+char* stats_name_table[] = {
+ "kps_incoming_checksums_calculated",
+ "kps_incoming_checksums_invalid",
+ "kps_cleaning_caneled_peers",
+ "kps_checking_buckets",
+ "kps_too_many_peers",
+ "kps_peers_created",
+ "kps_no_credits",
+ "kps_saving_last_credit",
+ "kps_rx_allocated",
+ "kps_rx_released",
+ "kps_rx_allocation_failed",
+ "kps_tx_allocated",
+ "kps_tx_released",
+ "kpt_tx_allocation_failed",
+ "kps_recv_delayed",
+ "kps_send_routing",
+ "kps_send_target_is_router",
+ "kpt_send_put",
+ "kps_send_get",
+ "kps_send_immd",
+ "kps_send_reply",
+};
+
+typedef struct {
+ loff_t pssi_index;
+} ptllnd_stats_seq_iterator_t;
+
+
+int
+ptllnd_stats_seq_seek (ptllnd_stats_seq_iterator_t *pssi, loff_t off)
+{
+ if( off < sizeof(kptllnd_stats) / sizeof(int) &&
+ off < sizeof(stats_name_table) / sizeof(stats_name_table[0])){
+ pssi->pssi_index = off;
+ return 0;
+ }
+ return -ENOENT;
+}
+
+static void *
+ptllnd_stats_seq_start (struct seq_file *s, loff_t *pos)
+{
+ ptllnd_stats_seq_iterator_t *pssi;
+ int rc;
+
+ PORTAL_ALLOC(pssi, sizeof(*pssi));
+ if (pssi == NULL)
+ return NULL;
+
+ pssi->pssi_index = 0;
+ rc = ptllnd_stats_seq_seek(pssi, *pos);
+ if (rc == 0)
+ return pssi;
+
+ PORTAL_FREE(pssi, sizeof(*pssi));
+ return NULL;
+}
+
+static void
+ptllnd_stats_seq_stop (struct seq_file *s, void *iter)
+{
+ ptllnd_stats_seq_iterator_t *pssi = iter;
+
+ if (pssi != NULL)
+ PORTAL_FREE(pssi, sizeof(*pssi));
+}
+
+static void *
+ptllnd_stats_seq_next (struct seq_file *s, void *iter, loff_t *pos)
+{
+ ptllnd_stats_seq_iterator_t *pssi = iter;
+ int rc;
+ loff_t next = *pos + 1;
+
+ rc = ptllnd_stats_seq_seek(pssi, next);
+ if (rc != 0) {
+ PORTAL_FREE(pssi, sizeof(*pssi));
+ return NULL;
+ }
+
+ *pos = next;
+ return pssi;
+}
+
+static int
+ptllnd_stats_seq_show (struct seq_file *s, void *iter)
+{
+ ptllnd_stats_seq_iterator_t *pssi = iter;
+
+ seq_printf(s,"%02d %-40s %d\n",
+ (int)pssi->pssi_index,
+ stats_name_table[pssi->pssi_index],
+ ((int*)&kptllnd_stats)[pssi->pssi_index]);
+
+ return 0;
+}
+
+static struct seq_operations ptllnd_stats_sops = {
+ .start = ptllnd_stats_seq_start,
+ .stop = ptllnd_stats_seq_stop,
+ .next = ptllnd_stats_seq_next,
+ .show = ptllnd_stats_seq_show,
+};
+
+static int
+ptllnd_stats_seq_open(struct inode *inode, struct file *file)
+{
+ struct proc_dir_entry *dp = PDE(inode);
+ struct seq_file *sf;
+ int rc;
+
+ rc = seq_open(file, &ptllnd_stats_sops);
+ if (rc == 0) {
+ sf = file->private_data;
+ sf->private = dp->data;
+ }
+
+ return rc;
+}
+
+static struct file_operations ptllnd_stats_fops = {
+ .owner = THIS_MODULE,
+ .open = ptllnd_stats_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
+void
+kptllnd_proc_init(void)
+{
+ struct proc_dir_entry *stats;
+
+ /* Initialize LNET_PTLLND_PROC_STATS */
+ stats = create_proc_entry (LNET_PTLLND_PROC_STATS, 0644, NULL);
+ if (stats == NULL) {
+ CERROR("couldn't create proc entry %s\n", LNET_PTLLND_PROC_STATS);
+ return;
+ }
+
+ stats->proc_fops = &ptllnd_stats_fops;
+ stats->data = NULL;
+}
+
+void
+kptllnd_proc_fini(void)
+{
+ remove_proc_entry(LNET_PTLLND_PROC_STATS, 0);
+}