/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*
* This file is part of Portals, http://www.sf.net/projects/lustre/
*
*
*/
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#include <sys/socket.h>
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifndef _IOWR
-#include "ioctl.h"
-#endif
-#include <errno.h>
-#include <unistd.h>
-#include <time.h>
-#include <stdarg.h>
-#ifdef HAVE_ENDIAN_H
-#include <endian.h>
-#endif
-
#include <libcfs/libcfsutil.h>
#include <lnet/api-support.h>
#include <lnet/lnetctl.h>
printf ("%-20s [%d]\n",
libcfs_nid2str(data.ioc_nid),
data.ioc_u32[0] /* device id */);
+ } else if (g_net_is_compatible (NULL, O2IBLND, 0)) {
+ printf ("%s mtu %d\n",
+ libcfs_nid2str(data.ioc_nid),
+ data.ioc_u32[0]); /* path MTU */
} else {
printf ("%s\n", libcfs_nid2str(data.ioc_nid));
}
}
static int
-lwt_snapshot(cycles_t *now, int *ncpu, int *totalsize,
+lwt_snapshot(cfs_cycles_t *now, int *ncpu, int *totalsize,
lwt_event_t *events, int size)
{
struct libcfs_ioctl_data data;
}
static int
-lwt_print(FILE *f, cycles_t t0, cycles_t tlast, double mhz, int cpu, lwt_event_t *e)
+lwt_print(FILE *f, cfs_cycles_t t0, cfs_cycles_t tlast, double mhz, int cpu,
+ lwt_event_t *e)
{
#ifndef __WORDSIZE
# error "__WORDSIZE not defined"
return (1000.0);
}
+#define LWT_MAX_CPUS (32)
+
int
jt_ptl_lwt(int argc, char **argv)
{
- const int lwt_max_cpus = 32;
int ncpus;
int totalspace;
int nevents_per_cpu;
lwt_event_t *events;
- lwt_event_t *cpu_event[lwt_max_cpus + 1];
- lwt_event_t *next_event[lwt_max_cpus];
- lwt_event_t *first_event[lwt_max_cpus];
+ lwt_event_t *cpu_event[LWT_MAX_CPUS + 1];
+ lwt_event_t *next_event[LWT_MAX_CPUS];
+ lwt_event_t *first_event[LWT_MAX_CPUS];
int cpu;
lwt_event_t *e;
int rc;
int i;
double mhz;
- cycles_t t0;
- cycles_t tlast;
- cycles_t tnow;
+ cfs_cycles_t t0;
+ cfs_cycles_t tlast;
+ cfs_cycles_t tnow;
struct timeval tvnow;
int printed_date = 0;
int nlines = 0;
if (lwt_snapshot(NULL, &ncpus, &totalspace, NULL, 0) != 0)
return (-1);
- if (ncpus > lwt_max_cpus) {
+ if (ncpus > LWT_MAX_CPUS) {
fprintf(stderr, "Too many cpus: %d (%d)\n",
- ncpus, lwt_max_cpus);
+ ncpus, LWT_MAX_CPUS);
return (-1);
}
if (t0 <= next_event[cpu]->lwte_when) {
/* on or after the first event */
if (!printed_date) {
- cycles_t du = (tnow - t0) / mhz;
+ cfs_cycles_t du = (tnow - t0) / mhz;
time_t then = tvnow.tv_sec - du/1000000;
if (du % 1000000 > tvnow.tv_usec)