Advertisement
Guest User

pr10854.exp_C_prog

a guest
Sep 17th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 98.77 KB | None | 0 0
  1. naresh@Linaro:~$ ssh root@192.168.1.63
  2. root@192.168.1.63's password:
  3. Welcome to Linaro 13.08 (GNU/Linux 3.11.0-rc5 armv7l)
  4.  
  5. * Documentation:  https://wiki.linaro.org/
  6. Last login: Tue Sep 17 10:17:32 2013 from 192.168.1.16
  7. root@linaro-developer:~# cd systemtap-2.2.1/testsuite/
  8. root@linaro-developer:~/systemtap-2.2.1/testsuite# cat .systemtap-root/cache/fc/stap_fca23709d51b27106ac4a61f1461494f_15128.c
  9.  
  10. #define STAP_MSG_RUNTIME_H_01 "myproc-unprivileged tapset function called without is_myproc checking for pid %d (euid %d)"
  11. #define STAP_MSG_LOC2C_01 "read fault [man error::fault] at 0x%p (%s)"
  12. #define STAP_MSG_LOC2C_02 "write fault [man error::fault] at 0x%p (%s)"
  13. #define STAP_MSG_LOC2C_03 "divide by zero in DWARF operand (%s)"
  14. #define STAP_VERSION(a, b) ( ((a) << 8) + (b) )
  15. #ifndef STAP_COMPAT_VERSION
  16. #define STAP_COMPAT_VERSION STAP_VERSION(2, 2)
  17. #endif
  18. #include "runtime_defines.h"
  19. #include "linux/perf_read.h"
  20. #define STP_PR_STAPUSR 0x2
  21. #define STP_PR_STAPSYS 0x4
  22. #define STP_PR_STAPDEV 0x8
  23. #define STP_PRIVILEGE 0x8
  24. int stp_required_privilege __attribute__ ((section (".stap_privilege"))) = STP_PRIVILEGE;
  25. #ifndef MAXNESTING
  26. #define MAXNESTING 6
  27. #endif
  28. #define STP_SKIP_BADVARS 0
  29. #define STP_PROBE_COUNT 80
  30. #include "runtime.h"
  31.  
  32. #include <linux/version.h>
  33. #include <linux/file.h>
  34. #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
  35. #include <linux/fdtable.h>
  36. #endif
  37. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
  38. #include <linux/sched/rt.h>
  39. #endif
  40. #ifndef STAPCONF_TASK_UID
  41. #include <linux/cred.h>
  42. #endif
  43.  
  44.  
  45.  
  46. #define __STP_GET_USER(t, warn)                     \
  47.     do {                                \
  48.         __label__ deref_fault;                  \
  49.         t *_ptr = (t*) (intptr_t) STAP_ARG_addr;        \
  50.         STAP_RETVALUE = uread (_ptr);               \
  51.         if (0) {                        \
  52.         deref_fault:                        \
  53.             STAP_RETVALUE = 0;              \
  54.             CONTEXT->last_error = NULL;         \
  55.             if (warn) {                 \
  56.                 snprintf(CONTEXT->error_buffer,     \
  57.                     sizeof(CONTEXT->error_buffer),  \
  58.                     "user %s copy fault %p", #t, _ptr); \
  59.                 _stp_warn(CONTEXT->error_buffer);   \
  60.             }                       \
  61.         }                           \
  62.     } while (0)
  63.  
  64. #define STP_GET_USER(t) __STP_GET_USER(t, 0)
  65. #define STP_GET_USER_WARN(t) __STP_GET_USER(t, 1)
  66.  
  67.  
  68.  
  69. #define STAP_NEED_CONTEXT_TOKENIZE 1
  70.  
  71.  
  72.  
  73. #define STAP_NEED_GETTIMEOFDAY 1
  74.  
  75.  
  76.  
  77. struct context {
  78.  #include "common_probe_context.h"
  79.  union {
  80.    struct probe_2026_locals {
  81.      union {
  82.        struct {
  83.          int64_t __tmp0;
  84.          int64_t __tmp2;
  85.        };
  86.      };
  87.    } probe_2026;
  88.    struct probe_2027_locals {
  89.      union {
  90.        struct {
  91.          int64_t __tmp0;
  92.        };
  93.        struct {
  94.          int64_t __tmp1;
  95.        };
  96.      };
  97.    } probe_2027;
  98.    struct probe_2028_locals {
  99.    } probe_2028;
  100.    struct probe_2067_locals {
  101.      int64_t __tmp0;
  102.    } probe_2067;
  103.  } probe_locals;
  104.  union {
  105.    struct function___indent_timestamp_locals {
  106.      int64_t __retvalue;
  107.    } function___indent_timestamp;
  108.    struct function__generic_indent_locals {
  109.      int64_t l_ts;
  110.      int64_t l_x;
  111.      int64_t l_idx;
  112.      string_t l_desc;
  113.      int64_t l_delta;
  114.      union {
  115.        struct {
  116.          int64_t __tmp0;
  117.        };
  118.        struct {
  119.          int64_t __tmp2;
  120.          int64_t __tmp3;
  121.          int64_t __tmp4;
  122.          int64_t __tmp5;
  123.          int64_t __tmp6;
  124.        };
  125.        struct {
  126.          int64_t __tmp8;
  127.          int64_t __tmp10;
  128.          int64_t __tmp11;
  129.        };
  130.        struct {
  131.          int64_t __tmp12;
  132.          int64_t __tmp13;
  133.          int64_t __tmp14;
  134.        };
  135.        struct {
  136.          int64_t __tmp16;
  137.          int64_t __tmp17;
  138.          int64_t __tmp18;
  139.          string_t __tmp19;
  140.          int64_t __tmp20;
  141.          string_t __tmp22;
  142.        };
  143.      };
  144.      string_t __retvalue;
  145.    } function__generic_indent;
  146.    struct function_addr_locals {
  147.      int64_t __retvalue;
  148.    } function_addr;
  149.    struct function_execname_locals {
  150.      string_t __retvalue;
  151.    } function_execname;
  152.    struct function_gettimeofday_ns_locals {
  153.      int64_t __retvalue;
  154.    } function_gettimeofday_ns;
  155.    struct function_gettimeofday_us_locals {
  156.      int64_t __tmp0;
  157.      int64_t __retvalue;
  158.    } function_gettimeofday_us;
  159.    struct function_pid_locals {
  160.      int64_t __retvalue;
  161.    } function_pid;
  162.    struct function_probefunc_locals {
  163.      int64_t __tmp0;
  164.      int64_t __tmp1;
  165.      string_t __retvalue;
  166.    } function_probefunc;
  167.    struct function_stp_pid_locals {
  168.      int64_t __retvalue;
  169.    } function_stp_pid;
  170.    struct function_symname_locals {
  171.      int64_t l_addr;
  172.      string_t __retvalue;
  173.    } function_symname;
  174.    struct function_thread_indent_locals {
  175.      int64_t l_delta;
  176.      int64_t __tmp0;
  177.      string_t __tmp1;
  178.      string_t __tmp2;
  179.      int64_t __tmp3;
  180.      string_t __tmp4;
  181.      int64_t __tmp5;
  182.      string_t __retvalue;
  183.    } function_thread_indent;
  184.    struct function_tid_locals {
  185.      int64_t __retvalue;
  186.    } function_tid;
  187.    struct function_trace_locals {
  188.      int64_t l_entry_p;
  189.      int64_t __tmp0;
  190.      int64_t __tmp1;
  191.      string_t __tmp2;
  192.      int64_t __tmp3;
  193.      string_t __tmp4;
  194.      string_t __tmp5;
  195.      /* no return value */
  196.    } function_trace;
  197.    struct function_uaddr_locals {
  198.      int64_t __retvalue;
  199.    } function_uaddr;
  200.    struct function_user_mode_locals {
  201.      int64_t __retvalue;
  202.    } function_user_mode;
  203.    struct function_usymname_locals {
  204.      int64_t l_addr;
  205.      string_t __retvalue;
  206.    } function_usymname;
  207.  } locals [MAXNESTING+1];
  208.  #if MAXNESTING < 0
  209.  #error "MAXNESTING must be positive"
  210.  #endif
  211.  #ifndef STP_LEGACY_PRINT
  212.  union {
  213.    struct stp_sprintf_2_locals {
  214.      int64_t arg0;
  215.      const char* arg1;
  216.      int64_t arg2;
  217.      const char* arg3;
  218.      char * __retvalue;
  219.    } stp_sprintf_2;
  220.    struct stp_sprintf_3_locals {
  221.      const char* arg0;
  222.      int64_t arg1;
  223.      char * __retvalue;
  224.    } stp_sprintf_3;
  225.    struct stp_printf_4_locals {
  226.      const char* arg0;
  227.      const char* arg1;
  228.      const char* arg2;
  229.    } stp_printf_4;
  230.  } printf_locals;
  231.  #endif // STP_LEGACY_PRINT
  232. };
  233.  
  234. #include "runtime_context.h"
  235. #include "alloc.c"
  236. #define VALUE_TYPE INT64
  237. #define KEY1_TYPE INT64
  238. #include "map-gen.c"
  239. #undef MAP_DO_PMAP
  240. #undef VALUE_TYPE
  241. #undef KEY1_TYPE
  242. #include "map.c"
  243. #ifndef STP_LEGACY_PRINT
  244.  
  245. static void stp_sprintf_2 (struct context* __restrict__ c) {
  246.  struct stp_sprintf_2_locals * __restrict__ l = & c->printf_locals.stp_sprintf_2;
  247.  char *str = NULL, *end = NULL;
  248.  const char *src;
  249.  int width;
  250.  int precision;
  251.  unsigned long ptr_value;
  252.  int num_bytes;
  253.  (void) width;
  254.  (void) precision;
  255.  (void) ptr_value;
  256.  (void) num_bytes;
  257.  str = l->__retvalue;
  258.  end = str + MAXSTRINGLEN - 1;
  259.  if (str && str <= end) {
  260.    width = clamp_t(int, 6, 0, end - str + 1);
  261.    precision = -1;
  262.    str = number(str, end, l->arg0, 10, width, precision, 2);
  263.    src = " ";
  264.    while (*src && str <= end)
  265.      *str++ = *src++;
  266.    width = -1;
  267.    precision = -1;
  268.    str = _stp_vsprint_memory(str, end, l->arg1, width, precision, 's', 0);
  269.    src = ":";
  270.    while (*src && str <= end)
  271.      *str++ = *src++;
  272.    width = clamp_t(int, l->arg2, 0, end - str + 1);
  273.    precision = -1;
  274.    str = _stp_vsprint_memory(str, end, l->arg3, width, precision, 's', 16);
  275.    if (str <= end)
  276.      *str = '\0';
  277.    else
  278.      *end = '\0';
  279.  }
  280. }
  281.  
  282. static void stp_sprintf_3 (struct context* __restrict__ c) {
  283.  struct stp_sprintf_3_locals * __restrict__ l = & c->printf_locals.stp_sprintf_3;
  284.  char *str = NULL, *end = NULL;
  285.  const char *src;
  286.  int width;
  287.  int precision;
  288.  unsigned long ptr_value;
  289.  int num_bytes;
  290.  (void) width;
  291.  (void) precision;
  292.  (void) ptr_value;
  293.  (void) num_bytes;
  294.  str = l->__retvalue;
  295.  end = str + MAXSTRINGLEN - 1;
  296.  if (str && str <= end) {
  297.    width = -1;
  298.    precision = -1;
  299.    str = _stp_vsprint_memory(str, end, l->arg0, width, precision, 's', 0);
  300.    src = "(";
  301.    while (*src && str <= end)
  302.      *str++ = *src++;
  303.    width = -1;
  304.    precision = -1;
  305.    str = number(str, end, l->arg1, 10, width, precision, 2);
  306.    src = ")";
  307.    while (*src && str <= end)
  308.      *str++ = *src++;
  309.    if (str <= end)
  310.      *str = '\0';
  311.    else
  312.      *end = '\0';
  313.  }
  314. }
  315.  
  316. static void stp_printf_4 (struct context* __restrict__ c) {
  317.  struct stp_printf_4_locals * __restrict__ l = & c->printf_locals.stp_printf_4;
  318.  char *str = NULL, *end = NULL;
  319.  const char *src;
  320.  int width;
  321.  int precision;
  322.  unsigned long ptr_value;
  323.  int num_bytes;
  324.  (void) width;
  325.  (void) precision;
  326.  (void) ptr_value;
  327.  (void) num_bytes;
  328.  num_bytes = 0;
  329.  width = -1;
  330.  precision = -1;
  331.  num_bytes += _stp_vsprint_memory_size(l->arg0, width, precision, 's', 0);
  332.  width = -1;
  333.  precision = -1;
  334.  num_bytes += _stp_vsprint_memory_size(l->arg1, width, precision, 's', 0);
  335.  width = -1;
  336.  precision = -1;
  337.  num_bytes += _stp_vsprint_memory_size(l->arg2, width, precision, 's', 0);
  338.  num_bytes += sizeof("\n") - 1;
  339.  num_bytes = clamp(num_bytes, 0, STP_BUFFER_SIZE);
  340.  str = (char*)_stp_reserve_bytes(num_bytes);
  341.  end = str ? str + num_bytes - 1 : 0;
  342.  if (str && str <= end) {
  343.    width = -1;
  344.    precision = -1;
  345.    str = _stp_vsprint_memory(str, end, l->arg0, width, precision, 's', 0);
  346.    width = -1;
  347.    precision = -1;
  348.    str = _stp_vsprint_memory(str, end, l->arg1, width, precision, 's', 0);
  349.    width = -1;
  350.    precision = -1;
  351.    str = _stp_vsprint_memory(str, end, l->arg2, width, precision, 's', 0);
  352.    src = "\n";
  353.    while (*src && str <= end)
  354.      *str++ = *src++;
  355.  }
  356. }
  357. #endif // STP_LEGACY_PRINT
  358.  
  359. struct stp_globals {
  360.  MAP s_trace;
  361.  rwlock_t s_trace_lock;
  362.  #ifdef STP_TIMING
  363.  atomic_t s_trace_lock_skip_count;
  364.  #endif
  365.  
  366.  MAP s__indent_counters;
  367.  rwlock_t s__indent_counters_lock;
  368.  #ifdef STP_TIMING
  369.  atomic_t s__indent_counters_lock_skip_count;
  370.  #endif
  371.  
  372.  MAP s__indent_timestamps;
  373.  rwlock_t s__indent_timestamps_lock;
  374.  #ifdef STP_TIMING
  375.  atomic_t s__indent_timestamps_lock_skip_count;
  376.  #endif
  377.  
  378. };
  379.  
  380. static struct stp_globals stp_global = {
  381.  
  382. };
  383. #include "common_session_state.h"
  384. #include "probe_lock.h"
  385. #ifdef STAP_NEED_GETTIMEOFDAY
  386. #include "time.c"
  387. #endif
  388.  
  389. static void function___indent_timestamp (struct context * __restrict__ c);
  390.  
  391. static void function__generic_indent (struct context * __restrict__ c);
  392.  
  393. static void function_addr (struct context * __restrict__ c);
  394.  
  395. static void function_execname (struct context * __restrict__ c);
  396.  
  397. static void function_gettimeofday_ns (struct context * __restrict__ c);
  398.  
  399. static void function_gettimeofday_us (struct context * __restrict__ c);
  400.  
  401. static void function_pid (struct context * __restrict__ c);
  402.  
  403. static void function_probefunc (struct context * __restrict__ c);
  404.  
  405. static void function_stp_pid (struct context * __restrict__ c);
  406.  
  407. static void function_symname (struct context * __restrict__ c);
  408.  
  409. static void function_thread_indent (struct context * __restrict__ c);
  410.  
  411. static void function_tid (struct context * __restrict__ c);
  412.  
  413. static void function_trace (struct context * __restrict__ c);
  414.  
  415. static void function_uaddr (struct context * __restrict__ c);
  416.  
  417. static void function_user_mode (struct context * __restrict__ c);
  418.  
  419. static void function_usymname (struct context * __restrict__ c);
  420.  
  421. static void function___indent_timestamp (struct context* __restrict__ c) {
  422.  __label__ out;
  423.  struct function___indent_timestamp_locals *  __restrict__ l = & c->locals[c->nesting+1].function___indent_timestamp;
  424.  (void) l;
  425.  #define CONTEXT c
  426.  #define THIS l
  427.  #define STAP_RETVALUE THIS->__retvalue
  428.  c->last_stmt = "identifier '__indent_timestamp' at /usr/local/share/systemtap/tapset/indent-default.stp:1:10";
  429.  if (unlikely (c->nesting+1 >= MAXNESTING)) {
  430.    c->last_error = "MAXNESTING exceeded";
  431.    return;
  432.  } else {
  433.    c->nesting ++;
  434.  }
  435.  l->__retvalue = 0;
  436.  #define return goto out
  437.  l->__retvalue =
  438.  ({
  439.    function_gettimeofday_us (c);
  440.    if (unlikely(c->last_error)) goto out;
  441.    c->locals[c->nesting+1].function_gettimeofday_us.__retvalue;
  442.  });
  443.  c->actionremaining -= 1;
  444.  if (unlikely (c->actionremaining <= 0)) {
  445.    c->last_error = "MAXACTION exceeded";
  446.    c->last_stmt = "keyword at /usr/local/share/systemtap/tapset/indent-default.stp:1:33";
  447.    goto out;
  448.  }
  449.  goto out;
  450.  #undef return
  451. out:
  452.  if (0) goto out;
  453.  c->nesting --;
  454.  #undef CONTEXT
  455.  #undef THIS
  456.  #undef STAP_RETVALUE
  457. }
  458.  
  459.  
  460. static void function__generic_indent (struct context* __restrict__ c) {
  461.  __label__ out;
  462.  struct function__generic_indent_locals *  __restrict__ l = & c->locals[c->nesting+1].function__generic_indent;
  463.  (void) l;
  464.  #define CONTEXT c
  465.  #define THIS l
  466.  #define STAP_ARG_idx THIS->l_idx
  467.  #define STAP_ARG_desc THIS->l_desc
  468.  #define STAP_ARG_delta THIS->l_delta
  469.  #define STAP_ARG_ts THIS->l_ts
  470.  #define STAP_ARG_x THIS->l_x
  471.  #define STAP_RETVALUE THIS->__retvalue
  472.  c->last_stmt = "identifier '_generic_indent' at /usr/local/share/systemtap/tapset/indent.stp:10:10";
  473.  if (unlikely (c->nesting+1 >= MAXNESTING)) {
  474.    c->last_error = "MAXNESTING exceeded";
  475.    return;
  476.  } else {
  477.    c->nesting ++;
  478.  }
  479.  l->l_ts = 0;
  480.  l->l_x = 0;
  481.  l->__retvalue[0] = '\0';
  482.  #define return goto out
  483.  {
  484.    (void)
  485.    ({
  486.      l->__tmp0 =
  487.      ({
  488.        function___indent_timestamp (c);
  489.        if (unlikely(c->last_error)) goto out;
  490.        c->locals[c->nesting+1].function___indent_timestamp.__retvalue;
  491.      });
  492.      l->l_ts = l->__tmp0;
  493.      l->__tmp0;
  494.    });
  495.    
  496.    c->actionremaining -= 2;
  497.    if (unlikely (c->actionremaining <= 0)) {
  498.      c->last_error = "MAXACTION exceeded";
  499.      c->last_stmt = "keyword at /usr/local/share/systemtap/tapset/indent.stp:13:3";
  500.      goto out;
  501.    }
  502.    if ((! (
  503.      ({
  504.        l->__tmp2 = l->l_idx;
  505.        l->__tmp3 = _stp_map_get_ii (global(s__indent_counters), l->__tmp2);
  506.        l->__tmp3;
  507.      })))) {
  508.      (void)
  509.      ({
  510.        l->__tmp4 = l->l_idx;
  511.        l->__tmp5 = l->l_ts;
  512.        c->last_stmt = "identifier '_indent_timestamps' at /usr/local/share/systemtap/tapset/indent.stp:13:32";
  513.        l->__tmp6 = l->__tmp5;
  514.        { int rc = _stp_map_set_ii (global(s__indent_timestamps), l->__tmp4, l->__tmp6); if (unlikely(rc)) { c->last_error = "Array overflow, check MAXMAPENTRIES"; goto out; }};
  515.        l->__tmp5;
  516.      });
  517.      c->actionremaining -= 1;
  518.      if (unlikely (c->actionremaining <= 0)) {
  519.        c->last_error = "MAXACTION exceeded";
  520.        c->last_stmt = "identifier '_indent_timestamps' at /usr/local/share/systemtap/tapset/indent.stp:13:32";
  521.        goto out;
  522.      }
  523.    }
  524.    
  525.    (void)
  526.    ({
  527.      l->__tmp8 = ((
  528.      ({
  529.        l->__tmp10 = l->l_idx;
  530.        l->__tmp11 = _stp_map_get_ii (global(s__indent_counters), l->__tmp10);
  531.        l->__tmp11;
  532.      })) + ((((((l->l_delta) > (((int64_t)0LL))))) ? (l->l_delta) : (((int64_t)0LL)))));
  533.      l->l_x = l->__tmp8;
  534.      l->__tmp8;
  535.    });
  536.    
  537.    (void)
  538.    ({
  539.      l->__tmp12 = l->l_idx;
  540.      l->__tmp13 = l->l_delta;
  541.      c->last_stmt = "identifier '_indent_counters' at /usr/local/share/systemtap/tapset/indent.stp:17:3";
  542.      l->__tmp14 = _stp_map_get_ii (global(s__indent_counters), l->__tmp12);
  543.      l->__tmp14 += l->__tmp13;
  544.      { int rc = _stp_map_set_ii (global(s__indent_counters), l->__tmp12, l->__tmp14); if (unlikely(rc)) { c->last_error = "Array overflow, check MAXMAPENTRIES"; goto out; }};
  545.      l->__tmp14;
  546.    });
  547.    
  548.    strlcpy (l->__retvalue,
  549.    ({
  550.      l->__tmp16 = ((l->l_ts) - (
  551.      ({
  552.        l->__tmp17 = l->l_idx;
  553.        l->__tmp18 = _stp_map_get_ii (global(s__indent_timestamps), l->__tmp17);
  554.        l->__tmp18;
  555.      })));
  556.      strlcpy (l->__tmp19, l->l_desc, MAXSTRINGLEN);
  557.      l->__tmp20 = (((((l->l_x) > (((int64_t)0LL))))) ? (((l->l_x) - (((int64_t)1LL)))) : (((int64_t)0LL)));
  558.      #ifndef STP_LEGACY_PRINT
  559.        c->printf_locals.stp_sprintf_2.arg0 = l->__tmp16;
  560.        c->printf_locals.stp_sprintf_2.arg1 = l->__tmp19;
  561.        c->printf_locals.stp_sprintf_2.arg2 = l->__tmp20;
  562.        c->printf_locals.stp_sprintf_2.arg3 = "";
  563.        c->printf_locals.stp_sprintf_2.__retvalue = l->__tmp22;
  564.        stp_sprintf_2 (c);
  565.      #else // STP_LEGACY_PRINT
  566.        _stp_snprintf (l->__tmp22, MAXSTRINGLEN, "%6lld %s:%-*s", l->__tmp16, l->__tmp19, (int)l->__tmp20, "");
  567.      #endif // STP_LEGACY_PRINT
  568.      if (unlikely(c->last_error)) goto out;
  569.      l->__tmp22;
  570.    }), MAXSTRINGLEN);
  571.    c->actionremaining -= 3;
  572.    if (unlikely (c->actionremaining <= 0)) {
  573.      c->last_error = "MAXACTION exceeded";
  574.      c->last_stmt = "keyword at /usr/local/share/systemtap/tapset/indent.stp:19:3";
  575.      goto out;
  576.    }
  577.    goto out;
  578.    
  579.  }
  580.  #undef return
  581. out:
  582.  if (0) goto out;
  583.  c->nesting --;
  584.  #undef CONTEXT
  585.  #undef THIS
  586.  #undef STAP_ARG_idx
  587.  #undef STAP_ARG_desc
  588.  #undef STAP_ARG_delta
  589.  #undef STAP_ARG_ts
  590.  #undef STAP_ARG_x
  591.  #undef STAP_RETVALUE
  592. }
  593.  
  594.  
  595. static void function_addr (struct context* __restrict__ c) {
  596.  __label__ out;
  597.  struct function_addr_locals *  __restrict__ l = & c->locals[c->nesting+1].function_addr;
  598.  (void) l;
  599.  #define CONTEXT c
  600.  #define THIS l
  601.  #define STAP_RETVALUE THIS->__retvalue
  602.  c->last_stmt = "identifier 'addr' at /usr/local/share/systemtap/tapset/linux/context.stp:354:10";
  603.  if (unlikely (c->nesting+1 >= MAXNESTING)) {
  604.    c->last_error = "MAXNESTING exceeded";
  605.    return;
  606.  } else {
  607.    c->nesting ++;
  608.  }
  609.  l->__retvalue = 0;
  610.  #define return goto out
  611.  {
  612.     /* pure */
  613.  if (CONTEXT->user_mode_p) {
  614.    STAP_RETVALUE = (intptr_t)(CONTEXT->uregs ? REG_IP(CONTEXT->uregs) : 0);
  615.  } else {
  616.    STAP_RETVALUE = (intptr_t)(CONTEXT->kregs ? REG_IP(CONTEXT->kregs) : 0);
  617.  }
  618.  
  619.  }
  620.  #undef return
  621. out:
  622.  if (0) goto out;
  623.  c->nesting --;
  624.  #undef CONTEXT
  625.  #undef THIS
  626.  #undef STAP_RETVALUE
  627. }
  628.  
  629.  
  630. static void function_execname (struct context* __restrict__ c) {
  631.  __label__ out;
  632.  struct function_execname_locals *  __restrict__ l = & c->locals[c->nesting+1].function_execname;
  633.  (void) l;
  634.  #define CONTEXT c
  635.  #define THIS l
  636.  #define STAP_RETVALUE THIS->__retvalue
  637.  c->last_stmt = "identifier 'execname' at /usr/local/share/systemtap/tapset/linux/context.stp:17:10";
  638.  if (unlikely (c->nesting+1 >= MAXNESTING)) {
  639.    c->last_error = "MAXNESTING exceeded";
  640.    return;
  641.  } else {
  642.    c->nesting ++;
  643.  }
  644.  l->__retvalue[0] = '\0';
  645.  #define return goto out
  646.  {
  647.     /* pure */ /* unprivileged */
  648.     strlcpy (STAP_RETVALUE, current->comm, MAXSTRINGLEN);
  649.  
  650.  }
  651.  #undef return
  652. out:
  653.  if (0) goto out;
  654.  c->nesting --;
  655.  #undef CONTEXT
  656.  #undef THIS
  657.  #undef STAP_RETVALUE
  658. }
  659.  
  660.  
  661. static void function_gettimeofday_ns (struct context* __restrict__ c) {
  662.  __label__ out;
  663.  struct function_gettimeofday_ns_locals *  __restrict__ l = & c->locals[c->nesting+1].function_gettimeofday_ns;
  664.  (void) l;
  665.  #define CONTEXT c
  666.  #define THIS l
  667.  #define STAP_RETVALUE THIS->__retvalue
  668.  c->last_stmt = "identifier 'gettimeofday_ns' at /usr/local/share/systemtap/tapset/linux/timestamp_gtod.stp:21:10";
  669.  if (unlikely (c->nesting+1 >= MAXNESTING)) {
  670.    c->last_error = "MAXNESTING exceeded";
  671.    return;
  672.  } else {
  673.    c->nesting ++;
  674.  }
  675.  l->__retvalue = 0;
  676.  #define return goto out
  677.  {
  678.     /* pure */ /* unprivileged */
  679.  /* NOTE: we can't use do_gettimeofday because we could be called from a
  680.    * context where xtime_lock is already held.  See bug #2525. */
  681.   STAP_RETVALUE = _stp_gettimeofday_ns();
  682.   if (STAP_RETVALUE < 0)
  683.     CONTEXT->last_error = "gettimeofday not initialized";
  684.  
  685.   }
  686.   #undef return
  687. out:
  688.   if (0) goto out;
  689.   c->nesting --;
  690.   #undef CONTEXT
  691.   #undef THIS
  692.   #undef STAP_RETVALUE
  693. }
  694.  
  695.  
  696. static void function_gettimeofday_us (struct context* __restrict__ c) {
  697.   __label__ out;
  698.   struct function_gettimeofday_us_locals *  __restrict__ l = & c->locals[c->nesting+1].function_gettimeofday_us;
  699.   (void) l;
  700.   #define CONTEXT c
  701.   #define THIS l
  702.   #define STAP_RETVALUE THIS->__retvalue
  703.   c->last_stmt = "identifier 'gettimeofday_us' at /usr/local/share/systemtap/tapset/linux/timestamp_gtod.stp:35:10";
  704.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  705.     c->last_error = "MAXNESTING exceeded";
  706.     return;
  707.   } else {
  708.     c->nesting ++;
  709.   }
  710.   l->__retvalue = 0;
  711.   #define return goto out
  712.   l->__retvalue = ({
  713.     l->__tmp0 =
  714.     ({
  715.       function_gettimeofday_ns (c);
  716.       if (unlikely(c->last_error)) goto out;
  717.       c->locals[c->nesting+1].function_gettimeofday_ns.__retvalue;
  718.     });
  719.     if (unlikely(!((int64_t)1000LL))) {
  720.       c->last_error = "division by 0";
  721.       c->last_stmt = "operator '/' at /usr/local/share/systemtap/tapset/linux/timestamp_gtod.stp:36:28";
  722.       goto out;
  723.     }
  724.     _stp_div64 (NULL, l->__tmp0, ((int64_t)1000LL));
  725.   });
  726.   c->actionremaining -= 1;
  727.   if (unlikely (c->actionremaining <= 0)) {
  728.     c->last_error = "MAXACTION exceeded";
  729.     c->last_stmt = "keyword at /usr/local/share/systemtap/tapset/linux/timestamp_gtod.stp:36:3";
  730.     goto out;
  731.   }
  732.   goto out;
  733.   #undef return
  734. out:
  735.   if (0) goto out;
  736.   c->nesting --;
  737.   #undef CONTEXT
  738.   #undef THIS
  739.   #undef STAP_RETVALUE
  740. }
  741.  
  742.  
  743. static void function_pid (struct context* __restrict__ c) {
  744.   __label__ out;
  745.   struct function_pid_locals *  __restrict__ l = & c->locals[c->nesting+1].function_pid;
  746.   (void) l;
  747.   #define CONTEXT c
  748.   #define THIS l
  749.   #define STAP_RETVALUE THIS->__retvalue
  750.   c->last_stmt = "identifier 'pid' at /usr/local/share/systemtap/tapset/linux/context.stp:27:10";
  751.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  752.     c->last_error = "MAXNESTING exceeded";
  753.     return;
  754.   } else {
  755.     c->nesting ++;
  756.   }
  757.   l->__retvalue = 0;
  758.   #define return goto out
  759.   {
  760.      /* pure */ /* unprivileged */
  761.     STAP_RETVALUE = current->tgid;
  762.  
  763.   }
  764.   #undef return
  765. out:
  766.   if (0) goto out;
  767.   c->nesting --;
  768.   #undef CONTEXT
  769.   #undef THIS
  770.   #undef STAP_RETVALUE
  771. }
  772.  
  773.  
  774. static void function_probefunc (struct context* __restrict__ c) {
  775.   __label__ out;
  776.   struct function_probefunc_locals *  __restrict__ l = & c->locals[c->nesting+1].function_probefunc;
  777.   (void) l;
  778.   #define CONTEXT c
  779.   #define THIS l
  780.   #define STAP_RETVALUE THIS->__retvalue
  781.   c->last_stmt = "identifier 'probefunc' at /usr/local/share/systemtap/tapset/linux/context-symbols.stp:99:10";
  782.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  783.     c->last_error = "MAXNESTING exceeded";
  784.     return;
  785.   } else {
  786.     c->nesting ++;
  787.   }
  788.   l->__retvalue[0] = '\0';
  789.   #define return goto out
  790.   strlcpy (l->__retvalue, ((
  791.   ({
  792.     function_user_mode (c);
  793.     if (unlikely(c->last_error)) goto out;
  794.     c->locals[c->nesting+1].function_user_mode.__retvalue;
  795.   })) ? (
  796.   ({
  797.     l->__tmp0 =
  798.     ({
  799.       function_uaddr (c);
  800.       if (unlikely(c->last_error)) goto out;
  801.       c->locals[c->nesting+1].function_uaddr.__retvalue;
  802.     });
  803.     c->locals[c->nesting+1].function_usymname.l_addr = l->__tmp0;
  804.     function_usymname (c);
  805.     if (unlikely(c->last_error)) goto out;
  806.     c->locals[c->nesting+1].function_usymname.__retvalue;
  807.   })) : (
  808.   ({
  809.     l->__tmp1 =
  810.     ({
  811.       function_addr (c);
  812.       if (unlikely(c->last_error)) goto out;
  813.       c->locals[c->nesting+1].function_addr.__retvalue;
  814.     });
  815.     c->locals[c->nesting+1].function_symname.l_addr = l->__tmp1;
  816.     function_symname (c);
  817.     if (unlikely(c->last_error)) goto out;
  818.     c->locals[c->nesting+1].function_symname.__retvalue;
  819.   }))), MAXSTRINGLEN);
  820.   c->actionremaining -= 1;
  821.   if (unlikely (c->actionremaining <= 0)) {
  822.     c->last_error = "MAXACTION exceeded";
  823.     c->last_stmt = "keyword at /usr/local/share/systemtap/tapset/linux/context-symbols.stp:133:5";
  824.     goto out;
  825.   }
  826.   goto out;
  827.   #undef return
  828. out:
  829.   if (0) goto out;
  830.   c->nesting --;
  831.   #undef CONTEXT
  832.   #undef THIS
  833.   #undef STAP_RETVALUE
  834. }
  835.  
  836.  
  837. static void function_stp_pid (struct context* __restrict__ c) {
  838.   __label__ out;
  839.   struct function_stp_pid_locals *  __restrict__ l = & c->locals[c->nesting+1].function_stp_pid;
  840.   (void) l;
  841.   #define CONTEXT c
  842.   #define THIS l
  843.   #define STAP_RETVALUE THIS->__retvalue
  844.   c->last_stmt = "identifier 'stp_pid' at /usr/local/share/systemtap/tapset/linux/context.stp:277:10";
  845.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  846.     c->last_error = "MAXNESTING exceeded";
  847.     return;
  848.   } else {
  849.     c->nesting ++;
  850.   }
  851.   l->__retvalue = 0;
  852.   #define return goto out
  853.   {
  854.      /* pure */
  855.         STAP_RETVALUE = _stp_pid;
  856.  
  857.   }
  858.   #undef return
  859. out:
  860.   if (0) goto out;
  861.   c->nesting --;
  862.   #undef CONTEXT
  863.   #undef THIS
  864.   #undef STAP_RETVALUE
  865. }
  866.  
  867.  
  868. static void function_symname (struct context* __restrict__ c) {
  869.   __label__ out;
  870.   struct function_symname_locals *  __restrict__ l = & c->locals[c->nesting+1].function_symname;
  871.   (void) l;
  872.   #define CONTEXT c
  873.   #define THIS l
  874.   #define STAP_ARG_addr THIS->l_addr
  875.   #define STAP_RETVALUE THIS->__retvalue
  876.   c->last_stmt = "identifier 'symname' at /usr/local/share/systemtap/tapset/linux/context-symbols.stp:225:10";
  877.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  878.     c->last_error = "MAXNESTING exceeded";
  879.     return;
  880.   } else {
  881.     c->nesting ++;
  882.   }
  883.   l->__retvalue[0] = '\0';
  884.   #define return goto out
  885.   {
  886.      /* pure */ /* pragma:symbols */
  887.      _stp_snprint_addr(STAP_RETVALUE, MAXSTRINGLEN, STAP_ARG_addr,
  888.                _STP_SYM_SYMBOL, NULL);
  889.  
  890.   }
  891.   #undef return
  892. out:
  893.   if (0) goto out;
  894.   c->nesting --;
  895.   #undef CONTEXT
  896.   #undef THIS
  897.   #undef STAP_ARG_addr
  898.   #undef STAP_RETVALUE
  899. }
  900.  
  901.  
  902. static void function_thread_indent (struct context* __restrict__ c) {
  903.   __label__ out;
  904.   struct function_thread_indent_locals *  __restrict__ l = & c->locals[c->nesting+1].function_thread_indent;
  905.   (void) l;
  906.   #define CONTEXT c
  907.   #define THIS l
  908.   #define STAP_ARG_delta THIS->l_delta
  909.   #define STAP_RETVALUE THIS->__retvalue
  910.   c->last_stmt = "identifier 'thread_indent' at /usr/local/share/systemtap/tapset/indent.stp:34:10";
  911.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  912.     c->last_error = "MAXNESTING exceeded";
  913.     return;
  914.   } else {
  915.     c->nesting ++;
  916.   }
  917.   l->__retvalue[0] = '\0';
  918.   #define return goto out
  919.   strlcpy (l->__retvalue,
  920.   ({
  921.     l->__tmp0 =
  922.     ({
  923.       function_tid (c);
  924.       if (unlikely(c->last_error)) goto out;
  925.       c->locals[c->nesting+1].function_tid.__retvalue;
  926.     });
  927.     strlcpy (l->__tmp1,
  928.     ({
  929.       strlcpy (l->__tmp2,
  930.       ({
  931.         function_execname (c);
  932.         if (unlikely(c->last_error)) goto out;
  933.         c->locals[c->nesting+1].function_execname.__retvalue;
  934.       }), MAXSTRINGLEN);
  935.       l->__tmp3 =
  936.       ({
  937.         function_tid (c);
  938.         if (unlikely(c->last_error)) goto out;
  939.         c->locals[c->nesting+1].function_tid.__retvalue;
  940.       });
  941.       #ifndef STP_LEGACY_PRINT
  942.         c->printf_locals.stp_sprintf_3.arg0 = l->__tmp2;
  943.         c->printf_locals.stp_sprintf_3.arg1 = l->__tmp3;
  944.         c->printf_locals.stp_sprintf_3.__retvalue = l->__tmp4;
  945.         stp_sprintf_3 (c);
  946.       #else // STP_LEGACY_PRINT
  947.         _stp_snprintf (l->__tmp4, MAXSTRINGLEN, "%s(%lld)", l->__tmp2, l->__tmp3);
  948.       #endif // STP_LEGACY_PRINT
  949.       if (unlikely(c->last_error)) goto out;
  950.       l->__tmp4;
  951.     }), MAXSTRINGLEN);
  952.     l->__tmp5 = l->l_delta;
  953.     c->locals[c->nesting+1].function__generic_indent.l_idx = l->__tmp0;
  954.     strlcpy (c->locals[c->nesting+1].function__generic_indent.l_desc, l->__tmp1, MAXSTRINGLEN);
  955.     c->locals[c->nesting+1].function__generic_indent.l_delta = l->__tmp5;
  956.     function__generic_indent (c);
  957.     if (unlikely(c->last_error)) goto out;
  958.     c->locals[c->nesting+1].function__generic_indent.__retvalue;
  959.   }), MAXSTRINGLEN);
  960.   c->actionremaining -= 1;
  961.   if (unlikely (c->actionremaining <= 0)) {
  962.     c->last_error = "MAXACTION exceeded";
  963.     c->last_stmt = "keyword at /usr/local/share/systemtap/tapset/indent.stp:36:3";
  964.     goto out;
  965.   }
  966.   goto out;
  967.   #undef return
  968. out:
  969.   if (0) goto out;
  970.   c->nesting --;
  971.   #undef CONTEXT
  972.   #undef THIS
  973.   #undef STAP_ARG_delta
  974.   #undef STAP_RETVALUE
  975. }
  976.  
  977.  
  978. static void function_tid (struct context* __restrict__ c) {
  979.   __label__ out;
  980.   struct function_tid_locals *  __restrict__ l = & c->locals[c->nesting+1].function_tid;
  981.   (void) l;
  982.   #define CONTEXT c
  983.   #define THIS l
  984.   #define STAP_RETVALUE THIS->__retvalue
  985.   c->last_stmt = "identifier 'tid' at /usr/local/share/systemtap/tapset/linux/context.stp:37:10";
  986.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  987.     c->last_error = "MAXNESTING exceeded";
  988.     return;
  989.   } else {
  990.     c->nesting ++;
  991.   }
  992.   l->__retvalue = 0;
  993.   #define return goto out
  994.   {
  995.      /* pure */ /* unprivileged */
  996.     STAP_RETVALUE = current->pid;
  997.  
  998.   }
  999.   #undef return
  1000. out:
  1001.   if (0) goto out;
  1002.   c->nesting --;
  1003.   #undef CONTEXT
  1004.   #undef THIS
  1005.   #undef STAP_RETVALUE
  1006. }
  1007.  
  1008.  
  1009. static void function_trace (struct context* __restrict__ c) {
  1010.   __label__ out;
  1011.   struct function_trace_locals *  __restrict__ l = & c->locals[c->nesting+1].function_trace;
  1012.   (void) l;
  1013.   #define CONTEXT c
  1014.   #define THIS l
  1015.   #define STAP_ARG_entry_p THIS->l_entry_p
  1016.   c->last_stmt = "identifier 'trace' at ./systemtap.base/pr10854.stp:1:10";
  1017.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  1018.     c->last_error = "MAXNESTING exceeded";
  1019.     return;
  1020.   } else {
  1021.     c->nesting ++;
  1022.   }
  1023.   #define return goto out
  1024.   c->actionremaining -= 1;
  1025.   if (unlikely (c->actionremaining <= 0)) {
  1026.     c->last_error = "MAXACTION exceeded";
  1027.     c->last_stmt = "keyword at ./systemtap.base/pr10854.stp:2:4";
  1028.     goto out;
  1029.   }
  1030.   if (
  1031.     ({
  1032.       l->__tmp0 =
  1033.       ({
  1034.         function_tid (c);
  1035.         if (unlikely(c->last_error)) goto out;
  1036.         c->locals[c->nesting+1].function_tid.__retvalue;
  1037.       });
  1038.       l->__tmp1 = _stp_map_exists_ii (global(s_trace), l->__tmp0);
  1039.       l->__tmp1;
  1040.     })) {
  1041.     (void)
  1042.     ({
  1043.       strlcpy (l->__tmp2,
  1044.       ({
  1045.         l->__tmp3 = l->l_entry_p;
  1046.         c->locals[c->nesting+1].function_thread_indent.l_delta = l->__tmp3;
  1047.         function_thread_indent (c);
  1048.         if (unlikely(c->last_error)) goto out;
  1049.         c->locals[c->nesting+1].function_thread_indent.__retvalue;
  1050.       }), MAXSTRINGLEN);
  1051.       strlcpy (l->__tmp4, (((((l->l_entry_p) > (((int64_t)0LL))))) ? ("->") : ("<-")), MAXSTRINGLEN);
  1052.       strlcpy (l->__tmp5,
  1053.       ({
  1054.         function_probefunc (c);
  1055.         if (unlikely(c->last_error)) goto out;
  1056.         c->locals[c->nesting+1].function_probefunc.__retvalue;
  1057.       }), MAXSTRINGLEN);
  1058.       #ifndef STP_LEGACY_PRINT
  1059.         c->printf_locals.stp_printf_4.arg0 = l->__tmp2;
  1060.         c->printf_locals.stp_printf_4.arg1 = l->__tmp4;
  1061.         c->printf_locals.stp_printf_4.arg2 = l->__tmp5;
  1062.         stp_printf_4 (c);
  1063.       #else // STP_LEGACY_PRINT
  1064.         _stp_printf ("%s%s%s\n", l->__tmp2, l->__tmp4, l->__tmp5);
  1065.       #endif // STP_LEGACY_PRINT
  1066.       if (unlikely(c->last_error)) goto out;
  1067.       ((int64_t)0LL);
  1068.     });
  1069.     c->actionremaining -= 1;
  1070.     if (unlikely (c->actionremaining <= 0)) {
  1071.       c->last_error = "MAXACTION exceeded";
  1072.       c->last_stmt = "identifier 'printf' at ./systemtap.base/pr10854.stp:3:8";
  1073.       goto out;
  1074.     }
  1075.   }
  1076.   #undef return
  1077. out:
  1078.   if (0) goto out;
  1079.   c->nesting --;
  1080.   #undef CONTEXT
  1081.   #undef THIS
  1082.   #undef STAP_ARG_entry_p
  1083.   #undef STAP_RETVALUE
  1084. }
  1085.  
  1086.  
  1087. static void function_uaddr (struct context* __restrict__ c) {
  1088.   __label__ out;
  1089.   struct function_uaddr_locals *  __restrict__ l = & c->locals[c->nesting+1].function_uaddr;
  1090.   (void) l;
  1091.   #define CONTEXT c
  1092.   #define THIS l
  1093.   #define STAP_RETVALUE THIS->__retvalue
  1094.   c->last_stmt = "identifier 'uaddr' at /usr/local/share/systemtap/tapset/linux/context.stp:373:10";
  1095.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  1096.     c->last_error = "MAXNESTING exceeded";
  1097.     return;
  1098.   } else {
  1099.     c->nesting ++;
  1100.   }
  1101.   l->__retvalue = 0;
  1102.   #define return goto out
  1103.   assert_is_myproc();
  1104.   {
  1105.      /* pure */ /* myproc-unprivileged */
  1106.   struct pt_regs *uregs;
  1107.  
  1108.   if (CONTEXT->user_mode_p)
  1109.     uregs = CONTEXT->uregs;
  1110.   else
  1111.     uregs = _stp_current_pt_regs();
  1112.  
  1113.   if (uregs)
  1114.     STAP_RETVALUE = (int64_t) REG_IP(uregs);
  1115.   else
  1116.     STAP_RETVALUE = 0;
  1117.  
  1118.   }
  1119.   #undef return
  1120. out:
  1121.   if (0) goto out;
  1122.   c->nesting --;
  1123.   #undef CONTEXT
  1124.   #undef THIS
  1125.   #undef STAP_RETVALUE
  1126. }
  1127.  
  1128.  
  1129. static void function_user_mode (struct context* __restrict__ c) {
  1130.   __label__ out;
  1131.   struct function_user_mode_locals *  __restrict__ l = & c->locals[c->nesting+1].function_user_mode;
  1132.   (void) l;
  1133.   #define CONTEXT c
  1134.   #define THIS l
  1135.   #define STAP_RETVALUE THIS->__retvalue
  1136.   c->last_stmt = "identifier 'user_mode' at /usr/local/share/systemtap/tapset/linux/context.stp:218:10";
  1137.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  1138.     c->last_error = "MAXNESTING exceeded";
  1139.     return;
  1140.   } else {
  1141.     c->nesting ++;
  1142.   }
  1143.   l->__retvalue = 0;
  1144.   #define return goto out
  1145.   {
  1146.      /* pure */ /* unprivileged */
  1147.   STAP_RETVALUE = CONTEXT->user_mode_p ? 1 : 0;
  1148.  
  1149.   }
  1150.   #undef return
  1151. out:
  1152.   if (0) goto out;
  1153.   c->nesting --;
  1154.   #undef CONTEXT
  1155.   #undef THIS
  1156.   #undef STAP_RETVALUE
  1157. }
  1158.  
  1159.  
  1160. static void function_usymname (struct context* __restrict__ c) {
  1161.   __label__ out;
  1162.   struct function_usymname_locals *  __restrict__ l = & c->locals[c->nesting+1].function_usymname;
  1163.   (void) l;
  1164.   #define CONTEXT c
  1165.   #define THIS l
  1166.   #define STAP_ARG_addr THIS->l_addr
  1167.   #define STAP_RETVALUE THIS->__retvalue
  1168.   c->last_stmt = "identifier 'usymname' at /usr/local/share/systemtap/tapset/linux/ucontext-symbols.stp:57:10";
  1169.   if (unlikely (c->nesting+1 >= MAXNESTING)) {
  1170.     c->last_error = "MAXNESTING exceeded";
  1171.     return;
  1172.   } else {
  1173.     c->nesting ++;
  1174.   }
  1175.   l->__retvalue[0] = '\0';
  1176.   #define return goto out
  1177.   assert_is_myproc();
  1178.   {
  1179.    
  1180. /* pure */ /* myproc-unprivileged */ /* pragma:vma */ /* pragma:symbols */
  1181.      _stp_snprint_addr(STAP_RETVALUE, MAXSTRINGLEN, STAP_ARG_addr,
  1182.                _STP_SYM_SYMBOL, current);
  1183.  
  1184.   }
  1185.   #undef return
  1186. out:
  1187.   if (0) goto out;
  1188.   c->nesting --;
  1189.   #undef CONTEXT
  1190.   #undef THIS
  1191.   #undef STAP_ARG_addr
  1192.   #undef STAP_RETVALUE
  1193. }
  1194.  
  1195.  
  1196. static void probe_2026 (struct context * __restrict__ c) {
  1197.   __label__ out;
  1198.   static const struct stp_probe_lock locks[] = {
  1199.     {
  1200.       .lock = global_lock(s_trace),
  1201.       .write_p = 1,
  1202.       #ifdef STP_TIMING
  1203.       .skipped = global_skipped(s_trace),
  1204.       #endif
  1205.     },
  1206.     {
  1207.       .lock = global_lock(s__indent_counters),
  1208.       .write_p = 1,
  1209.       #ifdef STP_TIMING
  1210.       .skipped = global_skipped(s__indent_counters),
  1211.       #endif
  1212.     },
  1213.     {
  1214.       .lock = global_lock(s__indent_timestamps),
  1215.       .write_p = 1,
  1216.       #ifdef STP_TIMING
  1217.       .skipped = global_skipped(s__indent_timestamps),
  1218.       #endif
  1219.     },
  1220.   };
  1221.   struct probe_2026_locals * __restrict__ l = & c->probe_locals.probe_2026;
  1222.   (void) l;
  1223.   #if ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPDEV) && \
  1224.       ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPSYS)
  1225.   #error Internal Error: Probe kernel.function("SyS_read@fs/read_write.c:501").call generated in --unprivileged mode
  1226.   #endif
  1227.   if (!stp_lock_probe(locks, ARRAY_SIZE(locks)))
  1228.     return;
  1229.   {
  1230.     c->actionremaining -= 1;
  1231.     if (unlikely (c->actionremaining <= 0)) {
  1232.       c->last_error = "MAXACTION exceeded";
  1233.       c->last_stmt = "keyword at ./systemtap.base/pr10854.stp:10:4";
  1234.       goto out;
  1235.     }
  1236.     if ((((
  1237.       ({
  1238.         function_pid (c);
  1239.         if (unlikely(c->last_error)) goto out;
  1240.         c->locals[c->nesting+1].function_pid.__retvalue;
  1241.       })) == (
  1242.       ({
  1243.         function_stp_pid (c);
  1244.         if (unlikely(c->last_error)) goto out;
  1245.         c->locals[c->nesting+1].function_stp_pid.__retvalue;
  1246.       }))))) {
  1247.       c->actionremaining -= 1;
  1248.       if (unlikely (c->actionremaining <= 0)) {
  1249.         c->last_error = "MAXACTION exceeded";
  1250.         c->last_stmt = "keyword at ./systemtap.base/pr10854.stp:10:28";
  1251.         goto out;
  1252.       }
  1253.       goto out;
  1254.     }
  1255.    
  1256.     (void)
  1257.     ({
  1258.       l->__tmp0 =
  1259.       ({
  1260.         function_tid (c);
  1261.         if (unlikely(c->last_error)) goto out;
  1262.         c->locals[c->nesting+1].function_tid.__retvalue;
  1263.       });
  1264.       c->last_stmt = "identifier 'trace' at ./systemtap.base/pr10854.stp:11:4";
  1265.       l->__tmp2 = ((int64_t)1LL);
  1266.       { int rc = _stp_map_set_ii (global(s_trace), l->__tmp0, l->__tmp2); if (unlikely(rc)) { c->last_error = "Array overflow, check MAXMAPENTRIES"; goto out; }};
  1267.       ((int64_t)1LL);
  1268.     });
  1269.    
  1270.     (void)
  1271.     ({
  1272.       c->locals[c->nesting+1].function_trace.l_entry_p = ((int64_t)1LL);
  1273.       function_trace (c);
  1274.       if (unlikely(c->last_error)) goto out;
  1275.       (void) 0;
  1276.     });
  1277.    
  1278.   }
  1279.   c->actionremaining -= 2;
  1280.   if (unlikely (c->actionremaining <= 0)) {
  1281.     c->last_error = "MAXACTION exceeded";
  1282.     c->last_stmt = "operator '{' at ./systemtap.base/pr10854.stp:9:32";
  1283.     goto out;
  1284.   }
  1285. out:
  1286.   stp_unlock_probe(locks, ARRAY_SIZE(locks));
  1287.   _stp_print_flush();
  1288. }
  1289.  
  1290.  
  1291. static void probe_2027 (struct context * __restrict__ c) {
  1292.   __label__ out;
  1293.   static const struct stp_probe_lock locks[] = {
  1294.     {
  1295.       .lock = global_lock(s_trace),
  1296.       .write_p = 1,
  1297.       #ifdef STP_TIMING
  1298.       .skipped = global_skipped(s_trace),
  1299.       #endif
  1300.     },
  1301.     {
  1302.       .lock = global_lock(s__indent_counters),
  1303.       .write_p = 1,
  1304.       #ifdef STP_TIMING
  1305.       .skipped = global_skipped(s__indent_counters),
  1306.       #endif
  1307.     },
  1308.     {
  1309.       .lock = global_lock(s__indent_timestamps),
  1310.       .write_p = 1,
  1311.       #ifdef STP_TIMING
  1312.       .skipped = global_skipped(s__indent_timestamps),
  1313.       #endif
  1314.     },
  1315.   };
  1316.   struct probe_2027_locals * __restrict__ l = & c->probe_locals.probe_2027;
  1317.   (void) l;
  1318.   #if ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPDEV) && \
  1319.       ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPSYS)
  1320.   #error Internal Error: Probe kernel.function("SyS_read@fs/read_write.c:501").return generated in --unprivileged mode
  1321.   #endif
  1322.   if (!stp_lock_probe(locks, ARRAY_SIZE(locks)))
  1323.     return;
  1324.   {
  1325.     c->actionremaining -= 1;
  1326.     if (unlikely (c->actionremaining <= 0)) {
  1327.       c->last_error = "MAXACTION exceeded";
  1328.       c->last_stmt = "keyword at ./systemtap.base/pr10854.stp:15:4";
  1329.       goto out;
  1330.     }
  1331.     if ((((
  1332.       ({
  1333.         function_pid (c);
  1334.         if (unlikely(c->last_error)) goto out;
  1335.         c->locals[c->nesting+1].function_pid.__retvalue;
  1336.       })) == (
  1337.       ({
  1338.         function_stp_pid (c);
  1339.         if (unlikely(c->last_error)) goto out;
  1340.         c->locals[c->nesting+1].function_stp_pid.__retvalue;
  1341.       }))))) {
  1342.       c->actionremaining -= 1;
  1343.       if (unlikely (c->actionremaining <= 0)) {
  1344.         c->last_error = "MAXACTION exceeded";
  1345.         c->last_stmt = "keyword at ./systemtap.base/pr10854.stp:15:28";
  1346.         goto out;
  1347.       }
  1348.       goto out;
  1349.     }
  1350.    
  1351.     (void)
  1352.     ({
  1353.       l->__tmp0 = ((int64_t)-1LL);
  1354.       c->locals[c->nesting+1].function_trace.l_entry_p = l->__tmp0;
  1355.       function_trace (c);
  1356.       if (unlikely(c->last_error)) goto out;
  1357.       (void) 0;
  1358.     });
  1359.    
  1360.     l->__tmp1 =
  1361.     ({
  1362.       function_tid (c);
  1363.       if (unlikely(c->last_error)) goto out;
  1364.       c->locals[c->nesting+1].function_tid.__retvalue;
  1365.     });
  1366.     _stp_map_del_ii (global(s_trace), l->__tmp1);
  1367.    
  1368.   }
  1369.   c->actionremaining -= 2;
  1370.   if (unlikely (c->actionremaining <= 0)) {
  1371.     c->last_error = "MAXACTION exceeded";
  1372.     c->last_stmt = "operator '{' at ./systemtap.base/pr10854.stp:14:34";
  1373.     goto out;
  1374.   }
  1375. out:
  1376.   stp_unlock_probe(locks, ARRAY_SIZE(locks));
  1377.   _stp_print_flush();
  1378. }
  1379.  
  1380.  
  1381. static void probe_2028 (struct context * __restrict__ c) {
  1382.   __label__ out;
  1383.   static const struct stp_probe_lock locks[] = {
  1384.     {
  1385.       .lock = global_lock(s_trace),
  1386.       .write_p = 0,
  1387.       #ifdef STP_TIMING
  1388.       .skipped = global_skipped(s_trace),
  1389.       #endif
  1390.     },
  1391.     {
  1392.       .lock = global_lock(s__indent_counters),
  1393.       .write_p = 1,
  1394.       #ifdef STP_TIMING
  1395.       .skipped = global_skipped(s__indent_counters),
  1396.       #endif
  1397.     },
  1398.     {
  1399.       .lock = global_lock(s__indent_timestamps),
  1400.       .write_p = 1,
  1401.       #ifdef STP_TIMING
  1402.       .skipped = global_skipped(s__indent_timestamps),
  1403.       #endif
  1404.     },
  1405.   };
  1406.   struct probe_2028_locals * __restrict__ l = & c->probe_locals.probe_2028;
  1407.   (void) l;
  1408.   #if ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPDEV) && \
  1409.       ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPSYS)
  1410.   #error Internal Error: Probe kernel.function("vfs_truncate@fs/open.c:65").call generated in --unprivileged mode
  1411.   #endif
  1412.   if (!stp_lock_probe(locks, ARRAY_SIZE(locks)))
  1413.     return;
  1414.   (void)
  1415.   ({
  1416.     c->locals[c->nesting+1].function_trace.l_entry_p = ((int64_t)1LL);
  1417.     function_trace (c);
  1418.     if (unlikely(c->last_error)) goto out;
  1419.     (void) 0;
  1420.   });
  1421.   c->actionremaining -= 1;
  1422.   if (unlikely (c->actionremaining <= 0)) {
  1423.     c->last_error = "MAXACTION exceeded";
  1424.     c->last_stmt = "identifier 'trace' at ./systemtap.base/pr10854.stp:20:34";
  1425.     goto out;
  1426.   }
  1427. out:
  1428.   stp_unlock_probe(locks, ARRAY_SIZE(locks));
  1429.   _stp_print_flush();
  1430. }
  1431.  
  1432.  
  1433. static void probe_2067 (struct context * __restrict__ c) {
  1434.   __label__ out;
  1435.   static const struct stp_probe_lock locks[] = {
  1436.     {
  1437.       .lock = global_lock(s_trace),
  1438.       .write_p = 0,
  1439.       #ifdef STP_TIMING
  1440.       .skipped = global_skipped(s_trace),
  1441.       #endif
  1442.     },
  1443.     {
  1444.       .lock = global_lock(s__indent_counters),
  1445.       .write_p = 1,
  1446.       #ifdef STP_TIMING
  1447.       .skipped = global_skipped(s__indent_counters),
  1448.       #endif
  1449.     },
  1450.     {
  1451.       .lock = global_lock(s__indent_timestamps),
  1452.       .write_p = 1,
  1453.       #ifdef STP_TIMING
  1454.       .skipped = global_skipped(s__indent_timestamps),
  1455.       #endif
  1456.     },
  1457.   };
  1458.   struct probe_2067_locals * __restrict__ l = & c->probe_locals.probe_2067;
  1459.   (void) l;
  1460.   #if ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPDEV) && \
  1461.       ! STP_PRIVILEGE_CONTAINS (STP_PRIVILEGE, STP_PR_STAPSYS)
  1462.   #error Internal Error: Probe kernel.function("vfs_truncate@fs/open.c:65").return generated in --unprivileged mode
  1463.   #endif
  1464.   if (!stp_lock_probe(locks, ARRAY_SIZE(locks)))
  1465.     return;
  1466.   (void)
  1467.   ({
  1468.     l->__tmp0 = ((int64_t)-1LL);
  1469.     c->locals[c->nesting+1].function_trace.l_entry_p = l->__tmp0;
  1470.     function_trace (c);
  1471.     if (unlikely(c->last_error)) goto out;
  1472.     (void) 0;
  1473.   });
  1474.   c->actionremaining -= 1;
  1475.   if (unlikely (c->actionremaining <= 0)) {
  1476.     c->last_error = "MAXACTION exceeded";
  1477.     c->last_stmt = "identifier 'trace' at ./systemtap.base/pr10854.stp:21:36";
  1478.     goto out;
  1479.   }
  1480. out:
  1481.   stp_unlock_probe(locks, ARRAY_SIZE(locks));
  1482.   _stp_print_flush();
  1483. }
  1484.  
  1485. struct stap_probe {
  1486.   size_t index;
  1487.   void (* const ph) (struct context*);
  1488.   #if defined(STP_TIMING) || defined(STP_ALIBI)
  1489.   const char location[36];
  1490.   const char derivation[49];
  1491.   #define STAP_PROBE_INIT_TIMING(L, D) .location=(L), .derivation=(D),
  1492.   #else
  1493.   #define STAP_PROBE_INIT_TIMING(L, D)
  1494.   #endif
  1495.   const char pp[64];
  1496.   #ifdef STP_NEED_PROBE_NAME
  1497.   const char pn[64];
  1498.   #define STAP_PROBE_INIT_NAME(PN) .pn=(PN),
  1499.   #else
  1500.   #define STAP_PROBE_INIT_NAME(PN)
  1501.   #endif
  1502.   #define STAP_PROBE_INIT(I, PH, PP, PN, L, D) { .index=(I), .ph=(PH), .pp=(PP), STAP_PROBE_INIT_NAME(PN) STAP_PROBE_INIT_TIMING(L, D) }
  1503. } static const stap_probes[] = {
  1504.   STAP_PROBE_INIT(0, &probe_2026, "kernel.function(\"SyS_read@fs/read_write.c:501\").call", "kernel.function(\"SyS_read@fs/read_write.c:501\").call", "./systemtap.base/pr10854.stp:9:1", " from: kernel.function(\"sys_read\").call"),
  1505.   STAP_PROBE_INIT(1, &probe_2027, "kernel.function(\"SyS_read@fs/read_write.c:501\").return", "kernel.function(\"SyS_read@fs/read_write.c:501\").return", "./systemtap.base/pr10854.stp:14:1", " from: kernel.function(\"sys_read\").return"),
  1506.   STAP_PROBE_INIT(2, &probe_2028, "kernel.function(\"vfs_truncate@fs/open.c:65\").call", "kernel.function(\"vfs_truncate@fs/open.c:65\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1507.   STAP_PROBE_INIT(3, &probe_2028, "kernel.function(\"vfs_readv@fs/read_write.c:779\").call", "kernel.function(\"vfs_readv@fs/read_write.c:779\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1508.   STAP_PROBE_INIT(4, &probe_2028, "kernel.function(\"vfs_write@fs/read_write.c:459\").call", "kernel.function(\"vfs_write@fs/read_write.c:459\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1509.   STAP_PROBE_INIT(5, &probe_2028, "kernel.function(\"vfs_setpos@fs/read_write.c:56\").call", "kernel.function(\"vfs_setpos@fs/read_write.c:56\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1510.   STAP_PROBE_INIT(6, &probe_2028, "kernel.function(\"vfs_read@fs/read_write.c:382\").call", "kernel.function(\"vfs_read@fs/read_write.c:382\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1511.   STAP_PROBE_INIT(7, &probe_2028, "kernel.function(\"vfs_llseek@fs/read_write.c:254\").call", "kernel.function(\"vfs_llseek@fs/read_write.c:254\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1512.   STAP_PROBE_INIT(8, &probe_2028, "kernel.function(\"vfs_writev@fs/read_write.c:792\").call", "kernel.function(\"vfs_writev@fs/read_write.c:792\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1513.   STAP_PROBE_INIT(9, &probe_2028, "kernel.function(\"vfs_stat@fs/stat.c:102\").call", "kernel.function(\"vfs_stat@fs/stat.c:102\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1514.   STAP_PROBE_INIT(10, &probe_2028, "kernel.function(\"vfs_lstat@fs/stat.c:108\").call", "kernel.function(\"vfs_lstat@fs/stat.c:108\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1515.   STAP_PROBE_INIT(11, &probe_2028, "kernel.function(\"vfs_getattr@fs/stat.c:40\").call", "kernel.function(\"vfs_getattr@fs/stat.c:40\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1516.   STAP_PROBE_INIT(12, &probe_2028, "kernel.function(\"vfs_fstatat@fs/stat.c:71\").call", "kernel.function(\"vfs_fstatat@fs/stat.c:71\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1517.   STAP_PROBE_INIT(13, &probe_2028, "kernel.function(\"vfs_fstat@fs/stat.c:58\").call", "kernel.function(\"vfs_fstat@fs/stat.c:58\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1518.   STAP_PROBE_INIT(14, &probe_2028, "kernel.function(\"vfs_mknod@fs/namei.c:3165\").call", "kernel.function(\"vfs_mknod@fs/namei.c:3165\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1519.   STAP_PROBE_INIT(15, &probe_2028, "kernel.function(\"vfs_symlink@fs/namei.c:3548\").call", "kernel.function(\"vfs_symlink@fs/namei.c:3548\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1520.   STAP_PROBE_INIT(16, &probe_2028, "kernel.function(\"vfs_readlink@fs/namei.c:3984\").call", "kernel.function(\"vfs_readlink@fs/namei.c:3984\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1521.   STAP_PROBE_INIT(17, &probe_2028, "kernel.function(\"vfs_link@fs/namei.c:3604\").call", "kernel.function(\"vfs_link@fs/namei.c:3604\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1522.   STAP_PROBE_INIT(18, &probe_2028, "kernel.function(\"vfs_rmdir@fs/namei.c:3335\").call", "kernel.function(\"vfs_rmdir@fs/namei.c:3335\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1523.   STAP_PROBE_INIT(19, &probe_2028, "kernel.function(\"vfs_follow_link@fs/namei.c:4023\").call", "kernel.function(\"vfs_follow_link@fs/namei.c:4023\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1524.   STAP_PROBE_INIT(20, &probe_2028, "kernel.function(\"vfs_rename@fs/namei.c:3834\").call", "kernel.function(\"vfs_rename@fs/namei.c:3834\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1525.   STAP_PROBE_INIT(21, &probe_2028, "kernel.function(\"vfs_create@fs/namei.c:2314\").call", "kernel.function(\"vfs_create@fs/namei.c:2314\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1526.   STAP_PROBE_INIT(22, &probe_2028, "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").call", "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1527.   STAP_PROBE_INIT(23, &probe_2028, "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").call", "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1528.   STAP_PROBE_INIT(24, &probe_2028, "kernel.function(\"vfs_mkdir@fs/namei.c:3256\").call", "kernel.function(\"vfs_mkdir@fs/namei.c:3256\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1529.   STAP_PROBE_INIT(25, &probe_2028, "kernel.function(\"vfs_unlink@fs/namei.c:3434\").call", "kernel.function(\"vfs_unlink@fs/namei.c:3434\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1530.   STAP_PROBE_INIT(26, &probe_2028, "kernel.function(\"vfs_kern_mount@fs/namespace.c:775\").call", "kernel.function(\"vfs_kern_mount@fs/namespace.c:775\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1531.   STAP_PROBE_INIT(27, &probe_2028, "kernel.function(\"vfs_setxattr@fs/xattr.c:122\").call", "kernel.function(\"vfs_setxattr@fs/xattr.c:122\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1532.   STAP_PROBE_INIT(28, &probe_2028, "kernel.function(\"vfs_listxattr@fs/xattr.c:267\").call", "kernel.function(\"vfs_listxattr@fs/xattr.c:267\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1533.   STAP_PROBE_INIT(29, &probe_2028, "kernel.function(\"vfs_xattr_cmp@fs/xattr.c:212\").call", "kernel.function(\"vfs_xattr_cmp@fs/xattr.c:212\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1534.   STAP_PROBE_INIT(30, &probe_2028, "kernel.function(\"vfs_getxattr@fs/xattr.c:231\").call", "kernel.function(\"vfs_getxattr@fs/xattr.c:231\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1535.   STAP_PROBE_INIT(31, &probe_2028, "kernel.function(\"vfs_removexattr@fs/xattr.c:287\").call", "kernel.function(\"vfs_removexattr@fs/xattr.c:287\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1536.   STAP_PROBE_INIT(32, &probe_2028, "kernel.function(\"vfs_getxattr_alloc@fs/xattr.c:181\").call", "kernel.function(\"vfs_getxattr_alloc@fs/xattr.c:181\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1537.   STAP_PROBE_INIT(33, &probe_2028, "kernel.function(\"vfs_fsync@fs/sync.c:194\").call", "kernel.function(\"vfs_fsync@fs/sync.c:194\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1538.   STAP_PROBE_INIT(34, &probe_2028, "kernel.function(\"vfs_fsync_range@fs/sync.c:178\").call", "kernel.function(\"vfs_fsync_range@fs/sync.c:178\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1539.   STAP_PROBE_INIT(35, &probe_2028, "kernel.function(\"vfs_statfs@fs/statfs.c:66\").call", "kernel.function(\"vfs_statfs@fs/statfs.c:66\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1540.   STAP_PROBE_INIT(36, &probe_2028, "kernel.function(\"vfs_ustat@fs/statfs.c:216\").call", "kernel.function(\"vfs_ustat@fs/statfs.c:216\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1541.   STAP_PROBE_INIT(37, &probe_2028, "kernel.function(\"vfs_setlease@fs/locks.c:1615\").call", "kernel.function(\"vfs_setlease@fs/locks.c:1615\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1542.   STAP_PROBE_INIT(38, &probe_2028, "kernel.function(\"vfs_lock_file@fs/locks.c:1910\").call", "kernel.function(\"vfs_lock_file@fs/locks.c:1910\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1543.   STAP_PROBE_INIT(39, &probe_2028, "kernel.function(\"vfs_cancel_lock@fs/locks.c:2247\").call", "kernel.function(\"vfs_cancel_lock@fs/locks.c:2247\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1544.   STAP_PROBE_INIT(40, &probe_2028, "kernel.function(\"vfs_test_lock@fs/locks.c:1798\").call", "kernel.function(\"vfs_test_lock@fs/locks.c:1798\").call", "./systemtap.base/pr10854.stp:20:1", " from: kernel.function(\"vfs*@fs/*.c\").call"),
  1545.   STAP_PROBE_INIT(41, &probe_2067, "kernel.function(\"vfs_truncate@fs/open.c:65\").return", "kernel.function(\"vfs_truncate@fs/open.c:65\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1546.   STAP_PROBE_INIT(42, &probe_2067, "kernel.function(\"vfs_readv@fs/read_write.c:779\").return", "kernel.function(\"vfs_readv@fs/read_write.c:779\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1547.   STAP_PROBE_INIT(43, &probe_2067, "kernel.function(\"vfs_write@fs/read_write.c:459\").return", "kernel.function(\"vfs_write@fs/read_write.c:459\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1548.   STAP_PROBE_INIT(44, &probe_2067, "kernel.function(\"vfs_setpos@fs/read_write.c:56\").return", "kernel.function(\"vfs_setpos@fs/read_write.c:56\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1549.   STAP_PROBE_INIT(45, &probe_2067, "kernel.function(\"vfs_read@fs/read_write.c:382\").return", "kernel.function(\"vfs_read@fs/read_write.c:382\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1550.   STAP_PROBE_INIT(46, &probe_2067, "kernel.function(\"vfs_llseek@fs/read_write.c:254\").return", "kernel.function(\"vfs_llseek@fs/read_write.c:254\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1551.   STAP_PROBE_INIT(47, &probe_2067, "kernel.function(\"vfs_writev@fs/read_write.c:792\").return", "kernel.function(\"vfs_writev@fs/read_write.c:792\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1552.   STAP_PROBE_INIT(48, &probe_2067, "kernel.function(\"vfs_stat@fs/stat.c:102\").return", "kernel.function(\"vfs_stat@fs/stat.c:102\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1553.   STAP_PROBE_INIT(49, &probe_2067, "kernel.function(\"vfs_lstat@fs/stat.c:108\").return", "kernel.function(\"vfs_lstat@fs/stat.c:108\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1554.   STAP_PROBE_INIT(50, &probe_2067, "kernel.function(\"vfs_getattr@fs/stat.c:40\").return", "kernel.function(\"vfs_getattr@fs/stat.c:40\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1555.   STAP_PROBE_INIT(51, &probe_2067, "kernel.function(\"vfs_fstatat@fs/stat.c:71\").return", "kernel.function(\"vfs_fstatat@fs/stat.c:71\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1556.   STAP_PROBE_INIT(52, &probe_2067, "kernel.function(\"vfs_fstat@fs/stat.c:58\").return", "kernel.function(\"vfs_fstat@fs/stat.c:58\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1557.   STAP_PROBE_INIT(53, &probe_2067, "kernel.function(\"vfs_mknod@fs/namei.c:3165\").return", "kernel.function(\"vfs_mknod@fs/namei.c:3165\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1558.   STAP_PROBE_INIT(54, &probe_2067, "kernel.function(\"vfs_symlink@fs/namei.c:3548\").return", "kernel.function(\"vfs_symlink@fs/namei.c:3548\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1559.   STAP_PROBE_INIT(55, &probe_2067, "kernel.function(\"vfs_readlink@fs/namei.c:3984\").return", "kernel.function(\"vfs_readlink@fs/namei.c:3984\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1560.   STAP_PROBE_INIT(56, &probe_2067, "kernel.function(\"vfs_link@fs/namei.c:3604\").return", "kernel.function(\"vfs_link@fs/namei.c:3604\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1561.   STAP_PROBE_INIT(57, &probe_2067, "kernel.function(\"vfs_rmdir@fs/namei.c:3335\").return", "kernel.function(\"vfs_rmdir@fs/namei.c:3335\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1562.   STAP_PROBE_INIT(58, &probe_2067, "kernel.function(\"vfs_follow_link@fs/namei.c:4023\").return", "kernel.function(\"vfs_follow_link@fs/namei.c:4023\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1563.   STAP_PROBE_INIT(59, &probe_2067, "kernel.function(\"vfs_rename@fs/namei.c:3834\").return", "kernel.function(\"vfs_rename@fs/namei.c:3834\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1564.   STAP_PROBE_INIT(60, &probe_2067, "kernel.function(\"vfs_create@fs/namei.c:2314\").return", "kernel.function(\"vfs_create@fs/namei.c:2314\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1565.   STAP_PROBE_INIT(61, &probe_2067, "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").return", "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1566.   STAP_PROBE_INIT(62, &probe_2067, "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").return", "kernel.function(\"vfs_path_lookup@fs/namei.c:2057\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1567.   STAP_PROBE_INIT(63, &probe_2067, "kernel.function(\"vfs_mkdir@fs/namei.c:3256\").return", "kernel.function(\"vfs_mkdir@fs/namei.c:3256\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1568.   STAP_PROBE_INIT(64, &probe_2067, "kernel.function(\"vfs_unlink@fs/namei.c:3434\").return", "kernel.function(\"vfs_unlink@fs/namei.c:3434\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1569.   STAP_PROBE_INIT(65, &probe_2067, "kernel.function(\"vfs_kern_mount@fs/namespace.c:775\").return", "kernel.function(\"vfs_kern_mount@fs/namespace.c:775\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1570.   STAP_PROBE_INIT(66, &probe_2067, "kernel.function(\"vfs_setxattr@fs/xattr.c:122\").return", "kernel.function(\"vfs_setxattr@fs/xattr.c:122\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1571.   STAP_PROBE_INIT(67, &probe_2067, "kernel.function(\"vfs_listxattr@fs/xattr.c:267\").return", "kernel.function(\"vfs_listxattr@fs/xattr.c:267\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1572.   STAP_PROBE_INIT(68, &probe_2067, "kernel.function(\"vfs_xattr_cmp@fs/xattr.c:212\").return", "kernel.function(\"vfs_xattr_cmp@fs/xattr.c:212\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1573.   STAP_PROBE_INIT(69, &probe_2067, "kernel.function(\"vfs_getxattr@fs/xattr.c:231\").return", "kernel.function(\"vfs_getxattr@fs/xattr.c:231\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1574.   STAP_PROBE_INIT(70, &probe_2067, "kernel.function(\"vfs_removexattr@fs/xattr.c:287\").return", "kernel.function(\"vfs_removexattr@fs/xattr.c:287\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1575.   STAP_PROBE_INIT(71, &probe_2067, "kernel.function(\"vfs_getxattr_alloc@fs/xattr.c:181\").return", "kernel.function(\"vfs_getxattr_alloc@fs/xattr.c:181\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1576.   STAP_PROBE_INIT(72, &probe_2067, "kernel.function(\"vfs_fsync@fs/sync.c:194\").return", "kernel.function(\"vfs_fsync@fs/sync.c:194\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1577.   STAP_PROBE_INIT(73, &probe_2067, "kernel.function(\"vfs_fsync_range@fs/sync.c:178\").return", "kernel.function(\"vfs_fsync_range@fs/sync.c:178\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1578.   STAP_PROBE_INIT(74, &probe_2067, "kernel.function(\"vfs_statfs@fs/statfs.c:66\").return", "kernel.function(\"vfs_statfs@fs/statfs.c:66\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1579.   STAP_PROBE_INIT(75, &probe_2067, "kernel.function(\"vfs_ustat@fs/statfs.c:216\").return", "kernel.function(\"vfs_ustat@fs/statfs.c:216\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1580.   STAP_PROBE_INIT(76, &probe_2067, "kernel.function(\"vfs_setlease@fs/locks.c:1615\").return", "kernel.function(\"vfs_setlease@fs/locks.c:1615\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1581.   STAP_PROBE_INIT(77, &probe_2067, "kernel.function(\"vfs_lock_file@fs/locks.c:1910\").return", "kernel.function(\"vfs_lock_file@fs/locks.c:1910\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1582.   STAP_PROBE_INIT(78, &probe_2067, "kernel.function(\"vfs_cancel_lock@fs/locks.c:2247\").return", "kernel.function(\"vfs_cancel_lock@fs/locks.c:2247\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1583.   STAP_PROBE_INIT(79, &probe_2067, "kernel.function(\"vfs_test_lock@fs/locks.c:1798\").return", "kernel.function(\"vfs_test_lock@fs/locks.c:1798\").return", "./systemtap.base/pr10854.stp:21:1", " from: kernel.function(\"vfs*@fs/*.c\").return"),
  1584. };
  1585.  
  1586. /* ---- dwarf probes ---- */
  1587. #if ! defined(CONFIG_KPROBES)
  1588. #error "Need CONFIG_KPROBES!"
  1589. #endif
  1590.  
  1591. #ifndef KRETACTIVE
  1592. #define KRETACTIVE (max(15,6*(int)num_possible_cpus()))
  1593. #endif
  1594. #include "linux/kprobes-common.h"
  1595. static int enter_kprobe_probe (struct kprobe *inst, struct pt_regs *regs);
  1596. static int enter_kretprobe_probe (struct kretprobe_instance *inst, struct pt_regs *regs);
  1597. #if defined(STAPCONF_UNREGISTER_KPROBES)
  1598. static void * stap_unreg_kprobes[80];
  1599. #endif
  1600. static struct stap_dwarf_kprobe stap_dwarf_kprobes[80];
  1601. static struct stap_dwarf_probe {
  1602.   const unsigned return_p:1;
  1603.   const unsigned maxactive_p:1;
  1604.   const unsigned optional_p:1;
  1605.   unsigned registered_p:1;
  1606.   const unsigned short maxactive_val;
  1607.   const unsigned short saved_longs;
  1608.   const unsigned short saved_strings;
  1609.   const char module[7];
  1610.   const char section[7];
  1611.   const unsigned long address;
  1612.   const struct stap_probe * const probe;
  1613.   const struct stap_probe * const entry_probe;
  1614. } stap_dwarf_probes[] = {
  1615.   { .address=(unsigned long)0xf43e8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[0]), },
  1616.   { .return_p=1, .address=(unsigned long)0xf43e8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[1]), },
  1617.   { .address=(unsigned long)0xf22ecULL, .module="kernel", .section="_stext", .probe=(&stap_probes[2]), },
  1618.   { .address=(unsigned long)0xf4a2cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[3]), },
  1619.   { .address=(unsigned long)0xf4004ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[4]), },
  1620.   { .address=(unsigned long)0xf3348ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[5]), },
  1621.   { .address=(unsigned long)0xf419cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[6]), },
  1622.   { .address=(unsigned long)0xf33f4ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[7]), },
  1623.   { .address=(unsigned long)0xf49acULL, .module="kernel", .section="_stext", .probe=(&stap_probes[8]), },
  1624.   { .address=(unsigned long)0xf8860ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[9]), },
  1625.   { .address=(unsigned long)0xf8834ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[10]), },
  1626.   { .address=(unsigned long)0xf86dcULL, .module="kernel", .section="_stext", .probe=(&stap_probes[11]), },
  1627.   { .address=(unsigned long)0xf8790ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[12]), },
  1628.   { .address=(unsigned long)0xf872cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[13]), },
  1629.   { .address=(unsigned long)0xff378ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[14]), },
  1630.   { .address=(unsigned long)0xfe7c8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[15]), },
  1631.   { .address=(unsigned long)0xfdc44ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[16]), },
  1632.   { .address=(unsigned long)0xff1d0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[17]), },
  1633.   { .address=(unsigned long)0x100718ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[18]), },
  1634.   { .address=(unsigned long)0xff0fcULL, .module="kernel", .section="_stext", .probe=(&stap_probes[19]), },
  1635.   { .address=(unsigned long)0x100980ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[20]), },
  1636.   { .address=(unsigned long)0xfe624ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[21]), },
  1637.   { .address=(unsigned long)0x448460ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[22]), },
  1638.   { .address=(unsigned long)0x10029cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[23]), },
  1639.   { .address=(unsigned long)0xfe6e8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[24]), },
  1640.   { .address=(unsigned long)0x100478ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[25]), },
  1641.   { .address=(unsigned long)0x11035cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[26]), },
  1642.   { .address=(unsigned long)0x115910ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[27]), },
  1643.   { .address=(unsigned long)0x114f70ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[28]), },
  1644.   { .address=(unsigned long)0x115c40ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[29]), },
  1645.   { .address=(unsigned long)0x1154f0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[30]), },
  1646.   { .address=(unsigned long)0x1156d4ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[31]), },
  1647.   { .address=(unsigned long)0x115b4cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[32]), },
  1648.   { .address=(unsigned long)0x11f7b0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[33]), },
  1649.   { .address=(unsigned long)0x11f75cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[34]), },
  1650.   { .address=(unsigned long)0x120cf8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[35]), },
  1651.   { .address=(unsigned long)0x120f88ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[36]), },
  1652.   { .address=(unsigned long)0x13bfccULL, .module="kernel", .section="_stext", .probe=(&stap_probes[37]), },
  1653.   { .address=(unsigned long)0x13b95cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[38]), },
  1654.   { .address=(unsigned long)0x139ff0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[39]), },
  1655.   { .address=(unsigned long)0x13af5cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[40]), },
  1656.   { .return_p=1, .address=(unsigned long)0xf22ecULL, .module="kernel", .section="_stext", .probe=(&stap_probes[41]), },
  1657.   { .return_p=1, .address=(unsigned long)0xf4a2cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[42]), },
  1658.   { .return_p=1, .address=(unsigned long)0xf4004ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[43]), },
  1659.   { .return_p=1, .address=(unsigned long)0xf3348ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[44]), },
  1660.   { .return_p=1, .address=(unsigned long)0xf419cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[45]), },
  1661.   { .return_p=1, .address=(unsigned long)0xf33f4ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[46]), },
  1662.   { .return_p=1, .address=(unsigned long)0xf49acULL, .module="kernel", .section="_stext", .probe=(&stap_probes[47]), },
  1663.   { .return_p=1, .address=(unsigned long)0xf8860ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[48]), },
  1664.   { .return_p=1, .address=(unsigned long)0xf8834ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[49]), },
  1665.   { .return_p=1, .address=(unsigned long)0xf86dcULL, .module="kernel", .section="_stext", .probe=(&stap_probes[50]), },
  1666.   { .return_p=1, .address=(unsigned long)0xf8790ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[51]), },
  1667.   { .return_p=1, .address=(unsigned long)0xf872cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[52]), },
  1668.   { .return_p=1, .address=(unsigned long)0xff378ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[53]), },
  1669.   { .return_p=1, .address=(unsigned long)0xfe7c8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[54]), },
  1670.   { .return_p=1, .address=(unsigned long)0xfdc44ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[55]), },
  1671.   { .return_p=1, .address=(unsigned long)0xff1d0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[56]), },
  1672.   { .return_p=1, .address=(unsigned long)0x100718ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[57]), },
  1673.   { .return_p=1, .address=(unsigned long)0xff0fcULL, .module="kernel", .section="_stext", .probe=(&stap_probes[58]), },
  1674.   { .return_p=1, .address=(unsigned long)0x100980ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[59]), },
  1675.   { .return_p=1, .address=(unsigned long)0xfe624ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[60]), },
  1676.   { .return_p=1, .address=(unsigned long)0x448460ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[61]), },
  1677.   { .return_p=1, .address=(unsigned long)0x10029cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[62]), },
  1678.   { .return_p=1, .address=(unsigned long)0xfe6e8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[63]), },
  1679.   { .return_p=1, .address=(unsigned long)0x100478ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[64]), },
  1680.   { .return_p=1, .address=(unsigned long)0x11035cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[65]), },
  1681.   { .return_p=1, .address=(unsigned long)0x115910ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[66]), },
  1682.   { .return_p=1, .address=(unsigned long)0x114f70ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[67]), },
  1683.   { .return_p=1, .address=(unsigned long)0x115c40ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[68]), },
  1684.   { .return_p=1, .address=(unsigned long)0x1154f0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[69]), },
  1685.   { .return_p=1, .address=(unsigned long)0x1156d4ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[70]), },
  1686.   { .return_p=1, .address=(unsigned long)0x115b4cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[71]), },
  1687.   { .return_p=1, .address=(unsigned long)0x11f7b0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[72]), },
  1688.   { .return_p=1, .address=(unsigned long)0x11f75cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[73]), },
  1689.   { .return_p=1, .address=(unsigned long)0x120cf8ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[74]), },
  1690.   { .return_p=1, .address=(unsigned long)0x120f88ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[75]), },
  1691.   { .return_p=1, .address=(unsigned long)0x13bfccULL, .module="kernel", .section="_stext", .probe=(&stap_probes[76]), },
  1692.   { .return_p=1, .address=(unsigned long)0x13b95cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[77]), },
  1693.   { .return_p=1, .address=(unsigned long)0x139ff0ULL, .module="kernel", .section="_stext", .probe=(&stap_probes[78]), },
  1694.   { .return_p=1, .address=(unsigned long)0x13af5cULL, .module="kernel", .section="_stext", .probe=(&stap_probes[79]), },
  1695. };
  1696.  
  1697. static int enter_kprobe_probe (struct kprobe *inst, struct pt_regs *regs) {
  1698.   int kprobe_idx = ((uintptr_t)inst-(uintptr_t)stap_dwarf_kprobes)/sizeof(struct stap_dwarf_kprobe);
  1699.   struct stap_dwarf_probe *sdp = &stap_dwarf_probes[((kprobe_idx >= 0 && kprobe_idx < 80)?kprobe_idx:0)];
  1700.   #ifdef STP_ALIBI
  1701.   atomic_inc(probe_alibi(sdp->probe->index));
  1702.   #else
  1703.   struct context* __restrict__ c;
  1704.   #if !INTERRUPTIBLE
  1705.   unsigned long flags;
  1706.   #endif
  1707.   #ifdef STP_TIMING
  1708.   Stat stat = probe_timing(sdp->probe->index);
  1709.   #endif
  1710.   #if defined(STP_TIMING) || defined(STP_OVERLOAD)
  1711.   cycles_t cycles_atstart = get_cycles ();
  1712.   #endif
  1713.   #if INTERRUPTIBLE
  1714.   preempt_disable ();
  1715.   #else
  1716.   local_irq_save (flags);
  1717.   #endif
  1718.   if (unlikely ((((unsigned long) (& c)) & (THREAD_SIZE-1))
  1719.     < (MINSTACKSPACE + sizeof (struct thread_info)))) {
  1720.     atomic_inc (skipped_count());
  1721.     #ifdef STP_TIMING
  1722.     atomic_inc (skipped_count_lowstack());
  1723.     #endif
  1724.     goto probe_epilogue;
  1725.   }
  1726.   if (atomic_read (session_state()) != STAP_SESSION_RUNNING)
  1727.     goto probe_epilogue;
  1728.   c = _stp_runtime_entryfn_get_context();
  1729.   if (atomic_inc_return (& c->busy) != 1) {
  1730.     #if !INTERRUPTIBLE
  1731.     atomic_inc (skipped_count());
  1732.     #endif
  1733.     #ifdef STP_TIMING
  1734.     atomic_inc (skipped_count_reentrant());
  1735.     #ifdef DEBUG_REENTRANCY
  1736.     _stp_warn ("Skipped %s due to %s residency on cpu %u\n", sdp->probe->pp, c->probe_point ?: "?", smp_processor_id());
  1737.     #endif
  1738.     #endif
  1739.     atomic_dec (& c->busy);
  1740.     goto probe_epilogue;
  1741.   }
  1742.  
  1743.   c->last_stmt = 0;
  1744.   c->last_error = 0;
  1745.   c->nesting = -1;
  1746.   c->uregs = 0;
  1747.   c->kregs = 0;
  1748.   #if defined __ia64__
  1749.   c->unwaddr = 0;
  1750.   #endif
  1751.   c->probe_point = sdp->probe->pp;
  1752.   #ifdef STP_NEED_PROBE_NAME
  1753.   c->probe_name = sdp->probe->pn;
  1754.   #endif
  1755.   c->probe_type = stp_probe_type_kprobe;
  1756.   memset(&c->ips, 0, sizeof(c->ips));
  1757.   c->user_mode_p = 0; c->full_uregs_p = 0;
  1758.   #ifdef STAP_NEED_REGPARM
  1759.   c->regparm = 0;
  1760.   #endif
  1761.   #if INTERRUPTIBLE
  1762.   c->actionremaining = MAXACTION_INTERRUPTIBLE;
  1763.   #else
  1764.   c->actionremaining = MAXACTION;
  1765.   #endif
  1766.   #if defined(STP_NEED_UNWIND_DATA)
  1767.   c->uwcache_user.state = uwcache_uninitialized;
  1768.   c->uwcache_kernel.state = uwcache_uninitialized;
  1769.   #endif
  1770.   c->kregs = regs;
  1771.   {
  1772.     unsigned long kprobes_ip = REG_IP(c->kregs);
  1773.     SET_REG_IP(regs, (unsigned long) inst->addr);
  1774.     (*sdp->probe->ph) (c);
  1775.     SET_REG_IP(regs, kprobes_ip);
  1776.   }
  1777.   #if defined(STP_TIMING) || defined(STP_OVERLOAD)
  1778.   {
  1779.     cycles_t cycles_atend = get_cycles ();
  1780.     int32_t cycles_elapsed = ((int32_t)cycles_atend > (int32_t)cycles_atstart)
  1781.       ? ((int32_t)cycles_atend - (int32_t)cycles_atstart)
  1782.       : (~(int32_t)0) - (int32_t)cycles_atstart + (int32_t)cycles_atend + 1;
  1783.     #ifdef STP_TIMING
  1784.     if (likely (stat)) _stp_stat_add(stat, cycles_elapsed);
  1785.     #endif
  1786.     #ifdef STP_OVERLOAD
  1787.     {
  1788.       cycles_t interval = (cycles_atend > c->cycles_base)
  1789.         ? (cycles_atend - c->cycles_base)
  1790.         : (STP_OVERLOAD_INTERVAL + 1);
  1791.       c->cycles_sum += cycles_elapsed;
  1792.       if (interval > STP_OVERLOAD_INTERVAL) {
  1793.         if (c->cycles_sum > STP_OVERLOAD_THRESHOLD) {
  1794.           _stp_error ("probe overhead exceeded threshold");
  1795.           atomic_set (session_state(), STAP_SESSION_ERROR);
  1796.           atomic_inc (error_count());
  1797.         }
  1798.         c->cycles_base = cycles_atend;
  1799.         c->cycles_sum = 0;
  1800.       }
  1801.     }
  1802.     #endif
  1803.   }
  1804.   #endif
  1805.   c->probe_point = 0;
  1806.   #ifdef STP_NEED_PROBE_NAME
  1807.   c->probe_name = 0;
  1808.   #endif
  1809.   c->probe_type = 0;
  1810.   if (unlikely (c->last_error && c->last_error[0])) {
  1811.     if (c->last_stmt != NULL)
  1812.       _stp_softerror ("%s near %s", c->last_error, c->last_stmt);
  1813.     else
  1814.       _stp_softerror ("%s", c->last_error);
  1815.     atomic_inc (error_count());
  1816.     if (atomic_read (error_count()) > MAXERRORS) {
  1817.       atomic_set (session_state(), STAP_SESSION_ERROR);
  1818.       _stp_exit ();
  1819.     }
  1820.   }
  1821.   atomic_dec (&c->busy);
  1822. probe_epilogue:
  1823.   _stp_runtime_entryfn_put_context();
  1824.   if (unlikely (atomic_read (skipped_count()) > MAXSKIPPED)) {
  1825.     if (unlikely (pseudo_atomic_cmpxchg(session_state(), STAP_SESSION_RUNNING, STAP_SESSION_ERROR) == STAP_SESSION_RUNNING))
  1826.     _stp_error ("Skipped too many probes, check MAXSKIPPED or try again with stap -t for more details.");
  1827.   }
  1828.   #if INTERRUPTIBLE
  1829.   preempt_enable_no_resched ();
  1830.   #else
  1831.   local_irq_restore (flags);
  1832.   #endif
  1833.   #endif // STP_ALIBI
  1834.   return 0;
  1835. }
  1836.  
  1837. static int enter_kretprobe_common (struct kretprobe_instance *inst, struct pt_regs *regs, int entry) {
  1838.   struct kretprobe *krp = inst->rp;
  1839.   int kprobe_idx = ((uintptr_t)krp-(uintptr_t)stap_dwarf_kprobes)/sizeof(struct stap_dwarf_kprobe);
  1840.   struct stap_dwarf_probe *sdp = &stap_dwarf_probes[((kprobe_idx >= 0 && kprobe_idx < 80)?kprobe_idx:0)];
  1841.   const struct stap_probe *sp = entry ? sdp->entry_probe : sdp->probe;
  1842.   if (sp) {
  1843.     #ifdef STP_ALIBI
  1844.     atomic_inc(probe_alibi(sp->index));
  1845.     #else
  1846.     struct context* __restrict__ c;
  1847.     #if !INTERRUPTIBLE
  1848.     unsigned long flags;
  1849.     #endif
  1850.     #ifdef STP_TIMING
  1851.     Stat stat = probe_timing(sp->index);
  1852.     #endif
  1853.     #if defined(STP_TIMING) || defined(STP_OVERLOAD)
  1854.     cycles_t cycles_atstart = get_cycles ();
  1855.     #endif
  1856.     #if INTERRUPTIBLE
  1857.     preempt_disable ();
  1858.     #else
  1859.     local_irq_save (flags);
  1860.     #endif
  1861.     if (unlikely ((((unsigned long) (& c)) & (THREAD_SIZE-1))
  1862.       < (MINSTACKSPACE + sizeof (struct thread_info)))) {
  1863.       atomic_inc (skipped_count());
  1864.       #ifdef STP_TIMING
  1865.       atomic_inc (skipped_count_lowstack());
  1866.       #endif
  1867.       goto probe_epilogue;
  1868.     }
  1869.     if (atomic_read (session_state()) != STAP_SESSION_RUNNING)
  1870.       goto probe_epilogue;
  1871.     c = _stp_runtime_entryfn_get_context();
  1872.     if (atomic_inc_return (& c->busy) != 1) {
  1873.       #if !INTERRUPTIBLE
  1874.       atomic_inc (skipped_count());
  1875.       #endif
  1876.       #ifdef STP_TIMING
  1877.       atomic_inc (skipped_count_reentrant());
  1878.       #ifdef DEBUG_REENTRANCY
  1879.       _stp_warn ("Skipped %s due to %s residency on cpu %u\n", sp->pp, c->probe_point ?: "?", smp_processor_id());
  1880.       #endif
  1881.       #endif
  1882.       atomic_dec (& c->busy);
  1883.       goto probe_epilogue;
  1884.     }
  1885.    
  1886.     c->last_stmt = 0;
  1887.     c->last_error = 0;
  1888.     c->nesting = -1;
  1889.     c->uregs = 0;
  1890.     c->kregs = 0;
  1891.     #if defined __ia64__
  1892.     c->unwaddr = 0;
  1893.     #endif
  1894.     c->probe_point = sp->pp;
  1895.     #ifdef STP_NEED_PROBE_NAME
  1896.     c->probe_name = sp->pn;
  1897.     #endif
  1898.     c->probe_type = stp_probe_type_kretprobe;
  1899.     memset(&c->ips, 0, sizeof(c->ips));
  1900.     c->user_mode_p = 0; c->full_uregs_p = 0;
  1901.     #ifdef STAP_NEED_REGPARM
  1902.     c->regparm = 0;
  1903.     #endif
  1904.     #if INTERRUPTIBLE
  1905.     c->actionremaining = MAXACTION_INTERRUPTIBLE;
  1906.     #else
  1907.     c->actionremaining = MAXACTION;
  1908.     #endif
  1909.     #if defined(STP_NEED_UNWIND_DATA)
  1910.     c->uwcache_user.state = uwcache_uninitialized;
  1911.     c->uwcache_kernel.state = uwcache_uninitialized;
  1912.     #endif
  1913.     c->kregs = regs;
  1914.     c->ips.krp.pi = inst;
  1915.     c->ips.krp.pi_longs = sdp->saved_longs;
  1916.     {
  1917.       unsigned long kprobes_ip = REG_IP(c->kregs);
  1918.       if (entry)
  1919.         SET_REG_IP(regs, (unsigned long) inst->rp->kp.addr);
  1920.       else
  1921.         SET_REG_IP(regs, (unsigned long)inst->ret_addr);
  1922.       (sp->ph) (c);
  1923.       SET_REG_IP(regs, kprobes_ip);
  1924.     }
  1925.     #if defined(STP_TIMING) || defined(STP_OVERLOAD)
  1926.     {
  1927.       cycles_t cycles_atend = get_cycles ();
  1928.       int32_t cycles_elapsed = ((int32_t)cycles_atend > (int32_t)cycles_atstart)
  1929.         ? ((int32_t)cycles_atend - (int32_t)cycles_atstart)
  1930.         : (~(int32_t)0) - (int32_t)cycles_atstart + (int32_t)cycles_atend + 1;
  1931.       #ifdef STP_TIMING
  1932.       if (likely (stat)) _stp_stat_add(stat, cycles_elapsed);
  1933.       #endif
  1934.       #ifdef STP_OVERLOAD
  1935.       {
  1936.         cycles_t interval = (cycles_atend > c->cycles_base)
  1937.           ? (cycles_atend - c->cycles_base)
  1938.           : (STP_OVERLOAD_INTERVAL + 1);
  1939.         c->cycles_sum += cycles_elapsed;
  1940.         if (interval > STP_OVERLOAD_INTERVAL) {
  1941.           if (c->cycles_sum > STP_OVERLOAD_THRESHOLD) {
  1942.             _stp_error ("probe overhead exceeded threshold");
  1943.             atomic_set (session_state(), STAP_SESSION_ERROR);
  1944.             atomic_inc (error_count());
  1945.           }
  1946.           c->cycles_base = cycles_atend;
  1947.           c->cycles_sum = 0;
  1948.         }
  1949.       }
  1950.       #endif
  1951.     }
  1952.     #endif
  1953.     c->probe_point = 0;
  1954.     #ifdef STP_NEED_PROBE_NAME
  1955.     c->probe_name = 0;
  1956.     #endif
  1957.     c->probe_type = 0;
  1958.     if (unlikely (c->last_error && c->last_error[0])) {
  1959.       if (c->last_stmt != NULL)
  1960.         _stp_softerror ("%s near %s", c->last_error, c->last_stmt);
  1961.       else
  1962.         _stp_softerror ("%s", c->last_error);
  1963.       atomic_inc (error_count());
  1964.       if (atomic_read (error_count()) > MAXERRORS) {
  1965.         atomic_set (session_state(), STAP_SESSION_ERROR);
  1966.         _stp_exit ();
  1967.       }
  1968.     }
  1969.     atomic_dec (&c->busy);
  1970.   probe_epilogue:
  1971.     _stp_runtime_entryfn_put_context();
  1972.     if (unlikely (atomic_read (skipped_count()) > MAXSKIPPED)) {
  1973.       if (unlikely (pseudo_atomic_cmpxchg(session_state(), STAP_SESSION_RUNNING, STAP_SESSION_ERROR) == STAP_SESSION_RUNNING))
  1974.       _stp_error ("Skipped too many probes, check MAXSKIPPED or try again with stap -t for more details.");
  1975.     }
  1976.     #if INTERRUPTIBLE
  1977.     preempt_enable_no_resched ();
  1978.     #else
  1979.     local_irq_restore (flags);
  1980.     #endif
  1981.     #endif // STP_ALIBI
  1982.   }
  1983.   return 0;
  1984. }
  1985.  
  1986. static int enter_kretprobe_probe (struct kretprobe_instance *inst, struct pt_regs *regs) {
  1987.   return enter_kretprobe_common(inst, regs, 0);
  1988. }
  1989.  
  1990. static int enter_kretprobe_entry_probe (struct kretprobe_instance *inst, struct pt_regs *regs) {
  1991.   return enter_kretprobe_common(inst, regs, 1);
  1992. }
  1993.  
  1994.  
  1995. static int systemtap_module_init (void) {
  1996.   int rc = 0;
  1997.   int cpu;
  1998.   int i=0, j=0;
  1999.   const char *probe_point = "";
  2000.   {
  2001.     const char* release = UTS_RELEASE;
  2002.     #ifdef STAPCONF_GENERATED_COMPILE
  2003.     const char* version = UTS_VERSION;
  2004.     #endif
  2005.     if (strcmp (release, "3.11.0-rc5")) {
  2006.       _stp_error ("module release mismatch (%s vs %s)", release, "3.11.0-rc5");
  2007.       rc = -EINVAL;
  2008.     }
  2009.     #ifdef STAPCONF_GENERATED_COMPILE
  2010.     if (strcmp (utsname()->version, version)) {
  2011.       _stp_error ("module version mismatch (%s vs %s), release %s", version, utsname()->version, release);
  2012.       rc = -EINVAL;
  2013.     }
  2014.     #endif
  2015.     if (_stp_module_check()) rc = -EINVAL;
  2016.     if (_stp_privilege_credentials == 0) {
  2017.       if (STP_PRIVILEGE_CONTAINS(STP_PRIVILEGE, STP_PR_STAPDEV) ||
  2018.           STP_PRIVILEGE_CONTAINS(STP_PRIVILEGE, STP_PR_STAPUSR)) {
  2019.         _stp_privilege_credentials = STP_PRIVILEGE;
  2020.         #ifdef DEBUG_PRIVILEGE
  2021.           _dbug("User's privilege credentials default to %s\n",
  2022.                 privilege_to_text(_stp_privilege_credentials));
  2023.         #endif
  2024.       }
  2025.       else {
  2026.         _stp_error ("Unable to verify that you have the required privilege credentials to run this module (%s required). You must use staprun version 1.7 or higher.",
  2027.                     privilege_to_text(STP_PRIVILEGE));
  2028.         rc = -EINVAL;
  2029.       }
  2030.     }
  2031.     else {
  2032.       #ifdef DEBUG_PRIVILEGE
  2033.         _dbug("User's privilege credentials provided as %s\n",
  2034.               privilege_to_text(_stp_privilege_credentials));
  2035.       #endif
  2036.       if (! STP_PRIVILEGE_CONTAINS(_stp_privilege_credentials, STP_PRIVILEGE)) {
  2037.         _stp_error ("Your privilege credentials (%s) are insufficient to run this module (%s required).",
  2038.                     privilege_to_text(_stp_privilege_credentials), privilege_to_text(STP_PRIVILEGE));
  2039.         rc = -EINVAL;
  2040.       }
  2041.     }
  2042.   }
  2043.   if (rc) goto out;
  2044.   rc = stp_session_init();
  2045.   if (rc) {
  2046.     _stp_error ("couldn't initialize the main session (rc %d)", rc);
  2047.     goto out;
  2048.   }
  2049.   #ifdef STAP_NEED_GETTIMEOFDAY
  2050.   rc = _stp_init_time();
  2051.   if (rc) {
  2052.     _stp_error ("couldn't initialize gettimeofday");
  2053.     goto out;
  2054.   }
  2055.   #endif
  2056.   (void) probe_point;
  2057.   (void) i;
  2058.   (void) j;
  2059.   atomic_set (session_state(), STAP_SESSION_STARTING);
  2060.   rc = _stp_runtime_contexts_alloc();
  2061.   if (rc != 0)
  2062.     goto out;
  2063.   global_set(s_trace, _stp_map_new_ii (MAXMAPENTRIES, 0)); if (global(s_trace) == NULL) rc = -ENOMEM;
  2064.   if (rc) {
  2065.     _stp_error ("global variable 'trace' allocation failed");
  2066.     goto out;
  2067.   }
  2068.   global_lock_init(s_trace);
  2069.   #ifdef STP_TIMING
  2070.   atomic_set(global_skipped(s_trace), 0);
  2071.   #endif
  2072.   global_set(s__indent_counters, _stp_map_new_ii (MAXMAPENTRIES, 0)); if (global(s__indent_counters) == NULL) rc = -ENOMEM;
  2073.   if (rc) {
  2074.     _stp_error ("global variable '_indent_counters' allocation failed");
  2075.     goto out;
  2076.   }
  2077.   global_lock_init(s__indent_counters);
  2078.   #ifdef STP_TIMING
  2079.   atomic_set(global_skipped(s__indent_counters), 0);
  2080.   #endif
  2081.   global_set(s__indent_timestamps, _stp_map_new_ii (MAXMAPENTRIES, 0)); if (global(s__indent_timestamps) == NULL) rc = -ENOMEM;
  2082.   if (rc) {
  2083.     _stp_error ("global variable '_indent_timestamps' allocation failed");
  2084.     goto out;
  2085.   }
  2086.   global_lock_init(s__indent_timestamps);
  2087.   #ifdef STP_TIMING
  2088.   atomic_set(global_skipped(s__indent_timestamps), 0);
  2089.   #endif
  2090.   _stp_print_kernel_info("2.2.1/0.155", (num_online_cpus() * sizeof(struct context)), 80);
  2091.   for (i=0; i<80; i++) {
  2092.     struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2093.     struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2094.     unsigned long relocated_addr = _stp_kmodule_relocate (sdp->module, sdp->section, sdp->address);
  2095.     if (relocated_addr == 0) continue;
  2096.     probe_point = sdp->probe->pp;
  2097.     if (sdp->return_p) {
  2098.       kp->u.krp.kp.addr = (void *) relocated_addr;
  2099.       if (sdp->maxactive_p) {
  2100.         kp->u.krp.maxactive = sdp->maxactive_val;
  2101.       } else {
  2102.         kp->u.krp.maxactive = KRETACTIVE;
  2103.       }
  2104.       kp->u.krp.handler = &enter_kretprobe_probe;
  2105.       #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
  2106.       if (sdp->entry_probe) {
  2107.         kp->u.krp.entry_handler = &enter_kretprobe_entry_probe;
  2108.         kp->u.krp.data_size = sdp->saved_longs * sizeof(int64_t) +
  2109.                               sdp->saved_strings * MAXSTRINGLEN;
  2110.       }
  2111.       #endif
  2112.       #ifdef __ia64__
  2113.       kp->dummy.addr = kp->u.krp.kp.addr;
  2114.       kp->dummy.pre_handler = NULL;
  2115.       rc = register_kprobe (& kp->dummy);
  2116.       if (rc == 0) {
  2117.         rc = register_kretprobe (& kp->u.krp);
  2118.         if (rc != 0)
  2119.           unregister_kprobe (& kp->dummy);
  2120.       }
  2121.       #else
  2122.       rc = register_kretprobe (& kp->u.krp);
  2123.       #endif
  2124.     } else {
  2125.       kp->u.kp.addr = (void *) relocated_addr;
  2126.       kp->u.kp.pre_handler = &enter_kprobe_probe;
  2127.       #ifdef __ia64__
  2128.       kp->dummy.addr = kp->u.kp.addr;
  2129.       kp->dummy.pre_handler = NULL;
  2130.       rc = register_kprobe (& kp->dummy);
  2131.       if (rc == 0) {
  2132.         rc = register_kprobe (& kp->u.kp);
  2133.         if (rc != 0)
  2134.           unregister_kprobe (& kp->dummy);
  2135.       }
  2136.       #else
  2137.       rc = register_kprobe (& kp->u.kp);
  2138.       #endif
  2139.     }
  2140.     if (rc) {
  2141.       sdp->registered_p = 0;
  2142.       if (!sdp->optional_p)
  2143.         _stp_warn ("probe %s (address 0x%lx) registration error (rc %d)", probe_point, (unsigned long) relocated_addr, rc);
  2144.       rc = 0;
  2145.     }
  2146.     else sdp->registered_p = 1;
  2147.   }
  2148.   if (rc) {
  2149.     if (probe_point)
  2150.       _stp_error ("probe %s registration error (rc %d)", probe_point, rc);
  2151.     atomic_set (session_state(), STAP_SESSION_ERROR);
  2152.     goto out;
  2153.   }
  2154.  
  2155.   /* ---- vma tracker ---- */
  2156.   rc = _stp_vma_init();
  2157.  
  2158.   /* ---- task finder ---- */
  2159.   if (rc == 0) {
  2160.     rc = stap_start_task_finder();
  2161.     if (rc) {
  2162.       stap_stop_task_finder();
  2163.     }
  2164.   }
  2165.   if (rc) {
  2166.     if (probe_point)
  2167.       _stp_error ("probe %s registration error (rc %d)", probe_point, rc);
  2168.     atomic_set (session_state(), STAP_SESSION_ERROR);
  2169.     #if defined(STAPCONF_UNREGISTER_KPROBES)
  2170.     j = 0;
  2171.     for (i=0; i<80; i++) {
  2172.       struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2173.       struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2174.       if (! sdp->registered_p) continue;
  2175.       if (!sdp->return_p)
  2176.         stap_unreg_kprobes[j++] = &kp->u.kp;
  2177.     }
  2178.     unregister_kprobes((struct kprobe **)stap_unreg_kprobes, j);
  2179.     j = 0;
  2180.     for (i=0; i<80; i++) {
  2181.       struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2182.       struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2183.       if (! sdp->registered_p) continue;
  2184.       if (sdp->return_p)
  2185.         stap_unreg_kprobes[j++] = &kp->u.krp;
  2186.     }
  2187.     unregister_kretprobes((struct kretprobe **)stap_unreg_kprobes, j);
  2188.     #ifdef __ia64__
  2189.     j = 0;
  2190.     for (i=0; i<80; i++) {
  2191.       struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2192.       struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2193.       if (! sdp->registered_p) continue;
  2194.       stap_unreg_kprobes[j++] = &kp->dummy;
  2195.     }
  2196.     unregister_kprobes((struct kprobe **)stap_unreg_kprobes, j);
  2197.     #endif
  2198.     #endif
  2199.     for (i=0; i<80; i++) {
  2200.       struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2201.       struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2202.       if (! sdp->registered_p) continue;
  2203.       if (sdp->return_p) {
  2204.       #if !defined(STAPCONF_UNREGISTER_KPROBES)
  2205.         unregister_kretprobe (&kp->u.krp);
  2206.         #endif
  2207.         atomic_add (kp->u.krp.nmissed, skipped_count());
  2208.         #ifdef STP_TIMING
  2209.         if (kp->u.krp.nmissed)
  2210.           _stp_warn ("Skipped due to missed kretprobe/1 on '%s': %d\n", sdp->probe->pp, kp->u.krp.nmissed);
  2211.         #endif
  2212.         atomic_add (kp->u.krp.kp.nmissed, skipped_count());
  2213.         #ifdef STP_TIMING
  2214.         if (kp->u.krp.kp.nmissed)
  2215.           _stp_warn ("Skipped due to missed kretprobe/2 on '%s': %lu\n", sdp->probe->pp, kp->u.krp.kp.nmissed);
  2216.         #endif
  2217.       } else {
  2218.       #if !defined(STAPCONF_UNREGISTER_KPROBES)
  2219.         unregister_kprobe (&kp->u.kp);
  2220.         #endif
  2221.         atomic_add (kp->u.kp.nmissed, skipped_count());
  2222.         #ifdef STP_TIMING
  2223.         if (kp->u.kp.nmissed)
  2224.           _stp_warn ("Skipped due to missed kprobe on '%s': %lu\n", sdp->probe->pp, kp->u.kp.nmissed);
  2225.         #endif
  2226.       }
  2227.       #if !defined(STAPCONF_UNREGISTER_KPROBES) && defined(__ia64__)
  2228.       unregister_kprobe (&kp->dummy);
  2229.       #endif
  2230.       sdp->registered_p = 0;
  2231.     }
  2232.     goto out;
  2233.   }
  2234.   if (atomic_read (session_state()) == STAP_SESSION_STARTING)
  2235.     atomic_set (session_state(), STAP_SESSION_RUNNING);
  2236.     /* ---- task finder ---- */
  2237.     stap_task_finder_post_init();
  2238.   return 0;
  2239. out:
  2240.   _stp_map_del (global(s_trace));
  2241.   _stp_map_del (global(s__indent_counters));
  2242.   _stp_map_del (global(s__indent_timestamps));
  2243.   atomic_set (session_state(), STAP_SESSION_STOPPED);
  2244.   #ifdef STAPCONF_SYNCHRONIZE_SCHED
  2245.   synchronize_sched();
  2246.   #endif
  2247.   #ifdef STAP_NEED_GETTIMEOFDAY
  2248.    _stp_kill_time();
  2249.   #endif
  2250.   _stp_runtime_contexts_free();
  2251.   return rc;
  2252. }
  2253.  
  2254.  
  2255. static void systemtap_module_refresh (void) {
  2256.   int i=0, j=0;
  2257.   (void) i;
  2258.   (void) j;
  2259.   for (i=0; i<80; i++) {
  2260.     struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2261.     struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2262.     unsigned long relocated_addr = _stp_kmodule_relocate (sdp->module, sdp->section, sdp->address);
  2263.     int rc;
  2264.     if (sdp->registered_p == 0 && relocated_addr != 0) {
  2265.       if (sdp->return_p) {
  2266.         kp->u.krp.kp.addr = (void *) relocated_addr;
  2267.         if (sdp->maxactive_p) {
  2268.           kp->u.krp.maxactive = sdp->maxactive_val;
  2269.         } else {
  2270.           kp->u.krp.maxactive = KRETACTIVE;
  2271.         }
  2272.         kp->u.krp.handler = &enter_kretprobe_probe;
  2273.         #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
  2274.         if (sdp->entry_probe) {
  2275.           kp->u.krp.entry_handler = &enter_kretprobe_entry_probe;
  2276.           kp->u.krp.data_size = sdp->saved_longs * sizeof(int64_t) +
  2277.                                 sdp->saved_strings * MAXSTRINGLEN;
  2278.         }
  2279.         #endif
  2280.         #ifdef __ia64__
  2281.         kp->dummy.addr = kp->u.krp.kp.addr;
  2282.         kp->dummy.pre_handler = NULL;
  2283.         rc = register_kprobe (& kp->dummy);
  2284.         if (rc == 0) {
  2285.           rc = register_kretprobe (& kp->u.krp);
  2286.           if (rc != 0)
  2287.             unregister_kprobe (& kp->dummy);
  2288.         }
  2289.         #else
  2290.         rc = register_kretprobe (& kp->u.krp);
  2291.         #endif
  2292.       } else {
  2293.         kp->u.kp.addr = (void *) relocated_addr;
  2294.         kp->u.kp.pre_handler = &enter_kprobe_probe;
  2295.         #ifdef __ia64__
  2296.         kp->dummy.addr = kp->u.kp.addr;
  2297.         kp->dummy.pre_handler = NULL;
  2298.         rc = register_kprobe (& kp->dummy);
  2299.         if (rc == 0) {
  2300.           rc = register_kprobe (& kp->u.kp);
  2301.           if (rc != 0)
  2302.             unregister_kprobe (& kp->dummy);
  2303.         }
  2304.         #else
  2305.         rc = register_kprobe (& kp->u.kp);
  2306.         #endif
  2307.       }
  2308.       if (rc == 0) sdp->registered_p = 1;
  2309.     } else if (sdp->registered_p == 1 && relocated_addr == 0) {
  2310.       if (sdp->return_p) {
  2311.         unregister_kretprobe (&kp->u.krp);
  2312.         atomic_add (kp->u.krp.nmissed, skipped_count());
  2313.         #ifdef STP_TIMING
  2314.         if (kp->u.krp.nmissed)
  2315.           _stp_warn ("Skipped due to missed kretprobe/1 on '%s': %d\n", sdp->probe->pp, kp->u.krp.nmissed);
  2316.         #endif
  2317.         atomic_add (kp->u.krp.kp.nmissed, skipped_count());
  2318.         #ifdef STP_TIMING
  2319.         if (kp->u.krp.kp.nmissed)
  2320.           _stp_warn ("Skipped due to missed kretprobe/2 on '%s': %lu\n", sdp->probe->pp, kp->u.krp.kp.nmissed);
  2321.         #endif
  2322.       } else {
  2323.         unregister_kprobe (&kp->u.kp);
  2324.         atomic_add (kp->u.kp.nmissed, skipped_count());
  2325.         #ifdef STP_TIMING
  2326.         if (kp->u.kp.nmissed)
  2327.           _stp_warn ("Skipped due to missed kprobe on '%s': %lu\n", sdp->probe->pp, kp->u.kp.nmissed);
  2328.         #endif
  2329.       }
  2330.       #if defined(__ia64__)
  2331.       unregister_kprobe (&kp->dummy);
  2332.       #endif
  2333.       sdp->registered_p = 0;
  2334.     }
  2335.   }
  2336. }
  2337.  
  2338.  
  2339. static void systemtap_module_exit (void) {
  2340.   int i=0, j=0;
  2341.   (void) i;
  2342.   (void) j;
  2343.   if (atomic_read (session_state()) == STAP_SESSION_STARTING)
  2344.     return;
  2345.   if (atomic_read (session_state()) == STAP_SESSION_RUNNING)
  2346.     atomic_set (session_state(), STAP_SESSION_STOPPING);
  2347.  
  2348.   /* ---- task finder ---- */
  2349.   stap_stop_task_finder();
  2350.  
  2351.   /* ---- vma tracker ---- */
  2352.   _stp_vma_done();
  2353.   #if defined(STAPCONF_UNREGISTER_KPROBES)
  2354.   j = 0;
  2355.   for (i=0; i<80; i++) {
  2356.     struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2357.     struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2358.     if (! sdp->registered_p) continue;
  2359.     if (!sdp->return_p)
  2360.       stap_unreg_kprobes[j++] = &kp->u.kp;
  2361.   }
  2362.   unregister_kprobes((struct kprobe **)stap_unreg_kprobes, j);
  2363.   j = 0;
  2364.   for (i=0; i<80; i++) {
  2365.     struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2366.     struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2367.     if (! sdp->registered_p) continue;
  2368.     if (sdp->return_p)
  2369.       stap_unreg_kprobes[j++] = &kp->u.krp;
  2370.   }
  2371.   unregister_kretprobes((struct kretprobe **)stap_unreg_kprobes, j);
  2372.   #ifdef __ia64__
  2373.   j = 0;
  2374.   for (i=0; i<80; i++) {
  2375.     struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2376.     struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2377.     if (! sdp->registered_p) continue;
  2378.     stap_unreg_kprobes[j++] = &kp->dummy;
  2379.   }
  2380.   unregister_kprobes((struct kprobe **)stap_unreg_kprobes, j);
  2381.   #endif
  2382.   #endif
  2383.   for (i=0; i<80; i++) {
  2384.     struct stap_dwarf_probe *sdp = & stap_dwarf_probes[i];
  2385.     struct stap_dwarf_kprobe *kp = & stap_dwarf_kprobes[i];
  2386.     if (! sdp->registered_p) continue;
  2387.     if (sdp->return_p) {
  2388.     #if !defined(STAPCONF_UNREGISTER_KPROBES)
  2389.       unregister_kretprobe (&kp->u.krp);
  2390.       #endif
  2391.       atomic_add (kp->u.krp.nmissed, skipped_count());
  2392.       #ifdef STP_TIMING
  2393.       if (kp->u.krp.nmissed)
  2394.         _stp_warn ("Skipped due to missed kretprobe/1 on '%s': %d\n", sdp->probe->pp, kp->u.krp.nmissed);
  2395.       #endif
  2396.       atomic_add (kp->u.krp.kp.nmissed, skipped_count());
  2397.       #ifdef STP_TIMING
  2398.       if (kp->u.krp.kp.nmissed)
  2399.         _stp_warn ("Skipped due to missed kretprobe/2 on '%s': %lu\n", sdp->probe->pp, kp->u.krp.kp.nmissed);
  2400.       #endif
  2401.     } else {
  2402.     #if !defined(STAPCONF_UNREGISTER_KPROBES)
  2403.       unregister_kprobe (&kp->u.kp);
  2404.       #endif
  2405.       atomic_add (kp->u.kp.nmissed, skipped_count());
  2406.       #ifdef STP_TIMING
  2407.       if (kp->u.kp.nmissed)
  2408.         _stp_warn ("Skipped due to missed kprobe on '%s': %lu\n", sdp->probe->pp, kp->u.kp.nmissed);
  2409.       #endif
  2410.     }
  2411.     #if !defined(STAPCONF_UNREGISTER_KPROBES) && defined(__ia64__)
  2412.     unregister_kprobe (&kp->dummy);
  2413.     #endif
  2414.     sdp->registered_p = 0;
  2415.   }
  2416.   #ifdef STAPCONF_SYNCHRONIZE_SCHED
  2417.   synchronize_sched();
  2418.   #endif
  2419.   _stp_runtime_context_wait();
  2420.   atomic_set (session_state(), STAP_SESSION_STOPPED);
  2421.   #ifdef STAPCONF_SYNCHRONIZE_SCHED
  2422.   synchronize_sched();
  2423.   #endif
  2424.   _stp_map_del (global(s_trace));
  2425.   _stp_map_del (global(s__indent_counters));
  2426.   _stp_map_del (global(s__indent_timestamps));
  2427.   _stp_runtime_contexts_free();
  2428.   #ifdef STAP_NEED_GETTIMEOFDAY
  2429.    _stp_kill_time();
  2430.   #endif
  2431.   preempt_disable();
  2432.   #if defined(STP_TIMING) || defined(STP_ALIBI)
  2433.   _stp_printf("----- probe hit report: \n");
  2434.   for (i = 0; i < ARRAY_SIZE(stap_probes); ++i) {
  2435.     const struct stap_probe *const p = &stap_probes[i];
  2436.     #ifdef STP_ALIBI
  2437.     int alibi = atomic_read(probe_alibi(i));
  2438.     if (alibi)
  2439.       _stp_printf ("%s, (%s), hits: %d,%s, index: %d\n",
  2440.           p->pp, p->location, alibi, p->derivation, i);
  2441.     #endif
  2442.     #ifdef STP_TIMING
  2443.     if (likely (probe_timing(i))) {
  2444.       struct stat_data *stats = _stp_stat_get (probe_timing(i), 0);
  2445.       if (stats->count) {
  2446.         int64_t avg = _stp_div64 (NULL, stats->sum, stats->count);
  2447.         _stp_printf ("%s, (%s), hits: %lld, cycles: %lldmin/%lldavg/%lldmax,%s, index: %d\n",
  2448.             p->pp, p->location, (long long) stats->count,
  2449.             (long long) stats->min, (long long) avg, (long long) stats->max,
  2450.             p->derivation, i);
  2451.       }
  2452.       _stp_stat_del (probe_timing(i));
  2453.     }
  2454.     #endif
  2455.   }
  2456.   _stp_print_flush();
  2457.   #endif
  2458.   if (atomic_read (skipped_count()) || atomic_read (error_count()) || atomic_read (skipped_count_reentrant())) {
  2459.     _stp_warn ("Number of errors: %d, skipped probes: %d\n", (int) atomic_read (error_count()), (int) atomic_read (skipped_count()));
  2460.     #ifdef STP_TIMING
  2461.     {
  2462.       int ctr;
  2463.       ctr = atomic_read (global_skipped(s_trace));
  2464.       if (ctr) _stp_warn ("Skipped due to global '%s' lock timeout: %d\n", "trace", ctr);
  2465.       ctr = atomic_read (global_skipped(s__indent_counters));
  2466.       if (ctr) _stp_warn ("Skipped due to global '%s' lock timeout: %d\n", "_indent_counters", ctr);
  2467.       ctr = atomic_read (global_skipped(s__indent_timestamps));
  2468.       if (ctr) _stp_warn ("Skipped due to global '%s' lock timeout: %d\n", "_indent_timestamps", ctr);
  2469.       ctr = atomic_read (skipped_count_lowstack());
  2470.       if (ctr) _stp_warn ("Skipped due to low stack: %d\n", ctr);
  2471.       ctr = atomic_read (skipped_count_reentrant());
  2472.       if (ctr) _stp_warn ("Skipped due to reentrancy: %d\n", ctr);
  2473.       ctr = atomic_read (skipped_count_uprobe_reg());
  2474.       if (ctr) _stp_warn ("Skipped due to uprobe register failure: %d\n", ctr);
  2475.       ctr = atomic_read (skipped_count_uprobe_unreg());
  2476.       if (ctr) _stp_warn ("Skipped due to uprobe unregister failure: %d\n", ctr);
  2477.     }
  2478.     #endif
  2479.     _stp_print_flush();
  2480.   }
  2481.   preempt_enable_no_resched();
  2482. }
  2483.  
  2484.  
  2485. static int systemtap_kernel_module_init (void) {
  2486.   int rc = 0;
  2487.   int i=0, j=0;
  2488.   if (rc) {
  2489.     goto out;
  2490.   }
  2491.   if (rc) {
  2492.     goto out;
  2493.   }
  2494. out:
  2495.   return rc;
  2496. }
  2497.  
  2498.  
  2499. static void systemtap_kernel_module_exit (void) {
  2500.   int i=0, j=0;
  2501. }
  2502.  
  2503.  
  2504. #include "stap-symbols.h"
  2505. MODULE_DESCRIPTION("systemtap-generated probe");
  2506. MODULE_LICENSE("GPL");
  2507. MODULE_INFO(intree,"Y");
  2508.  
  2509. #undef trace
  2510.  
  2511. #undef _indent_counters
  2512.  
  2513. #undef _indent_timestamps
  2514. root@linaro-developer:~/systemtap-2.2.1/testsuite#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement