[kgtp] r971 committed - Update patch for some build bug.

  • From: kgtp@xxxxxxxxxxxxxx
  • To: kgtp@xxxxxxxxxxxxx
  • Date: Sun, 18 Mar 2012 07:16:03 +0000

Revision: 971
Author:   teawater
Date:     Sun Mar 18 00:15:37 2012
Log:      Update patch for some build bug.

http://code.google.com/p/kgtp/source/detail?r=971

Modified:
 /trunk/gtp_for_review.patch

=======================================
--- /trunk/gtp_for_review.patch Mon Mar 12 06:54:29 2012
+++ /trunk/gtp_for_review.patch Sun Mar 18 00:15:37 2012
@@ -8,12 +8,12 @@
  kernel/events/core.c             |   14
  lib/Kconfig.debug                |   10
  lib/Makefile                     |    4
- lib/gtp.c | 8867 +++++++++++++++++++++++++++++++++++++++ + lib/gtp.c | 8920 +++++++++++++++++++++++++++++++++++++++
  lib/gtp_rb.c                     |  498 ++
  scripts/gtp/add-ons/pe.py        |  729 +++
  scripts/gtp/getgtprsp.pl         |  137
  scripts/gtp/getmod.py            |  132
- 14 files changed, 12210 insertions(+), 2 deletions(-)
+ 14 files changed, 12263 insertions(+), 2 deletions(-)

 --- /dev/null
 +++ b/Documentation/gtp/howto.txt
@@ -1952,7 +1952,7 @@
 +gtp.o: gtp_rb.c
 --- /dev/null
 +++ b/lib/gtp.c
-@@ -0,0 +1,8867 @@
+@@ -0,0 +1,8920 @@
 +/*
 + * Kernel GDB tracepoint module.
 + *
@@ -2280,7 +2280,7 @@
 +      .num            = GTP_VAR_VERSION_ID,
 +      .src            = "0:1:6774705f76657273696f6e",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2293,7 +2293,7 @@
 +      .num            = GTP_VAR_CPU_ID,
 +      .src            = "0:1:6370755f6964",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2306,7 +2306,7 @@
 +      .num            = GTP_VAR_CURRENT_TASK_ID,
 +      .src            = "0:1:63757272656e745f7461736b",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2319,7 +2319,7 @@
 +      .num            = GTP_VAR_CURRENT_TASK_PID_ID,
 +      .src            = "0:1:63757272656e745f7461736b5f706964",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2332,7 +2332,7 @@
 +      .num            = GTP_VAR_CURRENT_THREAD_INFO_ID,
 +      .src            = "0:1:63757272656e745f7468726561645f696e666f",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2345,7 +2345,7 @@
 +      .num            = GTP_VAR_CLOCK_ID,
 +      .src            = "0:1:636c6f636b",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2358,7 +2358,7 @@
 +      .num            = GTP_VAR_COOKED_CLOCK_ID,
 +      .src            = "0:1:636f6f6b65645f636c6f636b",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2372,7 +2372,7 @@
 +      .num            = GTP_VAR_RDTSC_ID,
 +      .src            = "0:1:7264747363",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2384,7 +2384,7 @@
 +      .num            = GTP_VAR_COOKED_RDTSC_ID,
 +      .src            = "0:1:636f6f6b65645f7264747363",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2399,7 +2399,7 @@
 +      .num            = GTP_VAR_GTP_RB_DISCARD_PAGE_NUMBER,
 +      .src            = "0:1:646973636172645f706167655f6e756d",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2413,7 +2413,7 @@
 +      .num            = GTP_VAR_PRINTK_TMP_ID,
 +      .src            = "0:1:7072696e746b5f746d70",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2426,7 +2426,7 @@
 +      .num            = GTP_VAR_PRINTK_LEVEL_ID,
 +      .src            = "8:1:7072696e746b5f6c6576656c",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2439,7 +2439,7 @@
 +      .num            = GTP_VAR_PRINTK_FORMAT_ID,
 +      .src            = "0:1:7072696e746b5f666f726d6174",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2452,7 +2452,7 @@
 +      .num            = GTP_VAR_DUMP_STACK_ID,
 +      .src            = "0:1:64756d705f737461636b",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2465,7 +2465,7 @@
 +      .num            = GTP_VAR_NO_SELF_TRACE_ID,
 +      .src            = "0:1:6e6f5f73656c665f7472616365",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2478,7 +2478,7 @@
 +      .num            = GTP_VAR_PIPE_TRACE_ID,
 +      .src            = "0:1:706970655f7472616365",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2491,7 +2491,7 @@
 +      .num            = GTP_VAR_CPU_NUMBER_ID,
 +      .src            = "0:1:6370755f6e756d626572",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2504,7 +2504,7 @@
 +      .num            = GTP_VAR_PC_PE_EN_ID,
 +      .src            = "0:1:70635f70655f656e",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2517,7 +2517,7 @@
 +      .num            = GTP_VAR_KRET_ID,
 +      .src            = "0:1:6b726574",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2530,7 +2530,7 @@
 +      .num            = GTP_VAR_XTIME_SEC_ID,
 +      .src            = "0:1:7874696d655f736563",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2543,7 +2543,7 @@
 +      .num            = GTP_VAR_XTIME_NSEC_ID,
 +      .src            = "0:1:7874696d655f6e736563",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2556,7 +2556,7 @@
 +      .num            = GTP_VAR_IGNORE_ERROR_ID,
 +      .src            = "0:1:69676e6f72655f6572726f72",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2569,7 +2569,7 @@
 +      .num            = GTP_VAR_LAST_ERRNO_ID,
 +      .src            = "0:1:6c6173745f6572726e6f",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2582,7 +2582,7 @@
 +      .num            = GTP_VAR_HARDIRQ_COUNT_ID,
 +      .src            = "0:1:686172646972715f636f756e74",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2595,7 +2595,7 @@
 +      .num            = GTP_VAR_SOFTIRQ_COUNT_ID,
 +      .src            = "0:1:736f66746972715f636f756e74",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -2608,7 +2608,7 @@
 +      .num            = GTP_VAR_IRQ_COUNT_ID,
 +      .src            = "0:1:6972715f636f756e74",
 +      .per_cpu        = NULL,
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      .ptid           = 0,
 +      .pts            = NULL,
 +#endif
@@ -4196,7 +4196,7 @@
 +uint64_t
 +gtp_get_var(struct gtp_trace_s *gts, struct gtp_var *tve)
 +{
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +      if (tve->ptid == pe_tv_val || tve->ptid == pe_tv_enabled
 +          || tve->ptid == pe_tv_running) {
 +              tve->pts->val = perf_event_read_value(tve->pts->event,
@@ -4221,6 +4221,59 @@
 +
 +      return tve->val;
 +}
++
++static int
++gtp_collect_var(struct gtp_trace_s *gts, struct gtp_var *tve)
++{
++      struct gtp_frame_var            *fvar;
++      char                            *tmp;
++#ifdef GTP_FTRACE_RING_BUFFER
++      struct ring_buffer_event        *rbe;
++#endif
++
++      if (gts->next == NULL) {
++              if (gtp_action_head(gts))
++                      return -1;
++      }
++
++#ifdef GTP_FTRACE_RING_BUFFER
++      GTP_FRAME_RINGBUFFER_ALLOC(GTP_FRAME_VAR_SIZE);
++#endif
++#if defined(GTP_FRAME_SIMPLE) || defined(GTP_RB)
++#ifdef GTP_RB
++      tmp = gtp_rb_alloc(gts->next, GTP_FRAME_VAR_SIZE, gts->id);
++#endif
++#ifdef GTP_FRAME_SIMPLE
++      tmp = gtp_frame_alloc(GTP_FRAME_VAR_SIZE);
++#endif
++      if (!tmp) {
++              gts->tpe->reason = gtp_stop_frame_full;
++              return -1;
++      }
++#ifdef GTP_FRAME_SIMPLE
++      *gts->next = tmp;
++#endif
++#endif
++
++      FID(tmp) = FID_VAR;
++      tmp += FID_SIZE;
++
++#ifdef GTP_FRAME_SIMPLE
++      gts->next = (char **)tmp;
++      *gts->next = NULL;
++      tmp += sizeof(char *);
++#endif
++
++      fvar = (struct gtp_frame_var *) tmp;
++      fvar->num = tve->num;
++      fvar->val = gtp_get_var(gts, tve);
++
++#ifdef GTP_FTRACE_RING_BUFFER
++      ring_buffer_unlock_commit(gtp_frame, rbe);
++#endif
++
++      return 0;
++}
 +
 +#define STACK_MAX     32
 +static DEFINE_PER_CPU(ULONGEST[STACK_MAX], action_x_stack);
@@ -4747,12 +4800,12 @@
 +                              arg = (arg << 8) + ebuf[pc++];
 +
 +                              tve = gtp_gtp_var_array_find(arg);
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +                              if (tve->ptid == pe_tv_en)
 +                                      gtp_pe_set_en(tve->pts, (int)top);
 +                              else if (tve->ptid == pe_tv_val)
-+                                      gtp_perf_event_set(tve->pts->event,
-+                                                         (u64)top);
++                                      perf_event_set(tve->pts->event,
++                                                      (u64)top);
 +#endif
 +                              tve->val = (uint64_t)top;
 +                      }
@@ -6967,7 +7020,7 @@
 +#ifdef CONFIG_X86
 +                                  || gtp_access_cooked_rdtsc
 +#endif
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +                                  || gtp_have_pc_pe
 +#endif
 +                              )
@@ -6981,7 +7034,7 @@
 +#ifdef CONFIG_X86
 +                                  || gtp_access_cooked_rdtsc
 +#endif
-+#ifdef GTP_PERF_EVENTS
++#ifdef CONFIG_PERF_EVENTS
 +                                  || gtp_have_pc_pe
 +#endif
 +                              ) {

Other related posts:

  • » [kgtp] r971 committed - Update patch for some build bug. - kgtp