1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
6 * This file is part of Portals, http://www.sf.net/projects/lustre/
8 * Portals 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 * Portals 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 Portals; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Some day I'll split all of this functionality into a cfs_debug module
22 * of its own. That day is not today.
28 #include <portals/api-support.h>
29 #include <portals/ptlctl.h>
34 {"debug_kernel", jt_dbg_debug_kernel, 0, "usage: debug_kernel [file] [raw], get debug buffer and print it [to a file]"},
35 {"debug_daemon", jt_dbg_debug_daemon, 0, "usage: debug_daemon [start file|stop], control debug daemon to dump debug buffer to a file"},
36 {"debug_file", jt_dbg_debug_file, 0, "usage: debug_file <input> [output] [raw], read debug buffer from input and print it [to output]"},
37 {"clear", jt_dbg_clear_debug_buf, 0, "clear kernel debug buffer"},
38 {"mark", jt_dbg_mark_debug_buf, 0, "insert a marker into the kernel debug buffer (args: [marker text])"},
39 {"filter", jt_dbg_filter, 0, "filter certain messages (args: subsystem/debug ID)\n"},
40 {"show", jt_dbg_show, 0, "enable certain messages (args: subsystem/debug ID)\n"},
41 {"list", jt_dbg_list, 0, "list subsystem and debug types (args: subs or types)\n"},
42 {"modules", jt_dbg_modules, 0, "provide gdb-friendly module info (arg: <path>)"},
43 {"panic", jt_dbg_panic, 0, "cause the kernel to panic"},
44 {"dump", jt_ioc_dump, 0, "usage: dump file, save ioctl buffer to file"},
45 {"help", Parser_help, 0, "help"},
46 {"exit", Parser_quit, 0, "quit"},
47 {"quit", Parser_quit, 0, "quit"},
51 int main(int argc, char **argv)
53 if (dbg_initialize(argc, argv) < 0)
56 register_ioc_dev(PORTALS_DEV_ID, PORTALS_DEV_PATH);
58 Parser_init("debugctl > ", list);
60 return Parser_execarg(argc - 1, &argv[1], list);
64 unregister_ioc_dev(PORTALS_DEV_ID);