Skip to content
Snippets Groups Projects
Commit d66b78bd authored by rzahir's avatar rzahir
Browse files

* obdfs/flushd.c: conditionalized number of C_DEBUG messages.

        * include/linux/obd_class.h: added obd_devicename member to
          struct obd_device (name is either ptr to dentry or uuid).
        * ext2obd/ext2_obd.c: setup() converts dentry into rdev number.
          class/class_obd.c: setup() converts name into obd_device dentry
          class/obdcontrol: setup() passes /dev/obd name into ioctl
          (used to be rdev number and if invalid rdev number was passed
           old ext2_obd.c would crash kernel when trying to read superblock).
        * class/obdcontrol: added "status, procsys, script, insmod, rmmod,
          lsmod, shell and close" commands for obdcontrol. This allows
          easier scripting from within obdcontrol. Introduced ability to
          maintain multiple open obd devices from a single obdcontrol
          session.  Device command toggles device context. Obdcontrol
          maintains multiple open file handles. "script <file>" command is
          useful for "sourcing" scripts without leaving obdcontrol.
          shell <command> allows any shell command to be executed from
          within obdcontrol.
        * class/proc_lustre.c: added support for /proc/lustre/obd/<n>/status.
          These are read-only /proc entries that track /dev/obd<n>
          internal state.
        * obdtrace/* & include/linux/obd_class.h: obd_trace a logical obd
          module useful for tracing and performance debug of the Lustre
          obd protocol stack. obdtrace module creates
          /proc/lustre/obd/<n>/stats file. Reading this /proc file shows
          per OBD performance statistics.  Any write to this /proc file
          resets the counters for this OBD.
        * scripts/obdtrace_demo.scr: Example of obdtrace that
          takes advantage of new obdcontrol functionality.
        * doc/obdtrace_demo.txt: shows obdtrace capabilities.
parent e28c022a
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/obd_ext2.h> #include <linux/obd_ext2.h>
#include <linux/obd_snap.h> #include <linux/obd_snap.h>
#include <linux/obd_trace.h>
/* #include <linux/obd_fc.h> */ /* #include <linux/obd_fc.h> */
#include <linux/obd_raid1.h> #include <linux/obd_raid1.h>
#include <linux/obd_rpc.h> #include <linux/obd_rpc.h>
...@@ -98,12 +99,19 @@ struct obd_conn { ...@@ -98,12 +99,19 @@ struct obd_conn {
uint32_t oc_id; uint32_t oc_id;
}; };
typedef union {
struct dentry *dentry; /* file system obd device names */
__u8 _uuid[16]; /* uuid obd device names */
} obd_devicename;
/* corresponds to one of the obdx */ /* corresponds to one of the obdx */
struct obd_device { struct obd_device {
struct obd_type *obd_type; struct obd_type *obd_type;
int obd_minor; int obd_minor;
int obd_flags; int obd_flags;
int obd_refcnt; int obd_refcnt;
obd_devicename obd_fsname;
struct proc_dir_entry *obd_proc_entry;
int obd_multi_count; int obd_multi_count;
struct obd_conn obd_multi_conn[MAX_MULTI]; struct obd_conn obd_multi_conn[MAX_MULTI];
unsigned int obd_gen_last_id; unsigned int obd_gen_last_id;
...@@ -113,11 +121,16 @@ struct obd_device { ...@@ -113,11 +121,16 @@ struct obd_device {
struct ext2_obd ext2; struct ext2_obd ext2;
struct raid1_obd raid1; struct raid1_obd raid1;
struct snap_obd snap; struct snap_obd snap;
struct rpc_obd rpc; struct trace_obd trace;
/* struct fc_obd fc; */ /* struct fc_obd fc; */
} u; } u;
}; };
extern struct proc_dir_entry *proc_lustre_register_obd_device(struct obd_device *obd);
extern void proc_lustre_release_obd_device(struct obd_device *obd);
extern void proc_lustre_remove_obd_entry(const char* name, struct obd_device *obd);
/* /*
* ======== OBD Operations Declarations =========== * ======== OBD Operations Declarations ===========
*/ */
...@@ -449,7 +462,7 @@ int gen_multi_attach(struct obd_device *obddev, uint32_t len, void *data); ...@@ -449,7 +462,7 @@ int gen_multi_attach(struct obd_device *obddev, uint32_t len, void *data);
int gen_multi_detach(struct obd_device *obddev); int gen_multi_detach(struct obd_device *obddev);
int gen_connect (struct obd_conn *conn); int gen_connect (struct obd_conn *conn);
int gen_disconnect(struct obd_conn *conn); int gen_disconnect(struct obd_conn *conn);
struct obd_client *gen_client(struct obd_conn *); struct obd_client *gen_client(const struct obd_conn *);
int gen_cleanup(struct obd_device *obddev); int gen_cleanup(struct obd_device *obddev);
int gen_copy_data(struct obd_conn *dst_conn, struct obdo *dst, int gen_copy_data(struct obd_conn *dst_conn, struct obdo *dst,
struct obd_conn *src_conn, struct obdo *src, struct obd_conn *src_conn, struct obdo *src,
......
#ifndef _OBD_SUPPORT #ifndef _OBD_SUPPORT
#define _OBD_SUPPORT #define _OBD_SUPPORT
#include <linux/autoconf.h>
#include <linux/malloc.h> #include <linux/malloc.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
...@@ -42,8 +43,9 @@ extern long obd_memory; ...@@ -42,8 +43,9 @@ extern long obd_memory;
#define D_INFO 0x200 /* general information, especially from interface.c */ #define D_INFO 0x200 /* general information, especially from interface.c */
#define D_IOCTL 0x400 /* ioctl related information */ #define D_IOCTL 0x400 /* ioctl related information */
#define D_BLOCKS 0x800 /* ext2 block allocation */ #define D_BLOCKS 0x800 /* ext2 block allocation */
#define D_RPC 0x1000 /* rpc communications */ #define D_NET 0x1000 /* network communications */
#define D_PUNCH 0x2000 #define D_PUNCH 0x2000
#define D_BUFFS 0x4000 /* print network buffers */
#define CDEBUG(mask, format, a...) \ #define CDEBUG(mask, format, a...) \
do { \ do { \
...@@ -191,3 +193,4 @@ do { \ ...@@ -191,3 +193,4 @@ do { \
#endif #endif
/*
* obdtrace (header file) - is useful for tracing and performance
* debug of the Lustre obd protocol stack. obdtrace is a transparent
* logical obd driver that prints commands their in- and outbound
* parameters. obdtrace maintains statistics about number and latency
* of the obd commands that pass through it. As such it is also use
* for performance analysis.
*
* Copyright (c) 2001 Rumi Zahir <rumi.zahir@intel.com>
*/
#ifndef __OBD_TRACE_H
#define __OBD_TRACE_H
struct obd_device;
struct obdtrace_opstats;
struct trace_obd {
struct obdtrace_opstats *stats;
};
#endif
MODULE = obdclass.o MODULE = obdclass.o
CFILES = genops.c class_obd.c sysctl.c CFILES = genops.c proc_lustre.c class_obd.c sysctl.c
include ../make.rules include ../make.rules
...@@ -79,6 +79,9 @@ static int obd_class_open(struct inode * inode, struct file * file) ...@@ -79,6 +79,9 @@ static int obd_class_open(struct inode * inode, struct file * file)
CDEBUG(D_PSDEV, "Dev %d refcount now %d\n", dev, CDEBUG(D_PSDEV, "Dev %d refcount now %d\n", dev,
obd_dev[dev].obd_refcnt); obd_dev[dev].obd_refcnt);
obd_dev[dev].obd_proc_entry =
proc_lustre_register_obd_device(&obd_dev[dev]);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
EXIT; EXIT;
return 0; return 0;
...@@ -101,6 +104,9 @@ static int obd_class_release(struct inode * inode, struct file * file) ...@@ -101,6 +104,9 @@ static int obd_class_release(struct inode * inode, struct file * file)
obd_dev[dev].obd_refcnt); obd_dev[dev].obd_refcnt);
obd_dev[dev].obd_refcnt--; obd_dev[dev].obd_refcnt--;
if (obd_dev[dev].obd_proc_entry && (obd_dev[dev].obd_refcnt==0))
proc_lustre_release_obd_device(&obd_dev[dev]);
CDEBUG(D_PSDEV, "Dev %d refcount now %d\n", dev, CDEBUG(D_PSDEV, "Dev %d refcount now %d\n", dev,
obd_dev[dev].obd_refcnt); obd_dev[dev].obd_refcnt);
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
...@@ -154,6 +160,21 @@ static int getdata(int len, void **data) ...@@ -154,6 +160,21 @@ static int getdata(int len, void **data)
return 0; return 0;
} }
static int obd_devicename_from_path(obd_devicename* whoami,
char* user_string)
{
struct nameidata nd;
int err;
err = user_path_walk(user_string, &nd);
if (!err) {
whoami->dentry = nd.dentry;
path_release(&nd);
}
return err;
}
/* to control /dev/obdNNN */ /* to control /dev/obdNNN */
static int obd_class_ioctl (struct inode * inode, struct file * filp, static int obd_class_ioctl (struct inode * inode, struct file * filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
...@@ -311,10 +332,12 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, ...@@ -311,10 +332,12 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
case OBD_IOC_SETUP: { case OBD_IOC_SETUP: {
struct ioc_setup { struct ioc_setup {
int setup_datalen; int setup_datalen;
void *setup_data; char *setup_data;
} *setup; } *setup;
setup = tmp_buf; setup = tmp_buf;
ENTRY; ENTRY;
/* have we attached a type to this device */ /* have we attached a type to this device */
if (!(obddev->obd_flags & OBD_ATTACHED)) { if (!(obddev->obd_flags & OBD_ATTACHED)) {
...@@ -331,19 +354,23 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, ...@@ -331,19 +354,23 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
return -EBUSY; return -EBUSY;
} }
/* get main structure */
err = copy_from_user(setup, (void *) arg, sizeof(*setup));
if (err) {
EXIT;
return err;
}
err = getdata(setup->setup_datalen, &setup->setup_data);
if (err) {
EXIT;
return err;
}
/* get main structure */
err = copy_from_user(setup, (void *) arg, sizeof(*setup));
if (err) {
EXIT;
return err;
}
err = obd_devicename_from_path(&(obddev->obd_fsname),
(char*) setup->setup_data);
if (err) {
memset(&(obddev->obd_fsname), 0, sizeof(obd_devicename));
EXIT;
return err;
}
/* do the setup */ /* do the setup */
CDEBUG(D_PSDEV, "Setup %d, type %s\n", dev, CDEBUG(D_PSDEV, "Setup %d, type %s\n", dev,
obddev->obd_type->typ_name); obddev->obd_type->typ_name);
...@@ -359,9 +386,8 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, ...@@ -359,9 +386,8 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
return 0; return 0;
} }
err = OBP(obddev, setup)(obddev, setup->setup_datalen, err = OBP(obddev, setup)(obddev, 0, NULL);
setup->setup_data);
if ( err ) { if ( err ) {
obddev->obd_flags &= ~OBD_SET_UP; obddev->obd_flags &= ~OBD_SET_UP;
EXIT; EXIT;
...@@ -372,8 +398,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, ...@@ -372,8 +398,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
obddev->obd_flags |= OBD_SET_UP; obddev->obd_flags |= OBD_SET_UP;
EXIT; EXIT;
} }
if (setup->setup_data)
OBD_FREE(setup->setup_data, setup->setup_datalen);
return err; return err;
} }
case OBD_IOC_CLEANUP: { case OBD_IOC_CLEANUP: {
......
...@@ -59,7 +59,7 @@ void obd_cleanup_obdo_cache(void) ...@@ -59,7 +59,7 @@ void obd_cleanup_obdo_cache(void)
/* map connection to client */ /* map connection to client */
struct obd_client *gen_client(struct obd_conn *conn) struct obd_client *gen_client(const struct obd_conn *conn)
{ {
struct obd_device * obddev = conn->oc_dev; struct obd_device * obddev = conn->oc_dev;
struct list_head * lh, * next; struct list_head * lh, * next;
......
This diff is collapsed.
/* proc_lustre.c manages /proc/lustre/obd.
*
* OBD devices materialize in /proc as a directory:
* /proc/lustre/obd/<number>
* when /dev/obd<number> is opened. When the device is closed, the
* directory entry disappears.
*
* For each open OBD device, code in this file also creates a file
* named <status>. "cat /proc/lustre/obd/<number>/status" gives
* information about the OBD device's configuration.
* The class driver manages the "status" entry.
*
* Other logical drivers can create their own entries. For example,
* the obdtrace driver creates /proc/lustre/obd/<obdid>/stats entry.
*
* This file defines three functions
* proc_lustre_register_obd_device()
* proc_lustre_release_obd_device()
* proc_lustre_remove_obd_entry()
* that dynamically create/delete /proc/lustre/obd entries:
*
* proc_lustre_register_obd_device() registers an obd device,
* and, if this is the first OBD device, creates /proc/lustre/obd.
*
* proc_lustre_release_obd_device() removes device information
* from /proc/lustre/obd, and if this is the last OBD device
* removes /proc/lustre/obd.
*
* proc_lustre_remove_obd_entry() removes a
* /proc/lustre/obd/<obdid>/ entry by name. This is the only
* function that is exported to other modules.
*
* Copyright (c) 2001 Rumi Zahir <rumi.zahir@intel.com>
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/proc_fs.h>
#include <linux/obd_support.h>
#include <linux/obd_class.h>
#ifdef CONFIG_PROC_FS
extern struct proc_dir_entry proc_root;
static struct proc_dir_entry *proc_lustre_dir_entry = 0;
static struct proc_dir_entry *proc_lustre_obd_dir_entry = 0;
static struct proc_dir_entry *
proc_lustre_mkdir(const char* dname, struct proc_dir_entry *parent)
{
struct proc_dir_entry *child_dir_entry;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,0) /*0x20300 */
child_dir_entry = proc_mkdir(dname, parent);
#else
child_dir_entry = create_proc_entry(dname,
S_IFDIR | S_IRUGO | S_IXUGO,
&proc_root);
#endif
if (!child_dir_entry)
printk ("lustre: failed to create /proc entry %s\n", dname);
return child_dir_entry;
}
static int read_lustre_status(char *page, char **start, off_t offset,
int count, int *eof, void *data)
{
struct obd_device * obddev = (struct obd_device *) data;
int p;
p = sprintf(&page[0], "/dev/obd%d: ", obddev->obd_minor);
if (obddev->obd_refcnt==0) {
/* obd is unused */
p += sprintf(&page[p], "open but unused\n\0");
}
else { /* obd in use */
p += sprintf(&page[p], "refcnt(%d)", obddev->obd_refcnt);
if (obddev->obd_flags & OBD_ATTACHED) {
p += sprintf(&page[p], ", attached(%s)",
obddev->obd_type->typ_name);
}
if (obddev->obd_flags & OBD_SET_UP) {
struct dentry *my_dentry;
struct vfsmount *root_mnt;
char *path;
char *pathpage;
if (!(pathpage = (char*) __get_free_page(GFP_KERNEL)))
return -ENOMEM;
my_dentry = obddev->obd_fsname.dentry;
root_mnt = mntget(current->fs->rootmnt);
path = d_path(my_dentry,root_mnt,pathpage,PAGE_SIZE);
p += sprintf(&page[p], ", setup(%s)", path);
free_page((unsigned long) pathpage);
}
/* print connections */
{
struct list_head * lh;
struct obd_client * cli=0;
lh = &obddev->obd_gen_clients;
while ((lh = lh->next) != &obddev->obd_gen_clients) {
p += sprintf(&page[p],
((cli==0) ? ", connections(" : ",") );
cli = list_entry(lh, struct obd_client, cli_chain);
p += sprintf(&page[p], "%d", cli->cli_id);
} /* while */
if (cli!=0) { /* there was at least one client */
p += sprintf(&page[p], ")");
}
}
p += sprintf(&page[p], "\n\0");
}
/* Compute eof and return value */
if (offset + count >= p) {
*eof=1;
return (p - offset);
}
return count;
}
struct proc_dir_entry *
proc_lustre_register_obd_device(struct obd_device *obd)
{
char obdname[32];
struct proc_dir_entry *obd_dir;
struct proc_dir_entry *obd_status = 0;
if (!proc_lustre_dir_entry) {
proc_lustre_dir_entry =
proc_lustre_mkdir("lustre", &proc_root);
if (!proc_lustre_dir_entry)
return 0;
proc_lustre_obd_dir_entry =
proc_lustre_mkdir("obd", proc_lustre_dir_entry);
if (!proc_lustre_obd_dir_entry)
return 0;
}
sprintf(obdname, "%d", obd->obd_minor);
obd_dir = proc_lustre_mkdir(obdname, proc_lustre_obd_dir_entry);
if (obd_dir)
obd_status = create_proc_entry("status", S_IRUSR | S_IFREG, obd_dir);
if (obd_status) {
obd_status->read_proc = read_lustre_status;
obd_status->data = (void*) obd;
}
return obd_dir;
}
void proc_lustre_remove_obd_entry(const char* name, struct obd_device *obd)
{
struct proc_dir_entry *obd_entry = 0;
struct proc_dir_entry *obd_dir = obd->obd_proc_entry;
remove_proc_entry(name, obd_dir);
while (obd_dir->subdir==0) {
/* if we removed last entry in this directory,
* then remove parent directory unless this
* is /proc itself
*/
if (obd_dir == &proc_root)
break;
obd_entry = obd_dir;
obd_dir = obd_dir->parent;
/* If /proc/lustre/obd/XXX or /proc/lustre/obd or
* /proc/lustre are being removed, then reset
* internal variables
*/
if (obd_entry == obd->obd_proc_entry)
obd->obd_proc_entry=0; /* /proc/lustre/obd/XXX */
else
if (obd_entry == proc_lustre_obd_dir_entry)
proc_lustre_obd_dir_entry=0;
else
if (obd_entry == proc_lustre_dir_entry)
proc_lustre_dir_entry=0;
remove_proc_entry(obd_entry->name, obd_dir);
}
}
void proc_lustre_release_obd_device(struct obd_device *obd)
{
proc_lustre_remove_obd_entry("status", obd);
}
#else /* CONFIG_PROC_FS */
struct proc_dir_entry *proc_lustre_register_obd_device(struct obd_device *obd)
{
return 0;
}
void proc_lustre_remove_obd_entry(const char* name, struct obd_device *obd) {}
void proc_lustre_release_obd_device(struct obd_device *obd) {}
#endif /* CONFIG_PROC_FS */
EXPORT_SYMBOL(proc_lustre_remove_obd_entry);
#include <linux/module.h>
#include <linux/autoconf.h> #include <linux/autoconf.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -25,8 +26,6 @@ static int obd_sctl_vars( ctl_table * table, int write, struct file * ...@@ -25,8 +26,6 @@ static int obd_sctl_vars( ctl_table * table, int write, struct file *
static int obd_sctl_reset( ctl_table * table, int write, struct file static int obd_sctl_reset( ctl_table * table, int write, struct file
* filp, void * buffer, size_t * lenp ); * filp, void * buffer, size_t * lenp );
#define OBD_SYSCTL 300 #define OBD_SYSCTL 300
#define OBD_DEBUG 1 /* control debugging */ #define OBD_DEBUG 1 /* control debugging */
...@@ -45,7 +44,7 @@ static ctl_table obd_table[] = { ...@@ -45,7 +44,7 @@ static ctl_table obd_table[] = {
{OBD_VARS, "vars", &vars[0], sizeof(int), 0644, NULL, &proc_dointvec}, {OBD_VARS, "vars", &vars[0], sizeof(int), 0644, NULL, &proc_dointvec},
{OBD_INDEX, "index", &index, sizeof(int), 0644, NULL, &obd_sctl_vars}, {OBD_INDEX, "index", &index, sizeof(int), 0644, NULL, &obd_sctl_vars},
{OBD_RESET, "reset", NULL, 0, 0644, NULL, &obd_sctl_reset}, {OBD_RESET, "reset", NULL, 0, 0644, NULL, &obd_sctl_reset},
{ 0 } { 0 }
}; };
static ctl_table parent_table[] = { static ctl_table parent_table[] = {
...@@ -104,3 +103,7 @@ int obd_sctl_vars (ctl_table * table, int write, ...@@ -104,3 +103,7 @@ int obd_sctl_vars (ctl_table * table, int write,
return rc; return rc;
} }
...@@ -310,7 +310,7 @@ int obdfs_flush_dirty_pages(unsigned long check_time) ...@@ -310,7 +310,7 @@ int obdfs_flush_dirty_pages(unsigned long check_time)
struct list_head *sl; struct list_head *sl;
int max = 0; int max = 0;
ENTRY; /* ENTRY; */
sl = &obdfs_super_list; sl = &obdfs_super_list;
while ( (sl = sl->prev) != &obdfs_super_list ) { while ( (sl = sl->prev) != &obdfs_super_list ) {
struct obdfs_sb_info *sbi = struct obdfs_sb_info *sbi =
...@@ -323,7 +323,7 @@ int obdfs_flush_dirty_pages(unsigned long check_time) ...@@ -323,7 +323,7 @@ int obdfs_flush_dirty_pages(unsigned long check_time)
max = ret > max ? ret : max; max = ret > max ? ret : max;
} }
EXIT; if (max) { EXIT; }
return max; return max;
} /* obdfs_flush_dirty_pages */ } /* obdfs_flush_dirty_pages */
...@@ -387,21 +387,24 @@ static int pupdate(void *unused) ...@@ -387,21 +387,24 @@ static int pupdate(void *unused)
interval = 0; interval = 0;
if ( wrote < pupd_prm.ndirty ) if ( wrote < pupd_prm.ndirty )
age >>= 1; age >>= 1;
CDEBUG(D_CACHE, "wrote %d, age %ld, interval %d\n", if (wrote)
CDEBUG(D_CACHE, "wrote %d, age %ld, interval %d\n",
wrote, age, interval); wrote, age, interval);
} else { } else {
if ( wrote < pupd_prm.ndirty >> 1 && if ( wrote < pupd_prm.ndirty >> 1 &&
obdfs_cache_count < dirty_limit / 2) { obdfs_cache_count < dirty_limit / 2) {
interval = pupd_prm.interval; interval = pupd_prm.interval;
age = pupd_prm.age_buffer; age = pupd_prm.age_buffer;
CDEBUG(D_INFO, if (wrote)
CDEBUG(D_INFO,
"wrote %d, age %ld, interval %d\n", "wrote %d, age %ld, interval %d\n",
wrote, age, interval); wrote, age, interval);
} else if (obdfs_cache_count > dirty_limit / 2) { } else if (obdfs_cache_count > dirty_limit / 2) {
interval >>= 1; interval >>= 1;
if ( wrote < pupd_prm.ndirty ) if ( wrote < pupd_prm.ndirty )
age >>= 1; age >>= 1;
CDEBUG(D_CACHE, if (wrote)
CDEBUG(D_CACHE,
"wrote %d, age %ld, interval %d\n", "wrote %d, age %ld, interval %d\n",
wrote, age, interval); wrote, age, interval);
} }
......
#!/bin/sh -x
mknod -m 0600 /dev/obd0 c 186 0
mknod -m 0600 /dev/obd1 c 186 1
mknod -m 0600 /dev/obd2 c 186 2
mknod -m 0600 /dev/obd3 c 186 3
mknod -m 0600 /dev/obd4 c 186 4
mknod -m 0600 /dev/obd5 c 186 5
mknod -m 0600 /dev/obd6 c 186 6
mknod -m 0600 /dev/obd7 c 186 7
# Print OS version
shell uname -r
# Insert Lustre kernel modules
insmod class/obdclass.o
procsys trace 0
procsys debug 0
insmod ext2obd/obdext2.o
insmod obdtrace/obdtrace.o
insmod obdfs/obdfs.o
# Configure direct driver on /dev/obd0
device /dev/obd0
attach obdext2
setup /dev/sda2
# Configure obdtrace on /dev/obd1
device /dev/obd1
attach obdtrace
setup /dev/obd0
# What's the obd status
status
shell cat /proc/lustre/obd/1/stats
# mount obd file system
shell mkdir -p /mnt/obd
shell mount -t obdfs -odevice=/dev/obd1 none /mnt/obd
shell mount
# Prepare a data set (tar file of current directory)
shell rm -f /tmp/obdtrace_test.tar
shell tar cf /tmp/obdtrace_test.tar .
# make a directory on obd device
shell mkdir -p /mnt/obd/obdtrace_test_dir
# Unpack tarfile to obd device
shell tar -C /mnt/obd/obdtrace_test_dir -xf /tmp/obdtrace_test.tar
shell rm -rf /mnt/obd/obdtrace_test_dir
# Check obdtrace performance stats
status
shell cat /proc/lustre/obd/1/stats
shell echo 0 > /proc/lustre/obd/1/stats
shell cat /proc/lustre/obd/1/stats
# Umount file system
shell umount /mnt/obd
# Cleanup /tmp
shell rm -f /tmp/obdtrace_test.tar
# Dismantle /dev/obd1
device /dev/obd1
cleanup
detach
close
# Dismantle /dev/obd0
device /dev/obd0
cleanup
detach
close
# Remove all loaded kernel modules
rmmod obdfs
rmmod obdtrace
rmmod obdext2
rmmod obdclass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment