kprobe: remove legacy code (file swap_kdebug.h) 47/170147/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 13 Feb 2018 18:29:08 +0000 (21:29 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 14 Feb 2018 10:57:21 +0000 (13:57 +0300)
Change-Id: Ife6f7894ac38c0db6c05a3480bfbb3dbf693cfe5
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/kprobe/arch/arm/swap-asm/swap_kprobes.c
modules/kprobe/arch/x86/swap-asm/swap_kprobes.c
modules/kprobe/swap_kdebug.h [deleted file]
modules/kprobe/swap_kprobes.c
modules/kprobe/swap_kprobes_deps.c
modules/kprobe/swap_kprobes_deps.h
modules/uprobe/swap_uprobes.c

index 5b510cf639b3c0bb8fbb9285010251596c307933..28777b77e740cc2768b4bc68a182fcac89ef82e0 100644 (file)
@@ -50,7 +50,6 @@
 #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>
index 72b47e16c18cde66924e79315d27fedb816429ba..338ba123728ce06c2f4dbaf59d02f9fc8c69b8d0 100644 (file)
@@ -44,7 +44,6 @@
 #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>
 
@@ -806,24 +805,17 @@ static int kprobe_exceptions_notify(struct notifier_block *self,
        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))
@@ -837,7 +829,6 @@ static int kprobe_exceptions_notify(struct notifier_block *self,
        default:
                break;
        }
-       DBPRINTF("ret=%d", ret);
        /* if(ret == NOTIFY_STOP) */
        /*      handled_exceptions++; */
 
diff --git a/modules/kprobe/swap_kdebug.h b/modules/kprobe/swap_kdebug.h
deleted file mode 100644 (file)
index 4c3be6e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * @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 */
index 3981ffef57f9a1e50ad45547cd23fbabac244342..a30c19cd4b8abc8ad6604cdb5d39ba4789c80116 100644 (file)
@@ -49,7 +49,6 @@
 #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"
 
@@ -763,8 +762,6 @@ static int alloc_nodes_kretprobe(struct kretprobe *rp)
        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;
@@ -787,10 +784,6 @@ static int alloc_nodes_kretprobe(struct kretprobe *rp)
                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;
 }
 
@@ -805,7 +798,6 @@ int swap_register_kretprobe(struct kretprobe *rp)
        int ret = 0;
        struct kretprobe_instance *inst;
        int i;
-       DBPRINTF("START");
 
        rp->kp.pre_handler = pre_handler_kretprobe;
 
@@ -841,21 +833,12 @@ int swap_register_kretprobe(struct kretprobe *rp)
                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);
index 9a54bb893eb4c79ec906fd65810447f6a212d1d0..41b96084a8acd0462d3e417b3957d4a90d87915c 100644 (file)
@@ -35,7 +35,6 @@
 #include <asm/pgtable.h>
 
 #include "swap_kprobes_deps.h"
-#include "swap_kdebug.h"
 
 
 #include <linux/slab.h>
@@ -1131,7 +1130,6 @@ static int __get_user_pages_uprobe(struct task_struct *tsk,
 
                        /* cond_resched(); */
 
-                       DBPRINTF("pages = %p vma = %p\n", pages, vma);
                        while (!(page = swap_follow_page(vma, start,
                                                         foll_flags))) {
                                int ret;
index 8d4f345c29ff4f851cb8add0179d8b416f0a6c33..4bd193f4038822f64c24d69bcec3ed399be4ec17 100644 (file)
@@ -117,7 +117,7 @@ do { \
 { \
        __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; \
        } \
 }
@@ -126,7 +126,7 @@ do { \
 { \
        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; \
        } \
 }
index d25b2d79328cc716dc3fba448ab47a4bcc9eb9e9..eb14f170e5ddc0c2cee8183115aa54076d4dcfcd 100644 (file)
@@ -38,7 +38,6 @@
 
 #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>
@@ -512,12 +511,8 @@ int swap_register_uprobe(struct uprobe *p)
        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);
@@ -532,7 +527,6 @@ int swap_register_uprobe(struct uprobe *p)
        }
 
 out:
-       DBPRINTF("out ret = 0x%x\n", ret);
        return ret;
 }
 EXPORT_SYMBOL_GPL(swap_register_uprobe);
@@ -811,8 +805,6 @@ int swap_register_uretprobe(struct uretprobe *rp)
        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;