[REFACTOR] remove overhead calculation
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 6 May 2013 06:25:20 +0000 (10:25 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 6 May 2013 07:10:22 +0000 (11:10 +0400)
for do_page_fault()

driver/device_driver.c
driver/us_proc_inst.c
driver/us_proc_inst.h

index 66ec85e..d3a378e 100644 (file)
 #include "sspt/sspt_procs.h"
 
 
-extern unsigned long imi_sum_time;
-extern unsigned long imi_sum_hit;
-
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
 static BLOCKING_NOTIFIER_HEAD(swap_notifier_list);
 #endif
@@ -507,16 +503,6 @@ static long device_ioctl (struct file *file UNUSED, unsigned int cmd, unsigned l
                int j;
                dbi_module_callback dmc_stop;
 
-               printk("\n### imi_sum_time = %ld in install_mapped_ips()\n", imi_sum_time);
-               printk("### imi_sum_hit = %ld in install_mapped_ips()\n", imi_sum_hit);
-
-               if (imi_sum_hit != 0) {
-                       printk("### time = %ld in install_mapped_ips()\n", imi_sum_time/imi_sum_hit);
-               }
-
-               imi_sum_time = 0;
-               imi_sum_hit = 0;
-
                local_mh = get_dbi_modules_handlers();
                if(ec_user_stop() != 0) {
                        result = -1;
index 0116a9a..d652178 100644 (file)
@@ -628,9 +628,6 @@ int inst_usr_space_proc (void)
        return 0;
 }
 
-unsigned long imi_sum_time = 0;
-unsigned long imi_sum_hit = 0;
-
 static void set_mapping_file(struct sspt_file *file,
                const struct sspt_procs *procs,
                const struct task_struct *task,
@@ -892,11 +889,6 @@ static int ret_handler_pf(struct kretprobe_instance *ri, struct pt_regs *regs)
        unsigned long addr = 0;
        int valid_addr;
 
-       // overhead
-       struct timeval imi_tv1;
-       struct timeval imi_tv2;
-#define USEC_IN_SEC_NUM                                1000000
-
        if (task->flags & PF_KTHREAD) {
                goto out;
        }
@@ -935,14 +927,7 @@ static int ret_handler_pf(struct kretprobe_instance *ri, struct pt_regs *regs)
 
        if (procs) {
                unsigned long page = addr & PAGE_MASK;
-
-               // overhead
-               do_gettimeofday(&imi_tv1);
                install_page_probes(page, task, procs, 1);
-               do_gettimeofday(&imi_tv2);
-               imi_sum_hit++;
-               imi_sum_time += ((imi_tv2.tv_sec - imi_tv1.tv_sec) *  USEC_IN_SEC_NUM +
-                               (imi_tv2.tv_usec - imi_tv1.tv_usec));
        }
 
 out:
index a42254a..56d1989 100644 (file)
@@ -39,9 +39,6 @@ struct pt_regs;
 struct us_proc_ip_t;
 struct us_ip;
 
-extern unsigned long imi_sum_time;
-extern unsigned long imi_sum_hit;
-
 extern struct list_head proc_probes_list;
 
 int register_usprobe(struct task_struct *task, struct us_ip *ip, int atomic);