RHEL4/kernel/kprobes.c
<<
>>
Prefs
   1/*
   2 *  Kernel Probes (KProbes)
   3 *  kernel/kprobes.c
   4 *
   5 * This program is free software; you can redistribute it and/or modify
   6 * it under the terms of the GNU General Public License as published by
   7 * the Free Software Foundation; either version 2 of the License, or
   8 * (at your option) any later version.
   9 *
  10 * This program is distributed in the hope that it will be useful,
  11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13 * GNU General Public License for more details.
  14 *
  15 * You should have received a copy of the GNU General Public License
  16 * along with this program; if not, write to the Free Software
  17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18 *
  19 * Copyright (C) IBM Corporation, 2002, 2004
  20 *
  21 * 2002-Oct     Created by Vamsi Krishna S <vamsi_krishna@in.ibm.com> Kernel
  22 *              Probes initial implementation (includes suggestions from
  23 *              Rusty Russell).
  24 * 2004-Aug     Updated by Prasanna S Panchamukhi <prasanna@in.ibm.com> with
  25 *              hlists and exceptions notifier as suggested by Andi Kleen.
  26 * 2004-July    Suparna Bhattacharya <suparna@in.ibm.com> added jumper probes
  27 *              interface to access function arguments.
  28 * 2004-Sep     Prasanna S Panchamukhi <prasanna@in.ibm.com> Changed Kprobes
  29 *              exceptions notifier to be first on the priority list.
  30 * 2005-May     Hien Nguyen <hien@us.ibm.com>, Jim Keniston
  31 *              <jkenisto@us.ibm.com> and Prasanna S Panchamukhi
  32 *              <prasanna@in.ibm.com> added function-return probes.
  33 */
  34#include <linux/kprobes.h>
  35#include <linux/hash.h>
  36#include <linux/init.h>
  37#include <linux/module.h>
  38#include <linux/moduleloader.h>
  39#include <asm/cacheflush.h>
  40#include <asm/errno.h>
  41#include <asm/kdebug.h>
  42
  43#define KPROBE_HASH_BITS 6
  44#define KPROBE_TABLE_SIZE (1 << KPROBE_HASH_BITS)
  45
  46static struct hlist_head kprobe_table[KPROBE_TABLE_SIZE];
  47static struct hlist_head kretprobe_inst_table[KPROBE_TABLE_SIZE];
  48
  49DECLARE_MUTEX(kprobe_mutex);            /* Protects kprobe_table */
  50spinlock_t kretprobe_lock = SPIN_LOCK_UNLOCKED; /* Protects kretprobe_inst_table */
  51static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL;
  52
  53#ifdef __ARCH_WANT_KPROBES_INSN_SLOT
  54/*
  55 * kprobe->ainsn.insn points to the copy of the instruction to be
  56 * single-stepped. x86_64, POWER4 and above have no-exec support and
  57 * stepping on the instruction on a vmalloced/kmalloced/data page
  58 * is a recipe for disaster
  59 */
  60#define INSNS_PER_PAGE  (PAGE_SIZE/(MAX_INSN_SIZE * sizeof(kprobe_opcode_t)))
  61
  62struct kprobe_insn_page {
  63        struct hlist_node hlist;
  64        kprobe_opcode_t *insns;         /* Page of instruction slots */
  65        char slot_used[INSNS_PER_PAGE];
  66        int nused;
  67};
  68
  69static struct hlist_head kprobe_insn_pages;
  70
  71/**
  72 * get_insn_slot() - Find a slot on an executable page for an instruction.
  73 * We allocate an executable page if there's no room on existing ones.
  74 */
  75kprobe_opcode_t *get_insn_slot(void)
  76{
  77        struct kprobe_insn_page *kip;
  78        struct hlist_node *pos;
  79
  80        hlist_for_each(pos, &kprobe_insn_pages) {
  81                kip = hlist_entry(pos, struct kprobe_insn_page, hlist);
  82                if (kip->nused < INSNS_PER_PAGE) {
  83                        int i;
  84                        for (i = 0; i < INSNS_PER_PAGE; i++) {
  85                                if (!kip->slot_used[i]) {
  86                                        kip->slot_used[i] = 1;
  87                                        kip->nused++;
  88                                        return kip->insns + (i * MAX_INSN_SIZE);
  89                                }
  90                        }
  91                        /* Surprise!  No unused slots.  Fix kip->nused. */
  92                        kip->nused = INSNS_PER_PAGE;
  93                }
  94        }
  95
  96        /* All out of space.  Need to allocate a new page. Use slot 0.*/
  97        kip = kmalloc(sizeof(struct kprobe_insn_page), GFP_KERNEL);
  98        if (!kip) {
  99                return NULL;
 100        }
 101
 102        /*
 103         * Use module_alloc so this page is within +/- 2GB of where the
 104         * kernel image and loaded module images reside. This is required
 105         * so x86_64 can correctly handle the %rip-relative fixups.
 106         */
 107        kip->insns = module_alloc(PAGE_SIZE);
 108        if (!kip->insns) {
 109                kfree(kip);
 110                return NULL;
 111        }
 112        INIT_HLIST_NODE(&kip->hlist);
 113        hlist_add_head(&kip->hlist, &kprobe_insn_pages);
 114        memset(kip->slot_used, 0, INSNS_PER_PAGE);
 115        kip->slot_used[0] = 1;
 116        kip->nused = 1;
 117        return kip->insns;
 118}
 119
 120void free_insn_slot(kprobe_opcode_t *slot)
 121{
 122        struct kprobe_insn_page *kip;
 123        struct hlist_node *pos;
 124
 125        hlist_for_each(pos, &kprobe_insn_pages) {
 126                kip = hlist_entry(pos, struct kprobe_insn_page, hlist);
 127                if (kip->insns <= slot &&
 128                    slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) {
 129                        int i = (slot - kip->insns) / MAX_INSN_SIZE;
 130                        kip->slot_used[i] = 0;
 131                        kip->nused--;
 132                        if (kip->nused == 0) {
 133                                /*
 134                                 * Page is no longer in use.  Free it unless
 135                                 * it's the last one.  We keep the last one
 136                                 * so as not to have to set it up again the
 137                                 * next time somebody inserts a probe.
 138                                 */
 139                                hlist_del(&kip->hlist);
 140                                if (hlist_empty(&kprobe_insn_pages)) {
 141                                        INIT_HLIST_NODE(&kip->hlist);
 142                                        hlist_add_head(&kip->hlist,
 143                                                &kprobe_insn_pages);
 144                                } else {
 145                                        module_free(NULL, kip->insns);
 146                                        kfree(kip);
 147                                }
 148                        }
 149                        return;
 150                }
 151        }
 152}
 153#endif
 154
 155/* We have preemption disabled.. so it is safe to use __ versions */
 156static inline void set_kprobe_instance(struct kprobe *kp)
 157{
 158        __get_cpu_var(kprobe_instance) = kp;
 159}
 160
 161static inline void reset_kprobe_instance(void)
 162{
 163        __get_cpu_var(kprobe_instance) = NULL;
 164}
 165
 166/*
 167 * This routine is called either:
 168 *      - under the kprobe_mutex - during kprobe_[un]register()
 169 *                              OR
 170 *      - with preemption disabled - from arch/xxx/kernel/kprobes.c
 171 */
 172struct kprobe *get_kprobe(void *addr)
 173{
 174        struct hlist_head *head;
 175        struct hlist_node *node;
 176
 177        head = &kprobe_table[hash_ptr(addr, KPROBE_HASH_BITS)];
 178        hlist_for_each_rcu(node, head) {
 179                struct kprobe *p = hlist_entry(node, struct kprobe, hlist);
 180                if (p->addr == addr)
 181                        return p;
 182        }
 183        return NULL;
 184}
 185
 186/*
 187 * Aggregate handlers for multiple kprobes support - these handlers
 188 * take care of invoking the individual kprobe handlers on p->list
 189 */
 190static int aggr_pre_handler(struct kprobe *p, struct pt_regs *regs)
 191{
 192        struct kprobe *kp;
 193
 194        list_for_each_entry_rcu(kp, &p->list, list) {
 195                if (kp->pre_handler) {
 196                        set_kprobe_instance(kp);
 197                        if (kp->pre_handler(kp, regs))
 198                                return 1;
 199                }
 200                reset_kprobe_instance();
 201        }
 202        return 0;
 203}
 204
 205static void aggr_post_handler(struct kprobe *p, struct pt_regs *regs,
 206                unsigned long flags)
 207{
 208        struct kprobe *kp;
 209
 210        list_for_each_entry_rcu(kp, &p->list, list) {
 211                if (kp->post_handler) {
 212                        set_kprobe_instance(kp);
 213                        kp->post_handler(kp, regs, flags);
 214                        reset_kprobe_instance();
 215                }
 216        }
 217        return;
 218}
 219
 220static int aggr_fault_handler(struct kprobe *p, struct pt_regs *regs, 
 221                                int trapnr)
 222{
 223        struct kprobe *cur = __get_cpu_var(kprobe_instance);
 224
 225        /*
 226         * if we faulted "during" the execution of a user specified
 227         * probe handler, invoke just that probe's fault handler
 228         */
 229        if (cur && cur->fault_handler) {
 230                if (cur->fault_handler(cur, regs, trapnr))
 231                        return 1;
 232        }
 233        return 0;
 234}
 235
 236static int aggr_break_handler(struct kprobe *p, struct pt_regs *regs)
 237{
 238        struct kprobe *cur = __get_cpu_var(kprobe_instance);
 239        int ret = 0;
 240
 241        if (cur && cur->break_handler) {
 242                if (cur->break_handler(cur, regs))
 243                        ret = 1;
 244        }
 245        reset_kprobe_instance();
 246        return ret;
 247}
 248
 249/* Walks the list and increments nmissed count for multiprobe case */
 250void kprobes_inc_nmissed_count(struct kprobe *p)
 251{
 252        struct kprobe *kp;
 253        if (p->pre_handler != aggr_pre_handler) {
 254                p->nmissed++;
 255        } else {
 256                list_for_each_entry_rcu(kp, &p->list, list)
 257                        kp->nmissed++;
 258        }
 259        return;
 260}
 261
 262/* Called with kretprobe_lock held */
 263struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp)
 264{
 265        struct hlist_node *node;
 266        struct kretprobe_instance *ri;
 267        hlist_for_each_entry(ri, node, &rp->free_instances, uflist)
 268                return ri;
 269        return NULL;
 270}
 271
 272/* Called with kretprobe_lock held */
 273static struct kretprobe_instance *get_used_rp_inst(struct kretprobe *rp)
 274{
 275        struct hlist_node *node;
 276        struct kretprobe_instance *ri;
 277        hlist_for_each_entry(ri, node, &rp->used_instances, uflist)
 278                return ri;
 279        return NULL;
 280}
 281
 282/* Called with kretprobe_lock held */
 283void add_rp_inst(struct kretprobe_instance *ri)
 284{
 285        /*
 286         * Remove rp inst off the free list -
 287         * Add it back when probed function returns
 288         */
 289        hlist_del(&ri->uflist);
 290
 291        /* Add rp inst onto table */
 292        INIT_HLIST_NODE(&ri->hlist);
 293        hlist_add_head(&ri->hlist,
 294                        &kretprobe_inst_table[hash_ptr(ri->task, KPROBE_HASH_BITS)]);
 295
 296        /* Also add this rp inst to the used list. */
 297        INIT_HLIST_NODE(&ri->uflist);
 298        hlist_add_head(&ri->uflist, &ri->rp->used_instances);
 299}
 300
 301/* Called with kretprobe_lock held */
 302void recycle_rp_inst(struct kretprobe_instance *ri)
 303{
 304        /* remove rp inst off the rprobe_inst_table */
 305        hlist_del(&ri->hlist);
 306        if (ri->rp) {
 307                /* remove rp inst off the used list */
 308                hlist_del(&ri->uflist);
 309                /* put rp inst back onto the free list */
 310                INIT_HLIST_NODE(&ri->uflist);
 311                hlist_add_head(&ri->uflist, &ri->rp->free_instances);
 312        } else
 313                /* Unregistering */
 314                kfree(ri);
 315}
 316
 317struct hlist_head *kretprobe_inst_table_head(struct task_struct *tsk)
 318{
 319        return &kretprobe_inst_table[hash_ptr(tsk, KPROBE_HASH_BITS)];
 320}
 321
 322/*
 323 * This function is called from finish_task_switch when task tk becomes dead,
 324 * so that we can recycle any function-return probe instances associated
 325 * with this task. These left over instances represent probed functions
 326 * that have been called but will never return.
 327 */
 328void kprobe_flush_task(struct task_struct *tk)
 329{
 330        struct kretprobe_instance *ri;
 331        struct hlist_head *head;
 332        struct hlist_node *node, *tmp;
 333        unsigned long flags = 0;
 334
 335        spin_lock_irqsave(&kretprobe_lock, flags);
 336        head = kretprobe_inst_table_head(tk);
 337        hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
 338                if (ri->task == tk)
 339                        recycle_rp_inst(ri);
 340        }
 341        spin_unlock_irqrestore(&kretprobe_lock, flags);
 342}
 343
 344/*
 345 * This kprobe pre_handler is registered with every kretprobe. When probe
 346 * hits it will set up the return probe.
 347 */
 348static int pre_handler_kretprobe(struct kprobe *p, struct pt_regs *regs)
 349{
 350        struct kretprobe *rp = container_of(p, struct kretprobe, kp);
 351        unsigned long flags = 0;
 352
 353        /*TODO: consider to only swap the RA after the last pre_handler fired */
 354        spin_lock_irqsave(&kretprobe_lock, flags);
 355        arch_prepare_kretprobe(rp, regs);
 356        spin_unlock_irqrestore(&kretprobe_lock, flags);
 357        return 0;
 358}
 359
 360static inline void free_rp_inst(struct kretprobe *rp)
 361{
 362        struct kretprobe_instance *ri;
 363        while ((ri = get_free_rp_inst(rp)) != NULL) {
 364                hlist_del(&ri->uflist);
 365                kfree(ri);
 366        }
 367}
 368
 369/*
 370 * Keep all fields in the kprobe consistent
 371 */
 372static inline void copy_kprobe(struct kprobe *old_p, struct kprobe *p)
 373{
 374        memcpy(&p->opcode, &old_p->opcode, sizeof(kprobe_opcode_t));
 375        memcpy(&p->ainsn, &old_p->ainsn, sizeof(struct arch_specific_insn));
 376}
 377
 378/*
 379* Add the new probe to old_p->list. Fail if this is the
 380* second jprobe at the address - two jprobes can't coexist
 381*/
 382static int add_new_kprobe(struct kprobe *old_p, struct kprobe *p)
 383{
 384        struct kprobe *kp;
 385
 386        if (p->break_handler) {
 387                list_for_each_entry_rcu(kp, &old_p->list, list) {
 388                        if (kp->break_handler)
 389                                return -EEXIST;
 390                }
 391                list_add_tail_rcu(&p->list, &old_p->list);
 392        } else
 393                list_add_rcu(&p->list, &old_p->list);
 394        return 0;
 395}
 396
 397/*
 398 * Fill in the required fields of the "manager kprobe". Replace the
 399 * earlier kprobe in the hlist with the manager kprobe
 400 */
 401static inline void add_aggr_kprobe(struct kprobe *ap, struct kprobe *p)
 402{
 403        copy_kprobe(p, ap);
 404        flush_insn_slot(ap);
 405        ap->addr = p->addr;
 406
 407        ap->pre_handler = aggr_pre_handler;
 408        ap->post_handler = aggr_post_handler;
 409        ap->fault_handler = aggr_fault_handler;
 410        ap->break_handler = aggr_break_handler;
 411
 412        INIT_LIST_HEAD(&ap->list);
 413        list_add_rcu(&p->list, &ap->list);
 414
 415        hlist_replace_rcu(&p->hlist, &ap->hlist);
 416}
 417
 418/*
 419 * This is the second or subsequent kprobe at the address - handle
 420 * the intricacies
 421 */
 422static int register_aggr_kprobe(struct kprobe *old_p, struct kprobe *p)
 423{
 424        int ret = 0;
 425        struct kprobe *ap;
 426
 427        if (old_p->pre_handler == aggr_pre_handler) {
 428                copy_kprobe(old_p, p);
 429                ret = add_new_kprobe(old_p, p);
 430        } else {
 431                ap = kzalloc(sizeof(struct kprobe), GFP_KERNEL);
 432                if (!ap)
 433                        return -ENOMEM;
 434                add_aggr_kprobe(ap, old_p);
 435                copy_kprobe(ap, p);
 436                ret = add_new_kprobe(ap, p);
 437        }
 438        return ret;
 439}
 440
 441static int __register_kprobe(struct kprobe *p, unsigned long called_from)
 442{
 443        int ret = 0;
 444        struct kprobe *old_p;
 445        struct module *probed_mod;
 446
 447        if (!kernel_text_address((unsigned long) p->addr))
 448                return -EINVAL;
 449
 450        p->mod_refcounted = 0;
 451        /* Check are we probing a module */
 452        if ((probed_mod = module_text_address((unsigned long) p->addr))) {
 453                struct module *calling_mod = module_text_address(called_from);
 454                /* We must allow modules to probe themself and
 455                 * in this case avoid incrementing the module refcount,
 456                 * so as to allow unloading of self probing modules.
 457                 */
 458                 if (calling_mod && (calling_mod != probed_mod)) {
 459                         if (unlikely(!try_module_get(probed_mod)))
 460                                 return -EINVAL;
 461                         p->mod_refcounted = 1;
 462                 } else
 463                 probed_mod = NULL;
 464         }
 465
 466        p->nmissed = 0;
 467        down(&kprobe_mutex);
 468        old_p = get_kprobe(p->addr);
 469        if (old_p) {
 470                ret = register_aggr_kprobe(old_p, p);
 471                goto out;
 472        }
 473
 474        if ((ret = arch_prepare_kprobe(p)) != 0)
 475                goto out;
 476
 477        INIT_HLIST_NODE(&p->hlist);
 478        hlist_add_head_rcu(&p->hlist,
 479                       &kprobe_table[hash_ptr(p->addr, KPROBE_HASH_BITS)]);
 480
 481        arch_arm_kprobe(p);
 482out:
 483        up(&kprobe_mutex);
 484
 485        if (ret && probed_mod)
 486                module_put(probed_mod);
 487
 488        return ret;
 489}
 490
 491int register_kprobe(struct kprobe *p)
 492{
 493        return __register_kprobe(p,(unsigned long)__builtin_return_address(0));
 494}
 495
 496void unregister_kprobe(struct kprobe *p)
 497{
 498        struct module *mod;
 499        struct kprobe *old_p, *list_p;
 500        int cleanup_p;
 501
 502        down(&kprobe_mutex);
 503        old_p = get_kprobe(p->addr);
 504        if (unlikely(!old_p)) {
 505                up(&kprobe_mutex);
 506                return;
 507        }
 508        if (p != old_p) {
 509                list_for_each_entry_rcu(list_p, &old_p->list, list)
 510                        if (list_p == p)
 511                        /* kprobe p is a valid probe */
 512                                goto valid_p;
 513                up(&kprobe_mutex);
 514                return;
 515        }
 516valid_p:
 517        if ((old_p == p) || ((old_p->pre_handler == aggr_pre_handler) &&
 518                (p->list.next == &old_p->list) &&
 519                (p->list.prev == &old_p->list))) {
 520                /* Only probe on the hash list */
 521                arch_disarm_kprobe(p);
 522                hlist_del_rcu(&old_p->hlist);
 523                cleanup_p = 1;
 524        } else {
 525                list_del_rcu(&p->list);
 526                cleanup_p = 0;
 527        }
 528        up(&kprobe_mutex);
 529        /*
 530         * We don't have synchronize_sched() in 2.6.9 - use
 531         * the equivalent - synchronize_kernel() instead
 532         */
 533        synchronize_kernel();
 534
 535        if (p->mod_refcounted &&
 536                (mod = module_text_address((unsigned long)p->addr)))
 537                module_put(mod);
 538
 539        if (cleanup_p) {
 540                if (p != old_p) {
 541                        list_del_rcu(&p->list);
 542                        kfree(old_p);
 543                }
 544                arch_remove_kprobe(p);
 545        }
 546}
 547
 548static struct notifier_block kprobe_exceptions_nb = {
 549        .notifier_call = kprobe_exceptions_notify,
 550        .priority = 0x7fffffff /* we need to notified first */
 551};
 552
 553int register_jprobe(struct jprobe *jp)
 554{
 555        /* Todo: Verify probepoint is a function entry point */
 556        jp->kp.pre_handler = setjmp_pre_handler;
 557        jp->kp.break_handler = longjmp_break_handler;
 558
 559        return __register_kprobe(&jp->kp, (unsigned long)__builtin_return_address(0));
 560
 561}
 562
 563void unregister_jprobe(struct jprobe *jp)
 564{
 565        unregister_kprobe(&jp->kp);
 566}
 567
 568#ifdef ARCH_SUPPORTS_KRETPROBES
 569
 570int register_kretprobe(struct kretprobe *rp)
 571{
 572        int ret = 0;
 573        struct kretprobe_instance *inst;
 574        int i;
 575
 576        rp->kp.pre_handler = pre_handler_kretprobe;
 577        rp->kp.post_handler = NULL;
 578        rp->kp.fault_handler = NULL;
 579        rp->kp.break_handler = NULL;
 580
 581        /* Pre-allocate memory for max kretprobe instances */
 582        if (rp->maxactive <= 0) {
 583#ifdef CONFIG_PREEMPT
 584                rp->maxactive = max(10, 2 * NR_CPUS);
 585#else
 586                rp->maxactive = NR_CPUS;
 587#endif
 588        }
 589        INIT_HLIST_HEAD(&rp->used_instances);
 590        INIT_HLIST_HEAD(&rp->free_instances);
 591        for (i = 0; i < rp->maxactive; i++) {
 592                inst = kmalloc(sizeof(struct kretprobe_instance), GFP_KERNEL);
 593                if (inst == NULL) {
 594                        free_rp_inst(rp);
 595                        return -ENOMEM;
 596                }
 597                INIT_HLIST_NODE(&inst->uflist);
 598                hlist_add_head(&inst->uflist, &rp->free_instances);
 599        }
 600
 601        rp->nmissed = 0;
 602        /* Establish function entry probe point */
 603        if ((ret = __register_kprobe(&rp->kp,
 604                (unsigned long)__builtin_return_address(0))) != 0)
 605                free_rp_inst(rp);
 606        return ret;
 607}
 608
 609#else /* ARCH_SUPPORTS_KRETPROBES */
 610
 611int register_kretprobe(struct kretprobe *rp)
 612{
 613        return -ENOSYS;
 614}
 615
 616#endif /* ARCH_SUPPORTS_KRETPROBES */
 617
 618void unregister_kretprobe(struct kretprobe *rp)
 619{
 620        unsigned long flags;
 621        struct kretprobe_instance *ri;
 622
 623        unregister_kprobe(&rp->kp);
 624        /* No race here */
 625        spin_lock_irqsave(&kretprobe_lock, flags);
 626        while ((ri = get_used_rp_inst(rp)) != NULL) {
 627                ri->rp = NULL;
 628                hlist_del(&ri->uflist);
 629        }
 630        spin_unlock_irqrestore(&kretprobe_lock, flags);
 631        free_rp_inst(rp);
 632}
 633
 634static int __init init_kprobes(void)
 635{
 636        int i, err = 0;
 637
 638        /* FIXME allocate the probe table, currently defined statically */
 639        /* initialize all list heads */
 640        for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
 641                INIT_HLIST_HEAD(&kprobe_table[i]);
 642                INIT_HLIST_HEAD(&kretprobe_inst_table[i]);
 643        }
 644
 645        err = arch_init_kprobes();
 646        if (!err)
 647                err = register_die_notifier(&kprobe_exceptions_nb);
 648
 649        return err;
 650}
 651
 652__initcall(init_kprobes);
 653
 654EXPORT_SYMBOL_GPL(register_kprobe);
 655EXPORT_SYMBOL_GPL(unregister_kprobe);
 656EXPORT_SYMBOL_GPL(register_jprobe);
 657EXPORT_SYMBOL_GPL(unregister_jprobe);
 658EXPORT_SYMBOL_GPL(jprobe_return);
 659EXPORT_SYMBOL_GPL(register_kretprobe);
 660EXPORT_SYMBOL_GPL(unregister_kretprobe);
 661