* Author: Peter J. Braam <braam@clusterfs.com>
* Author: Phil Schwan <phil@clusterfs.com>
*
- * This file is part of Portals, http://www.sf.net/projects/sandiaportals/
+ * This file is part of Lustre, http://www.lustre.org.
*
- * Portals is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
+ * Lustre 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,
+ * Lustre 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 Lesser General Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with Portals; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with Lustre; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define EXPORT_SYMTAB
+#ifndef EXPORT_SYMTAB
+# define EXPORT_SYMTAB
+#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kp30.h>
#include <asm/div64.h>
+#include "tracefile.h"
static struct ctl_table_header *portals_table_header = NULL;
extern char debug_file_path[1024];
-extern char debug_daemon_file_path[1024];
extern char portals_upcall[1024];
#define PSDEV_PORTALS (0x100)
-#define PSDEV_DEBUG 1 /* control debugging */
-#define PSDEV_SUBSYSTEM_DEBUG 2 /* control debugging */
-#define PSDEV_PRINTK 3 /* force all errors to console */
-#define PSDEV_DEBUG_PATH 4 /* crashdump log location */
-#define PSDEV_DEBUG_DUMP_PATH 5 /* crashdump tracelog location */
-#define PSDEV_PORTALS_UPCALL 6 /* User mode upcall script */
-
-#define PORTALS_PRIMARY_CTLCNT 6
-static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = {
+enum {
+ PSDEV_DEBUG = 1, /* control debugging */
+ PSDEV_SUBSYSTEM_DEBUG, /* control debugging */
+ PSDEV_PRINTK, /* force all errors to console */
+ PSDEV_CONSOLE, /* allow _any_ messages to console */
+ PSDEV_DEBUG_PATH, /* crashdump log location */
+ PSDEV_DEBUG_DUMP_PATH, /* crashdump tracelog location */
+ PSDEV_PORTALS_UPCALL, /* User mode upcall script */
+ PSDEV_PORTALS_MEMUSED, /* bytes currently PORTAL_ALLOCated */
+};
+
+static struct ctl_table portals_table[] = {
{PSDEV_DEBUG, "debug", &portal_debug, sizeof(int), 0644, NULL,
&proc_dointvec},
{PSDEV_SUBSYSTEM_DEBUG, "subsystem_debug", &portal_subsystem_debug,
&proc_dointvec},
{PSDEV_DEBUG_PATH, "debug_path", debug_file_path,
sizeof(debug_file_path), 0644, NULL, &proc_dostring, &sysctl_string},
- {PSDEV_DEBUG_DUMP_PATH, "debug_daemon_path", debug_daemon_file_path,
- sizeof(debug_daemon_file_path), 0644, NULL, &proc_dostring,
- &sysctl_string},
{PSDEV_PORTALS_UPCALL, "upcall", portals_upcall,
sizeof(portals_upcall), 0644, NULL, &proc_dostring,
&sysctl_string},
+ {PSDEV_PORTALS_MEMUSED, "memused", (int *)&portal_kmemory.counter,
+ sizeof(int), 0644, NULL, &proc_dointvec},
{0}
};
int insert_proc(void)
{
+ struct proc_dir_entry *ent;
#if PORTALS_PROFILING
unsigned char dir[128];
- struct proc_dir_entry *ent;
if (ARRAY_SIZE(prof_ents) != MAX_PROFS) {
CERROR("profiling enum and array are out of sync.\n");
portals_table_header = register_sysctl_table(top_table, 0);
#endif
+ ent = create_proc_entry("sys/portals/dump_kernel", 0, NULL);
+ if (ent == NULL) {
+ CERROR("couldn't register dump_kernel\n");
+ return -1;
+ }
+ ent->write_proc = trace_dk;
+
+ ent = create_proc_entry("sys/portals/daemon_file", 0, NULL);
+ if (ent == NULL) {
+ CERROR("couldn't register daemon_file\n");
+ return -1;
+ }
+ ent->write_proc = trace_write_daemon_file;
+ ent->read_proc = trace_read_daemon_file;
+
+ ent = create_proc_entry("sys/portals/debug_mb", 0, NULL);
+ if (ent == NULL) {
+ CERROR("couldn't register debug_mb\n");
+ return -1;
+ }
+ ent->write_proc = trace_write_debug_mb;
+ ent->read_proc = trace_read_debug_mb;
+
return 0;
}
end = strlen(dir);
strcat(dir, "/cycles");
- remove_proc_entry(dir,0);
+ remove_proc_entry(dir, 0);
dir[end] = '\0';
- remove_proc_entry(dir,0);
+ remove_proc_entry(dir, 0);
#endif /* PORTALS_PROFILING */
+ remove_proc_entry("sys/portals/dump_kernel", NULL);
+ remove_proc_entry("sys/portals/daemon_file", NULL);
+ remove_proc_entry("sys/portals/debug_mb", NULL);
+
#ifdef CONFIG_SYSCTL
if (portals_table_header)
unregister_sysctl_table(portals_table_header);