2008-05-12 19:20:56 +00:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* Copyright (C) IBM Corporation, 2005
|
|
|
|
* Jeff Muizelaar, 2006, 2007
|
|
|
|
* Pekka Paalanen, 2008 <pq@iki.fi>
|
|
|
|
*
|
|
|
|
* Derived from the read-mod example from relay-examples by Tom Zanussi.
|
|
|
|
*/
|
2008-05-12 19:20:57 +00:00
|
|
|
#define DEBUG 1
|
|
|
|
|
2008-05-12 19:20:56 +00:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/relay.h>
|
|
|
|
#include <linux/debugfs.h>
|
|
|
|
#include <linux/proc_fs.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <linux/version.h>
|
|
|
|
#include <linux/kallsyms.h>
|
|
|
|
#include <asm/pgtable.h>
|
|
|
|
#include <linux/mmiotrace.h>
|
|
|
|
#include <asm/e820.h> /* for ISA_START_ADDRESS */
|
2008-05-12 19:20:56 +00:00
|
|
|
#include <asm/atomic.h>
|
2008-05-12 19:20:57 +00:00
|
|
|
#include <linux/percpu.h>
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
#include "pf_in.h"
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
#define NAME "mmiotrace: "
|
2008-05-12 19:20:56 +00:00
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
/* This app's relay channel files will appear in /debug/mmio-trace */
|
|
|
|
static const char APP_DIR[] = "mmio-trace";
|
|
|
|
/* the marker injection file in /debug/APP_DIR */
|
|
|
|
static const char MARKER_FILE[] = "mmio-marker";
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
struct trap_reason {
|
|
|
|
unsigned long addr;
|
|
|
|
unsigned long ip;
|
|
|
|
enum reason_type type;
|
|
|
|
int active_traces;
|
|
|
|
};
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
struct remap_trace {
|
|
|
|
struct list_head list;
|
|
|
|
struct kmmio_probe probe;
|
|
|
|
unsigned long phys;
|
|
|
|
unsigned long id;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const size_t subbuf_size = 256*1024;
|
|
|
|
|
2008-05-12 19:20:56 +00:00
|
|
|
/* Accessed per-cpu. */
|
2008-05-12 19:20:57 +00:00
|
|
|
static DEFINE_PER_CPU(struct trap_reason, pf_reason);
|
|
|
|
static DEFINE_PER_CPU(struct mm_io_header_rw, cpu_trace);
|
2008-05-12 19:20:56 +00:00
|
|
|
|
2008-05-12 19:20:56 +00:00
|
|
|
/* Access to this is not per-cpu. */
|
2008-05-12 19:20:57 +00:00
|
|
|
static DEFINE_PER_CPU(atomic_t, dropped);
|
2008-05-12 19:20:56 +00:00
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
static struct dentry *dir;
|
|
|
|
static struct dentry *enabled_file;
|
|
|
|
static struct dentry *marker_file;
|
2008-05-12 19:20:56 +00:00
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
static DEFINE_MUTEX(mmiotrace_mutex);
|
|
|
|
static DEFINE_SPINLOCK(trace_lock);
|
|
|
|
static atomic_t mmiotrace_enabled;
|
|
|
|
static LIST_HEAD(trace_list); /* struct remap_trace */
|
2008-05-12 19:20:56 +00:00
|
|
|
static struct rchan *chan;
|
2008-05-12 19:20:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Locking in this file:
|
|
|
|
* - mmiotrace_mutex enforces enable/disable_mmiotrace() critical sections.
|
|
|
|
* - mmiotrace_enabled may be modified only when holding mmiotrace_mutex
|
|
|
|
* and trace_lock.
|
|
|
|
* - Routines depending on is_enabled() must take trace_lock.
|
|
|
|
* - trace_list users must hold trace_lock.
|
|
|
|
* - is_enabled() guarantees that chan is valid.
|
|
|
|
* - pre/post callbacks assume the effect of is_enabled() being true.
|
|
|
|
*/
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
/* module parameters */
|
2008-05-12 19:20:57 +00:00
|
|
|
static unsigned int n_subbufs = 32*4;
|
|
|
|
static unsigned long filter_offset;
|
|
|
|
static int nommiotrace;
|
|
|
|
static int ISA_trace;
|
|
|
|
static int trace_pc;
|
|
|
|
static int enable_now;
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
module_param(n_subbufs, uint, 0);
|
|
|
|
module_param(filter_offset, ulong, 0);
|
|
|
|
module_param(nommiotrace, bool, 0);
|
|
|
|
module_param(ISA_trace, bool, 0);
|
|
|
|
module_param(trace_pc, bool, 0);
|
2008-05-12 19:20:57 +00:00
|
|
|
module_param(enable_now, bool, 0);
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
MODULE_PARM_DESC(n_subbufs, "Number of 256kB buffers, default 128.");
|
|
|
|
MODULE_PARM_DESC(filter_offset, "Start address of traced mappings.");
|
|
|
|
MODULE_PARM_DESC(nommiotrace, "Disable actual MMIO tracing.");
|
|
|
|
MODULE_PARM_DESC(ISA_trace, "Do not exclude the low ISA range.");
|
|
|
|
MODULE_PARM_DESC(trace_pc, "Record address of faulting instructions.");
|
2008-05-12 19:20:57 +00:00
|
|
|
MODULE_PARM_DESC(enable_now, "Start mmiotracing immediately on module load.");
|
|
|
|
|
|
|
|
static bool is_enabled(void)
|
|
|
|
{
|
|
|
|
return atomic_read(&mmiotrace_enabled);
|
|
|
|
}
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
static void record_timestamp(struct mm_io_header *header)
|
|
|
|
{
|
|
|
|
struct timespec now;
|
|
|
|
|
|
|
|
getnstimeofday(&now);
|
|
|
|
header->sec = now.tv_sec;
|
|
|
|
header->nsec = now.tv_nsec;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-05-12 19:20:57 +00:00
|
|
|
* Write callback for the debugfs entry:
|
2008-05-12 19:20:56 +00:00
|
|
|
* Read a marker and write it to the mmio trace log
|
|
|
|
*/
|
2008-05-12 19:20:57 +00:00
|
|
|
static ssize_t write_marker(struct file *file, const char __user *buffer,
|
|
|
|
size_t count, loff_t *ppos)
|
2008-05-12 19:20:56 +00:00
|
|
|
{
|
|
|
|
char *event = NULL;
|
|
|
|
struct mm_io_header *headp;
|
2008-05-12 19:20:57 +00:00
|
|
|
ssize_t len = (count > 65535) ? 65535 : count;
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
event = kzalloc(sizeof(*headp) + len, GFP_KERNEL);
|
|
|
|
if (!event)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
headp = (struct mm_io_header *)event;
|
|
|
|
headp->type = MMIO_MAGIC | (MMIO_MARKER << MMIO_OPCODE_SHIFT);
|
|
|
|
headp->data_len = len;
|
|
|
|
record_timestamp(headp);
|
|
|
|
|
|
|
|
if (copy_from_user(event + sizeof(*headp), buffer, len)) {
|
|
|
|
kfree(event);
|
|
|
|
return -EFAULT;
|
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
spin_lock_irq(&trace_lock);
|
|
|
|
if (is_enabled())
|
|
|
|
relay_write(chan, event, sizeof(*headp) + len);
|
|
|
|
else
|
|
|
|
len = -EINVAL;
|
|
|
|
spin_unlock_irq(&trace_lock);
|
2008-05-12 19:20:56 +00:00
|
|
|
kfree(event);
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_pte(unsigned long address)
|
|
|
|
{
|
2008-05-12 19:20:56 +00:00
|
|
|
int level;
|
|
|
|
pte_t *pte = lookup_address(address, &level);
|
|
|
|
|
|
|
|
if (!pte) {
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_err(NAME "Error in %s: no pte for page 0x%08lx\n",
|
x86: mmiotrace full patch, preview 1
kmmio.c handles the list of mmio probes with callbacks, list of traced
pages, and attaching into the page fault handler and die notifier. It
arms, traps and disarms the given pages, this is the core of mmiotrace.
mmio-mod.c is a user interface, hooking into ioremap functions and
registering the mmio probes. It also decodes the required information
from trapped mmio accesses via the pre and post callbacks in each probe.
Currently, hooking into ioremap functions works by redefining the symbols
of the target (binary) kernel module, so that it calls the traced
versions of the functions.
The most notable changes done since the last discussion are:
- kmmio.c is a built-in, not part of the module
- direct call from fault.c to kmmio.c, removing all dynamic hooks
- prepare for unregistering probes at any time
- make kmmio re-initializable and accessible to more than one user
- rewrite kmmio locking to remove all spinlocks from page fault path
Can I abuse call_rcu() like I do in kmmio.c:unregister_kmmio_probe()
or is there a better way?
The function called via call_rcu() itself calls call_rcu() again,
will this work or break? There I need a second grace period for RCU
after the first grace period for page faults.
Mmiotrace itself (mmio-mod.c) is still a module, I am going to attack
that next. At some point I will start looking into how to make mmiotrace
a tracer component of ftrace (thanks for the hint, Ingo). Ftrace should
make the user space part of mmiotracing as simple as
'cat /debug/trace/mmio > dump.txt'.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-12 19:20:57 +00:00
|
|
|
__func__, address);
|
2008-05-12 19:20:56 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (level == PG_LEVEL_2M) {
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_emerg(NAME "4MB pages are not currently supported: "
|
|
|
|
"0x%08lx\n", address);
|
2008-05-12 19:20:56 +00:00
|
|
|
BUG();
|
|
|
|
}
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_info(NAME "pte for 0x%lx: 0x%lx 0x%lx\n", address, pte_val(*pte),
|
|
|
|
pte_val(*pte) & _PAGE_PRESENT);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For some reason the pre/post pairs have been called in an
|
|
|
|
* unmatched order. Report and die.
|
|
|
|
*/
|
|
|
|
static void die_kmmio_nesting_error(struct pt_regs *regs, unsigned long addr)
|
|
|
|
{
|
2008-05-12 19:20:57 +00:00
|
|
|
const struct trap_reason *my_reason = &get_cpu_var(pf_reason);
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_emerg(NAME "unexpected fault for address: 0x%08lx, "
|
|
|
|
"last fault for address: 0x%08lx\n",
|
2008-05-12 19:20:57 +00:00
|
|
|
addr, my_reason->addr);
|
2008-05-12 19:20:56 +00:00
|
|
|
print_pte(addr);
|
2008-05-12 19:20:57 +00:00
|
|
|
print_symbol(KERN_EMERG "faulting IP is at %s\n", regs->ip);
|
|
|
|
print_symbol(KERN_EMERG "last faulting IP was at %s\n", my_reason->ip);
|
2008-05-12 19:20:56 +00:00
|
|
|
#ifdef __i386__
|
x86: mmiotrace full patch, preview 1
kmmio.c handles the list of mmio probes with callbacks, list of traced
pages, and attaching into the page fault handler and die notifier. It
arms, traps and disarms the given pages, this is the core of mmiotrace.
mmio-mod.c is a user interface, hooking into ioremap functions and
registering the mmio probes. It also decodes the required information
from trapped mmio accesses via the pre and post callbacks in each probe.
Currently, hooking into ioremap functions works by redefining the symbols
of the target (binary) kernel module, so that it calls the traced
versions of the functions.
The most notable changes done since the last discussion are:
- kmmio.c is a built-in, not part of the module
- direct call from fault.c to kmmio.c, removing all dynamic hooks
- prepare for unregistering probes at any time
- make kmmio re-initializable and accessible to more than one user
- rewrite kmmio locking to remove all spinlocks from page fault path
Can I abuse call_rcu() like I do in kmmio.c:unregister_kmmio_probe()
or is there a better way?
The function called via call_rcu() itself calls call_rcu() again,
will this work or break? There I need a second grace period for RCU
after the first grace period for page faults.
Mmiotrace itself (mmio-mod.c) is still a module, I am going to attack
that next. At some point I will start looking into how to make mmiotrace
a tracer component of ftrace (thanks for the hint, Ingo). Ftrace should
make the user space part of mmiotracing as simple as
'cat /debug/trace/mmio > dump.txt'.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-12 19:20:57 +00:00
|
|
|
pr_emerg("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
|
2008-05-12 19:20:56 +00:00
|
|
|
regs->ax, regs->bx, regs->cx, regs->dx);
|
x86: mmiotrace full patch, preview 1
kmmio.c handles the list of mmio probes with callbacks, list of traced
pages, and attaching into the page fault handler and die notifier. It
arms, traps and disarms the given pages, this is the core of mmiotrace.
mmio-mod.c is a user interface, hooking into ioremap functions and
registering the mmio probes. It also decodes the required information
from trapped mmio accesses via the pre and post callbacks in each probe.
Currently, hooking into ioremap functions works by redefining the symbols
of the target (binary) kernel module, so that it calls the traced
versions of the functions.
The most notable changes done since the last discussion are:
- kmmio.c is a built-in, not part of the module
- direct call from fault.c to kmmio.c, removing all dynamic hooks
- prepare for unregistering probes at any time
- make kmmio re-initializable and accessible to more than one user
- rewrite kmmio locking to remove all spinlocks from page fault path
Can I abuse call_rcu() like I do in kmmio.c:unregister_kmmio_probe()
or is there a better way?
The function called via call_rcu() itself calls call_rcu() again,
will this work or break? There I need a second grace period for RCU
after the first grace period for page faults.
Mmiotrace itself (mmio-mod.c) is still a module, I am going to attack
that next. At some point I will start looking into how to make mmiotrace
a tracer component of ftrace (thanks for the hint, Ingo). Ftrace should
make the user space part of mmiotracing as simple as
'cat /debug/trace/mmio > dump.txt'.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-12 19:20:57 +00:00
|
|
|
pr_emerg("esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n",
|
2008-05-12 19:20:56 +00:00
|
|
|
regs->si, regs->di, regs->bp, regs->sp);
|
|
|
|
#else
|
x86: mmiotrace full patch, preview 1
kmmio.c handles the list of mmio probes with callbacks, list of traced
pages, and attaching into the page fault handler and die notifier. It
arms, traps and disarms the given pages, this is the core of mmiotrace.
mmio-mod.c is a user interface, hooking into ioremap functions and
registering the mmio probes. It also decodes the required information
from trapped mmio accesses via the pre and post callbacks in each probe.
Currently, hooking into ioremap functions works by redefining the symbols
of the target (binary) kernel module, so that it calls the traced
versions of the functions.
The most notable changes done since the last discussion are:
- kmmio.c is a built-in, not part of the module
- direct call from fault.c to kmmio.c, removing all dynamic hooks
- prepare for unregistering probes at any time
- make kmmio re-initializable and accessible to more than one user
- rewrite kmmio locking to remove all spinlocks from page fault path
Can I abuse call_rcu() like I do in kmmio.c:unregister_kmmio_probe()
or is there a better way?
The function called via call_rcu() itself calls call_rcu() again,
will this work or break? There I need a second grace period for RCU
after the first grace period for page faults.
Mmiotrace itself (mmio-mod.c) is still a module, I am going to attack
that next. At some point I will start looking into how to make mmiotrace
a tracer component of ftrace (thanks for the hint, Ingo). Ftrace should
make the user space part of mmiotracing as simple as
'cat /debug/trace/mmio > dump.txt'.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-12 19:20:57 +00:00
|
|
|
pr_emerg("rax: %016lx rcx: %016lx rdx: %016lx\n",
|
2008-05-12 19:20:56 +00:00
|
|
|
regs->ax, regs->cx, regs->dx);
|
x86: mmiotrace full patch, preview 1
kmmio.c handles the list of mmio probes with callbacks, list of traced
pages, and attaching into the page fault handler and die notifier. It
arms, traps and disarms the given pages, this is the core of mmiotrace.
mmio-mod.c is a user interface, hooking into ioremap functions and
registering the mmio probes. It also decodes the required information
from trapped mmio accesses via the pre and post callbacks in each probe.
Currently, hooking into ioremap functions works by redefining the symbols
of the target (binary) kernel module, so that it calls the traced
versions of the functions.
The most notable changes done since the last discussion are:
- kmmio.c is a built-in, not part of the module
- direct call from fault.c to kmmio.c, removing all dynamic hooks
- prepare for unregistering probes at any time
- make kmmio re-initializable and accessible to more than one user
- rewrite kmmio locking to remove all spinlocks from page fault path
Can I abuse call_rcu() like I do in kmmio.c:unregister_kmmio_probe()
or is there a better way?
The function called via call_rcu() itself calls call_rcu() again,
will this work or break? There I need a second grace period for RCU
after the first grace period for page faults.
Mmiotrace itself (mmio-mod.c) is still a module, I am going to attack
that next. At some point I will start looking into how to make mmiotrace
a tracer component of ftrace (thanks for the hint, Ingo). Ftrace should
make the user space part of mmiotracing as simple as
'cat /debug/trace/mmio > dump.txt'.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-12 19:20:57 +00:00
|
|
|
pr_emerg("rsi: %016lx rdi: %016lx rbp: %016lx rsp: %016lx\n",
|
2008-05-12 19:20:56 +00:00
|
|
|
regs->si, regs->di, regs->bp, regs->sp);
|
|
|
|
#endif
|
2008-05-12 19:20:57 +00:00
|
|
|
put_cpu_var(pf_reason);
|
2008-05-12 19:20:56 +00:00
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void pre(struct kmmio_probe *p, struct pt_regs *regs,
|
|
|
|
unsigned long addr)
|
|
|
|
{
|
2008-05-12 19:20:57 +00:00
|
|
|
struct trap_reason *my_reason = &get_cpu_var(pf_reason);
|
|
|
|
struct mm_io_header_rw *my_trace = &get_cpu_var(cpu_trace);
|
2008-05-12 19:20:56 +00:00
|
|
|
const unsigned long instptr = instruction_pointer(regs);
|
|
|
|
const enum reason_type type = get_ins_type(instptr);
|
|
|
|
|
|
|
|
/* it doesn't make sense to have more than one active trace per cpu */
|
2008-05-12 19:20:57 +00:00
|
|
|
if (my_reason->active_traces)
|
2008-05-12 19:20:56 +00:00
|
|
|
die_kmmio_nesting_error(regs, addr);
|
|
|
|
else
|
2008-05-12 19:20:57 +00:00
|
|
|
my_reason->active_traces++;
|
2008-05-12 19:20:56 +00:00
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
my_reason->type = type;
|
|
|
|
my_reason->addr = addr;
|
|
|
|
my_reason->ip = instptr;
|
2008-05-12 19:20:56 +00:00
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->header.type = MMIO_MAGIC;
|
|
|
|
my_trace->header.pid = 0;
|
|
|
|
my_trace->header.data_len = sizeof(struct mm_io_rw);
|
|
|
|
my_trace->rw.address = addr;
|
2008-05-12 19:20:57 +00:00
|
|
|
/*
|
|
|
|
* struct remap_trace *trace = p->user_data;
|
|
|
|
* phys = addr - trace->probe.addr + trace->phys;
|
|
|
|
*/
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Only record the program counter when requested.
|
|
|
|
* It may taint clean-room reverse engineering.
|
|
|
|
*/
|
|
|
|
if (trace_pc)
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->rw.pc = instptr;
|
2008-05-12 19:20:56 +00:00
|
|
|
else
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->rw.pc = 0;
|
2008-05-12 19:20:56 +00:00
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
record_timestamp(&my_trace->header);
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case REG_READ:
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->header.type |=
|
2008-05-12 19:20:56 +00:00
|
|
|
(MMIO_READ << MMIO_OPCODE_SHIFT) |
|
|
|
|
(get_ins_mem_width(instptr) << MMIO_WIDTH_SHIFT);
|
|
|
|
break;
|
|
|
|
case REG_WRITE:
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->header.type |=
|
2008-05-12 19:20:56 +00:00
|
|
|
(MMIO_WRITE << MMIO_OPCODE_SHIFT) |
|
|
|
|
(get_ins_mem_width(instptr) << MMIO_WIDTH_SHIFT);
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->rw.value = get_ins_reg_val(instptr, regs);
|
2008-05-12 19:20:56 +00:00
|
|
|
break;
|
|
|
|
case IMM_WRITE:
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->header.type |=
|
2008-05-12 19:20:56 +00:00
|
|
|
(MMIO_WRITE << MMIO_OPCODE_SHIFT) |
|
|
|
|
(get_ins_mem_width(instptr) << MMIO_WIDTH_SHIFT);
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->rw.value = get_ins_imm_val(instptr);
|
2008-05-12 19:20:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
unsigned char *ip = (unsigned char *)instptr;
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->header.type |=
|
2008-05-12 19:20:56 +00:00
|
|
|
(MMIO_UNKNOWN_OP << MMIO_OPCODE_SHIFT);
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->rw.value = (*ip) << 16 | *(ip + 1) << 8 |
|
|
|
|
*(ip + 2);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
}
|
2008-05-12 19:20:57 +00:00
|
|
|
put_cpu_var(cpu_trace);
|
|
|
|
put_cpu_var(pf_reason);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void post(struct kmmio_probe *p, unsigned long condition,
|
|
|
|
struct pt_regs *regs)
|
|
|
|
{
|
2008-05-12 19:20:57 +00:00
|
|
|
struct trap_reason *my_reason = &get_cpu_var(pf_reason);
|
|
|
|
struct mm_io_header_rw *my_trace = &get_cpu_var(cpu_trace);
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
/* this should always return the active_trace count to 0 */
|
2008-05-12 19:20:57 +00:00
|
|
|
my_reason->active_traces--;
|
|
|
|
if (my_reason->active_traces) {
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_emerg(NAME "unexpected post handler");
|
2008-05-12 19:20:56 +00:00
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
switch (my_reason->type) {
|
2008-05-12 19:20:56 +00:00
|
|
|
case REG_READ:
|
2008-05-12 19:20:57 +00:00
|
|
|
my_trace->rw.value = get_ins_reg_val(my_reason->ip, regs);
|
2008-05-12 19:20:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2008-05-12 19:20:57 +00:00
|
|
|
relay_write(chan, my_trace, sizeof(*my_trace));
|
|
|
|
put_cpu_var(cpu_trace);
|
|
|
|
put_cpu_var(pf_reason);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* subbuf_start() relay callback.
|
|
|
|
*
|
|
|
|
* Defined so that we know when events are dropped due to the buffer-full
|
|
|
|
* condition.
|
|
|
|
*/
|
|
|
|
static int subbuf_start_handler(struct rchan_buf *buf, void *subbuf,
|
|
|
|
void *prev_subbuf, size_t prev_padding)
|
|
|
|
{
|
2008-05-12 19:20:56 +00:00
|
|
|
unsigned int cpu = buf->cpu;
|
2008-05-12 19:20:57 +00:00
|
|
|
atomic_t *drop = &per_cpu(dropped, cpu);
|
2008-05-12 19:20:56 +00:00
|
|
|
int count;
|
2008-05-12 19:20:56 +00:00
|
|
|
if (relay_buf_full(buf)) {
|
x86: mmiotrace full patch, preview 1
kmmio.c handles the list of mmio probes with callbacks, list of traced
pages, and attaching into the page fault handler and die notifier. It
arms, traps and disarms the given pages, this is the core of mmiotrace.
mmio-mod.c is a user interface, hooking into ioremap functions and
registering the mmio probes. It also decodes the required information
from trapped mmio accesses via the pre and post callbacks in each probe.
Currently, hooking into ioremap functions works by redefining the symbols
of the target (binary) kernel module, so that it calls the traced
versions of the functions.
The most notable changes done since the last discussion are:
- kmmio.c is a built-in, not part of the module
- direct call from fault.c to kmmio.c, removing all dynamic hooks
- prepare for unregistering probes at any time
- make kmmio re-initializable and accessible to more than one user
- rewrite kmmio locking to remove all spinlocks from page fault path
Can I abuse call_rcu() like I do in kmmio.c:unregister_kmmio_probe()
or is there a better way?
The function called via call_rcu() itself calls call_rcu() again,
will this work or break? There I need a second grace period for RCU
after the first grace period for page faults.
Mmiotrace itself (mmio-mod.c) is still a module, I am going to attack
that next. At some point I will start looking into how to make mmiotrace
a tracer component of ftrace (thanks for the hint, Ingo). Ftrace should
make the user space part of mmiotracing as simple as
'cat /debug/trace/mmio > dump.txt'.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-12 19:20:57 +00:00
|
|
|
if (atomic_inc_return(drop) == 1)
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_err(NAME "cpu %d buffer full!\n", cpu);
|
2008-05-12 19:20:56 +00:00
|
|
|
return 0;
|
x86: mmiotrace full patch, preview 1
kmmio.c handles the list of mmio probes with callbacks, list of traced
pages, and attaching into the page fault handler and die notifier. It
arms, traps and disarms the given pages, this is the core of mmiotrace.
mmio-mod.c is a user interface, hooking into ioremap functions and
registering the mmio probes. It also decodes the required information
from trapped mmio accesses via the pre and post callbacks in each probe.
Currently, hooking into ioremap functions works by redefining the symbols
of the target (binary) kernel module, so that it calls the traced
versions of the functions.
The most notable changes done since the last discussion are:
- kmmio.c is a built-in, not part of the module
- direct call from fault.c to kmmio.c, removing all dynamic hooks
- prepare for unregistering probes at any time
- make kmmio re-initializable and accessible to more than one user
- rewrite kmmio locking to remove all spinlocks from page fault path
Can I abuse call_rcu() like I do in kmmio.c:unregister_kmmio_probe()
or is there a better way?
The function called via call_rcu() itself calls call_rcu() again,
will this work or break? There I need a second grace period for RCU
after the first grace period for page faults.
Mmiotrace itself (mmio-mod.c) is still a module, I am going to attack
that next. At some point I will start looking into how to make mmiotrace
a tracer component of ftrace (thanks for the hint, Ingo). Ftrace should
make the user space part of mmiotracing as simple as
'cat /debug/trace/mmio > dump.txt'.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-12 19:20:57 +00:00
|
|
|
}
|
|
|
|
count = atomic_read(drop);
|
|
|
|
if (count) {
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_err(NAME "cpu %d buffer no longer full, missed %d events.\n",
|
|
|
|
cpu, count);
|
2008-05-12 19:20:56 +00:00
|
|
|
atomic_sub(count, drop);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
static struct file_operations mmio_fops = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
};
|
|
|
|
|
2008-05-12 19:20:56 +00:00
|
|
|
/* file_create() callback. Creates relay file in debugfs. */
|
|
|
|
static struct dentry *create_buf_file_handler(const char *filename,
|
|
|
|
struct dentry *parent,
|
|
|
|
int mode,
|
|
|
|
struct rchan_buf *buf,
|
|
|
|
int *is_global)
|
|
|
|
{
|
|
|
|
struct dentry *buf_file;
|
|
|
|
|
|
|
|
mmio_fops.read = relay_file_operations.read;
|
|
|
|
mmio_fops.open = relay_file_operations.open;
|
|
|
|
mmio_fops.poll = relay_file_operations.poll;
|
|
|
|
mmio_fops.mmap = relay_file_operations.mmap;
|
|
|
|
mmio_fops.release = relay_file_operations.release;
|
|
|
|
mmio_fops.splice_read = relay_file_operations.splice_read;
|
|
|
|
|
|
|
|
buf_file = debugfs_create_file(filename, mode, parent, buf,
|
|
|
|
&mmio_fops);
|
|
|
|
|
|
|
|
return buf_file;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* file_remove() default callback. Removes relay file in debugfs. */
|
|
|
|
static int remove_buf_file_handler(struct dentry *dentry)
|
|
|
|
{
|
|
|
|
debugfs_remove(dentry);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct rchan_callbacks relay_callbacks = {
|
|
|
|
.subbuf_start = subbuf_start_handler,
|
|
|
|
.create_buf_file = create_buf_file_handler,
|
|
|
|
.remove_buf_file = remove_buf_file_handler,
|
|
|
|
};
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
static void ioremap_trace_core(unsigned long offset, unsigned long size,
|
2008-05-12 19:20:56 +00:00
|
|
|
void __iomem *addr)
|
|
|
|
{
|
2008-05-12 19:20:57 +00:00
|
|
|
static atomic_t next_id;
|
2008-05-12 19:20:56 +00:00
|
|
|
struct remap_trace *trace = kmalloc(sizeof(*trace), GFP_KERNEL);
|
|
|
|
struct mm_io_header_map event = {
|
|
|
|
.header = {
|
|
|
|
.type = MMIO_MAGIC |
|
|
|
|
(MMIO_PROBE << MMIO_OPCODE_SHIFT),
|
|
|
|
.sec = 0,
|
|
|
|
.nsec = 0,
|
|
|
|
.pid = 0,
|
|
|
|
.data_len = sizeof(struct mm_io_map)
|
|
|
|
},
|
|
|
|
.map = {
|
|
|
|
.phys = offset,
|
|
|
|
.addr = (unsigned long)addr,
|
|
|
|
.len = size,
|
|
|
|
.pc = 0
|
|
|
|
}
|
|
|
|
};
|
|
|
|
record_timestamp(&event.header);
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
if (!trace) {
|
|
|
|
pr_err(NAME "kmalloc failed in ioremap\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:56 +00:00
|
|
|
*trace = (struct remap_trace) {
|
|
|
|
.probe = {
|
|
|
|
.addr = (unsigned long)addr,
|
|
|
|
.len = size,
|
|
|
|
.pre_handler = pre,
|
|
|
|
.post_handler = post,
|
2008-05-12 19:20:57 +00:00
|
|
|
.user_data = trace
|
|
|
|
},
|
|
|
|
.phys = offset,
|
|
|
|
.id = atomic_inc_return(&next_id)
|
2008-05-12 19:20:56 +00:00
|
|
|
};
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
spin_lock_irq(&trace_lock);
|
|
|
|
if (!is_enabled())
|
|
|
|
goto not_enabled;
|
|
|
|
|
2008-05-12 19:20:56 +00:00
|
|
|
relay_write(chan, &event, sizeof(event));
|
|
|
|
list_add_tail(&trace->list, &trace_list);
|
|
|
|
if (!nommiotrace)
|
|
|
|
register_kmmio_probe(&trace->probe);
|
2008-05-12 19:20:57 +00:00
|
|
|
|
|
|
|
not_enabled:
|
|
|
|
spin_unlock_irq(&trace_lock);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
void
|
|
|
|
mmiotrace_ioremap(unsigned long offset, unsigned long size, void __iomem *addr)
|
2008-05-12 19:20:56 +00:00
|
|
|
{
|
2008-05-12 19:20:57 +00:00
|
|
|
if (!is_enabled()) /* recheck and proper locking in *_core() */
|
2008-05-12 19:20:56 +00:00
|
|
|
return;
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_debug(NAME "ioremap_*(0x%lx, 0x%lx) = %p\n", offset, size, addr);
|
|
|
|
if ((filter_offset) && (offset != filter_offset))
|
2008-05-12 19:20:56 +00:00
|
|
|
return;
|
2008-05-12 19:20:57 +00:00
|
|
|
ioremap_trace_core(offset, size, addr);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
static void iounmap_trace_core(volatile void __iomem *addr)
|
2008-05-12 19:20:56 +00:00
|
|
|
{
|
|
|
|
struct mm_io_header_map event = {
|
|
|
|
.header = {
|
|
|
|
.type = MMIO_MAGIC |
|
|
|
|
(MMIO_UNPROBE << MMIO_OPCODE_SHIFT),
|
|
|
|
.sec = 0,
|
|
|
|
.nsec = 0,
|
|
|
|
.pid = 0,
|
|
|
|
.data_len = sizeof(struct mm_io_map)
|
|
|
|
},
|
|
|
|
.map = {
|
|
|
|
.phys = 0,
|
|
|
|
.addr = (unsigned long)addr,
|
|
|
|
.len = 0,
|
|
|
|
.pc = 0
|
|
|
|
}
|
|
|
|
};
|
|
|
|
struct remap_trace *trace;
|
|
|
|
struct remap_trace *tmp;
|
2008-05-12 19:20:57 +00:00
|
|
|
struct remap_trace *found_trace = NULL;
|
|
|
|
|
|
|
|
pr_debug(NAME "Unmapping %p.\n", addr);
|
2008-05-12 19:20:56 +00:00
|
|
|
record_timestamp(&event.header);
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
spin_lock_irq(&trace_lock);
|
|
|
|
if (!is_enabled())
|
|
|
|
goto not_enabled;
|
|
|
|
|
2008-05-12 19:20:56 +00:00
|
|
|
list_for_each_entry_safe(trace, tmp, &trace_list, list) {
|
|
|
|
if ((unsigned long)addr == trace->probe.addr) {
|
|
|
|
if (!nommiotrace)
|
|
|
|
unregister_kmmio_probe(&trace->probe);
|
|
|
|
list_del(&trace->list);
|
2008-05-12 19:20:57 +00:00
|
|
|
found_trace = trace;
|
2008-05-12 19:20:56 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
relay_write(chan, &event, sizeof(event));
|
2008-05-12 19:20:57 +00:00
|
|
|
|
|
|
|
not_enabled:
|
|
|
|
spin_unlock_irq(&trace_lock);
|
|
|
|
if (found_trace) {
|
|
|
|
synchronize_rcu(); /* unregister_kmmio_probe() requirement */
|
|
|
|
kfree(found_trace);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void mmiotrace_iounmap(volatile void __iomem *addr)
|
|
|
|
{
|
|
|
|
might_sleep();
|
|
|
|
if (is_enabled()) /* recheck and proper locking in *_core() */
|
|
|
|
iounmap_trace_core(addr);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void clear_trace_list(void)
|
|
|
|
{
|
|
|
|
struct remap_trace *trace;
|
|
|
|
struct remap_trace *tmp;
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
/*
|
|
|
|
* No locking required, because the caller ensures we are in a
|
|
|
|
* critical section via mutex, and is_enabled() is false,
|
|
|
|
* i.e. nothing can traverse or modify this list.
|
|
|
|
* Caller also ensures is_enabled() cannot change.
|
|
|
|
*/
|
|
|
|
list_for_each_entry(trace, &trace_list, list) {
|
|
|
|
pr_notice(NAME "purging non-iounmapped "
|
2008-05-12 19:20:56 +00:00
|
|
|
"trace @0x%08lx, size 0x%lx.\n",
|
|
|
|
trace->probe.addr, trace->probe.len);
|
|
|
|
if (!nommiotrace)
|
|
|
|
unregister_kmmio_probe(&trace->probe);
|
2008-05-12 19:20:57 +00:00
|
|
|
}
|
|
|
|
synchronize_rcu(); /* unregister_kmmio_probe() requirement */
|
|
|
|
|
|
|
|
list_for_each_entry_safe(trace, tmp, &trace_list, list) {
|
2008-05-12 19:20:56 +00:00
|
|
|
list_del(&trace->list);
|
|
|
|
kfree(trace);
|
2008-05-12 19:20:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t read_enabled_file_bool(struct file *file,
|
|
|
|
char __user *user_buf, size_t count, loff_t *ppos)
|
|
|
|
{
|
|
|
|
char buf[3];
|
|
|
|
|
|
|
|
if (is_enabled())
|
|
|
|
buf[0] = '1';
|
|
|
|
else
|
|
|
|
buf[0] = '0';
|
|
|
|
buf[1] = '\n';
|
|
|
|
buf[2] = '\0';
|
|
|
|
return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void enable_mmiotrace(void);
|
|
|
|
static void disable_mmiotrace(void);
|
|
|
|
|
|
|
|
static ssize_t write_enabled_file_bool(struct file *file,
|
|
|
|
const char __user *user_buf, size_t count, loff_t *ppos)
|
|
|
|
{
|
|
|
|
char buf[32];
|
|
|
|
int buf_size = min(count, (sizeof(buf)-1));
|
|
|
|
|
|
|
|
if (copy_from_user(buf, user_buf, buf_size))
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
switch (buf[0]) {
|
|
|
|
case 'y':
|
|
|
|
case 'Y':
|
|
|
|
case '1':
|
|
|
|
enable_mmiotrace();
|
|
|
|
break;
|
|
|
|
case 'n':
|
|
|
|
case 'N':
|
|
|
|
case '0':
|
|
|
|
disable_mmiotrace();
|
2008-05-12 19:20:56 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-05-12 19:20:57 +00:00
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* this ripped from kernel/kprobes.c */
|
|
|
|
static struct file_operations fops_enabled = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.read = read_enabled_file_bool,
|
|
|
|
.write = write_enabled_file_bool
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct file_operations fops_marker = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.write = write_marker
|
|
|
|
};
|
|
|
|
|
|
|
|
static void enable_mmiotrace(void)
|
|
|
|
{
|
|
|
|
mutex_lock(&mmiotrace_mutex);
|
|
|
|
if (is_enabled())
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
chan = relay_open("cpu", dir, subbuf_size, n_subbufs,
|
|
|
|
&relay_callbacks, NULL);
|
|
|
|
if (!chan) {
|
|
|
|
pr_err(NAME "relay app channel creation failed.\n");
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
reference_kmmio();
|
|
|
|
|
|
|
|
marker_file = debugfs_create_file("marker", 0660, dir, NULL,
|
|
|
|
&fops_marker);
|
|
|
|
if (!marker_file)
|
|
|
|
pr_err(NAME "marker file creation failed.\n");
|
|
|
|
|
|
|
|
if (nommiotrace)
|
|
|
|
pr_info(NAME "MMIO tracing disabled.\n");
|
|
|
|
if (ISA_trace)
|
|
|
|
pr_warning(NAME "Warning! low ISA range will be traced.\n");
|
|
|
|
spin_lock_irq(&trace_lock);
|
|
|
|
atomic_inc(&mmiotrace_enabled);
|
|
|
|
spin_unlock_irq(&trace_lock);
|
|
|
|
pr_info(NAME "enabled.\n");
|
|
|
|
out:
|
|
|
|
mutex_unlock(&mmiotrace_mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void disable_mmiotrace(void)
|
|
|
|
{
|
|
|
|
mutex_lock(&mmiotrace_mutex);
|
|
|
|
if (!is_enabled())
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
spin_lock_irq(&trace_lock);
|
|
|
|
atomic_dec(&mmiotrace_enabled);
|
|
|
|
BUG_ON(is_enabled());
|
|
|
|
spin_unlock_irq(&trace_lock);
|
|
|
|
|
|
|
|
clear_trace_list(); /* guarantees: no more kmmio callbacks */
|
|
|
|
unreference_kmmio();
|
|
|
|
if (marker_file) {
|
|
|
|
debugfs_remove(marker_file);
|
|
|
|
marker_file = NULL;
|
|
|
|
}
|
|
|
|
if (chan) {
|
|
|
|
relay_close(chan);
|
|
|
|
chan = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
pr_info(NAME "disabled.\n");
|
|
|
|
out:
|
|
|
|
mutex_unlock(&mmiotrace_mutex);
|
2008-05-12 19:20:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int __init init(void)
|
|
|
|
{
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_debug(NAME "load...\n");
|
2008-05-12 19:20:56 +00:00
|
|
|
if (n_subbufs < 2)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
dir = debugfs_create_dir(APP_DIR, NULL);
|
|
|
|
if (!dir) {
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_err(NAME "Couldn't create relay app directory.\n");
|
2008-05-12 19:20:56 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
enabled_file = debugfs_create_file("enabled", 0600, dir, NULL,
|
|
|
|
&fops_enabled);
|
|
|
|
if (!enabled_file) {
|
|
|
|
pr_err(NAME "Couldn't create enabled file.\n");
|
2008-05-12 19:20:56 +00:00
|
|
|
debugfs_remove(dir);
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
2008-05-12 19:20:57 +00:00
|
|
|
if (enable_now)
|
|
|
|
enable_mmiotrace();
|
2008-05-12 19:20:56 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit cleanup(void)
|
|
|
|
{
|
2008-05-12 19:20:57 +00:00
|
|
|
pr_debug(NAME "unload...\n");
|
|
|
|
if (enabled_file)
|
|
|
|
debugfs_remove(enabled_file);
|
|
|
|
disable_mmiotrace();
|
2008-05-12 19:20:56 +00:00
|
|
|
if (dir)
|
|
|
|
debugfs_remove(dir);
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init(init);
|
|
|
|
module_exit(cleanup);
|
|
|
|
MODULE_LICENSE("GPL");
|