#include <linux/hash.h>
#include <ksyms/ksyms.h>
#include <kprobe/swap_slots.h>
-#include <kprobe/swap_kdebug.h>
#include <kprobe/swap_kprobes.h>
#include <kprobe/swap_kprobes_deps.h>
#include <arch/arm/probes/probes_arm.h>
#include "swap_kprobes.h"
#include <kprobe/swap_kprobes.h>
#include <kprobe/swap_td_raw.h>
-#include <kprobe/swap_kdebug.h>
#include <kprobe/swap_slots.h>
#include <kprobe/swap_kprobes_deps.h>
struct die_args *args = (struct die_args *) data;
int ret = NOTIFY_DONE;
- DBPRINTF("val = %ld, data = 0x%X", val, (unsigned int) data);
-
if (args->regs == NULL || swap_user_mode(args->regs))
return ret;
- DBPRINTF("switch (val) %lu %d %d", val, DIE_INT3, DIE_TRAP);
switch (val) {
#ifdef CONFIG_KPROBES
case DIE_INT3:
#else
case DIE_TRAP:
#endif
- DBPRINTF("before kprobe_handler ret=%d %p",
- ret, args->regs);
if (kprobe_handler (args->regs))
ret = NOTIFY_STOP;
- DBPRINTF("after kprobe_handler ret=%d %p",
- ret, args->regs);
break;
case DIE_DEBUG:
if (post_kprobe_handler(args->regs))
default:
break;
}
- DBPRINTF("ret=%d", ret);
/* if(ret == NOTIFY_STOP) */
/* handled_exceptions++; */
+++ /dev/null
-/**
- * @file kprobe/swap_kdebug.h
- * @author Alexey Gerenkov <a.gerenkov@samsung.com> User-Space Probes initial implementation;
- * Support x86/ARM/MIPS for both user and kernel spaces.
- * @author Ekaterina Gorelkina <e.gorelkina@samsung.com>: redesign module for separating core and arch parts
- *
- * @section LICENSE
- *
- * 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.
- *
- * @section COPYRIGHT
- *
- * Copyright (C) Samsung Electronics, 2006-2010
- *
- * @section DESCRIPTION
- *
- * Header for debug purposes.
- */
-
-
-#ifndef _SWAP_KPROBE_DEBUG_H
-#define _SWAP_KPROBE_DEBUG_H
-
-/* #define _DEBUG */
-
-#ifdef _DEBUG
-#define DBPRINTF(format, args...) do { \
- if (1) { \
- char *f = __FILE__; \
- char *n = strrchr(f, '/'); \
- printk(KERN_INFO "%s : %u : %s : " format "\n" , \
- (n) ? n+1 : f, __LINE__, __func__, ##args); \
- } \
- } while (0)
-#else
-#define DBPRINTF(format, args...)
-#endif
-
-
-#endif /* _SWAP_KPROBE_DEBUG_H */
#include "swap_slots.h"
#include "swap_ktd.h"
#include "swap_td_raw.h"
-#include "swap_kdebug.h"
#include "swap_kprobes.h"
#include "swap_kprobes_deps.h"
struct kretprobe_instance *inst;
int i;
- DBPRINTF("Alloc aditional mem for retprobes");
-
if (rp->kp.addr == sched_addr) {
rp->maxactive += SCHED_RP_NR; /* max (100, 2 * NR_CPUS); */
alloc_nodes = SCHED_RP_NR;
hlist_add_head(&inst->uflist, &rp->free_instances);
}
- DBPRINTF("addr=%p, *addr=[%lx %lx %lx]", rp->kp.addr,
- (unsigned long) (*(rp->kp.addr)),
- (unsigned long) (*(rp->kp.addr + 1)),
- (unsigned long) (*(rp->kp.addr + 2)));
return 0;
}
int ret = 0;
struct kretprobe_instance *inst;
int i;
- DBPRINTF("START");
rp->kp.pre_handler = pre_handler_kretprobe;
hlist_add_head(&inst->uflist, &rp->free_instances);
}
- DBPRINTF("addr=%p, *addr=[%lx %lx %lx]", rp->kp.addr,
- (unsigned long) (*(rp->kp.addr)),
- (unsigned long) (*(rp->kp.addr + 1)),
- (unsigned long) (*(rp->kp.addr + 2)));
rp->nmissed = 0;
/* Establish function entry probe point */
ret = swap_register_kprobe(&rp->kp);
if (ret != 0)
free_rp_inst(rp);
- DBPRINTF("addr=%p, *addr=[%lx %lx %lx]", rp->kp.addr,
- (unsigned long) (*(rp->kp.addr)),
- (unsigned long) (*(rp->kp.addr + 1)),
- (unsigned long) (*(rp->kp.addr + 2)));
-
return ret;
}
EXPORT_SYMBOL_GPL(swap_register_kretprobe);
#include <asm/pgtable.h>
#include "swap_kprobes_deps.h"
-#include "swap_kdebug.h"
#include <linux/slab.h>
/* cond_resched(); */
- DBPRINTF("pages = %p vma = %p\n", pages, vma);
while (!(page = swap_follow_page(vma, start,
foll_flags))) {
int ret;
{ \
__ref_##dep = (void *) swap_ksyms(#name); \
if (!__ref_##dep) { \
- DBPRINTF(#name " is not found! Oops. Where is it?"); \
+ pr_err(#name " is not found! Oops. Where is it?"); \
return -ESRCH; \
} \
}
{ \
dep = (void *) swap_ksyms(#name); \
if (!dep) { \
- DBPRINTF(#name " is not found! Oops. Where is it?"); \
+ pr_err(#name " is not found! Oops. Where is it?"); \
return -ESRCH; \
} \
}
#include <master/swap_initializer.h>
#include <kprobe/swap_slots.h>
-#include <kprobe/swap_kdebug.h>
#include <kprobe/swap_kprobes_deps.h>
#include <swap-asm/swap_uprobes.h>
INIT_HLIST_NODE(&p->is_hlist);
ret = arch_prepare_uprobe(p);
- if (ret) {
- DBPRINTF("goto out\n", ret);
+ if (ret)
goto out;
- }
-
- DBPRINTF("before out ret = 0x%x\n", ret);
/* TODO: add uprobe (must be in function) */
INIT_HLIST_NODE(&p->hlist);
}
out:
- DBPRINTF("out ret = 0x%x\n", ret);
return ret;
}
EXPORT_SYMBOL_GPL(swap_register_uprobe);
int i, ret = 0;
struct uretprobe_instance *inst;
- DBPRINTF("START\n");
-
rp->up.pre_handler = pre_handler_uretprobe;
rp->up.post_handler = NULL;
rp->up.fault_handler = NULL;