Home | History | Annotate | Download | only in linux-tools-perf
      1 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/arch/arm/util/dwarf-regs.c ./arch/arm/util/dwarf-regs.c
      2 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/arch/arm/util/dwarf-regs.c	2011-12-09 13:14:49.000000000 -0800
      3 +++ ./arch/arm/util/dwarf-regs.c	2012-03-22 17:08:09.000000000 -0700
      4 @@ -8,8 +8,15 @@
      5   * published by the Free Software Foundation.
      6   */
      7  
      8 +/* ANDROID_CHANGE_BEGIN */
      9 +#if 0
     10  #include <libio.h>
     11  #include <dwarf-regs.h>
     12 +#else
     13 +#include <stdio.h>
     14 +#include "util/include/dwarf-regs.h"
     15 +#endif
     16 +/* ANDROID_CHANGE_END */
     17  
     18  struct pt_regs_dwarfnum {
     19  	const char *name;
     20 @@ -20,7 +27,7 @@
     21  #define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num}
     22  #define GPR_DWARFNUM_NAME(num) \
     23  	{.name = STR(%r##num), .dwarfnum = num}
     24 -#define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0}
     25 +#define REG_DWARFNUM_END {.name = 0, .dwarfnum = 0}
     26  
     27  /*
     28   * Reference:
     29 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/arch/x86/util/dwarf-regs.c ./arch/x86/util/dwarf-regs.c
     30 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/arch/x86/util/dwarf-regs.c	2011-12-09 13:14:49.000000000 -0800
     31 +++ ./arch/x86/util/dwarf-regs.c	2012-03-22 17:08:09.000000000 -0700
     32 @@ -21,7 +21,13 @@
     33   */
     34  
     35  #include <libio.h>
     36 +/* ANDROID_CHANGE_BEGIN */
     37 +#if 0
     38  #include <dwarf-regs.h>
     39 +#else
     40 +#include "util/include/dwarf-regs.h"
     41 +#endif
     42 +/* ANDROID_CHANGE_END */
     43  
     44  /*
     45   * Generic dwarf analysis helpers
     46 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/bench/mem-memcpy.c ./bench/mem-memcpy.c
     47 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/bench/mem-memcpy.c	2011-12-09 13:14:50.000000000 -0800
     48 +++ ./bench/mem-memcpy.c	2012-03-22 17:08:09.000000000 -0700
     49 @@ -146,9 +146,9 @@
     50  	if (prefault)
     51  		fn(dst, src, len);
     52  
     53 -	BUG_ON(gettimeofday(&tv_start, NULL));
     54 +	gettimeofday(&tv_start, NULL);
     55  	fn(dst, src, len);
     56 -	BUG_ON(gettimeofday(&tv_end, NULL));
     57 +	gettimeofday(&tv_end, NULL);
     58  
     59  	timersub(&tv_end, &tv_start, &tv_diff);
     60  
     61 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/bench/sched-messaging.c ./bench/sched-messaging.c
     62 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/bench/sched-messaging.c	2011-12-09 13:14:50.000000000 -0800
     63 +++ ./bench/sched-messaging.c	2012-03-22 17:08:09.000000000 -0700
     64 @@ -16,6 +16,11 @@
     65  #include "bench.h"
     66  
     67  /* Test groups of 20 processes spraying to 20 receivers */
     68 +/* ANDROID_CHANGE_BEGIN */
     69 +#ifdef __BIONIC__
     70 +#include <asm/page.h>
     71 +#endif
     72 +/* ANDROID_CHANGE_END */
     73  #include <pthread.h>
     74  #include <stdio.h>
     75  #include <stdlib.h>
     76 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/bench/sched-pipe.c ./bench/sched-pipe.c
     77 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/bench/sched-pipe.c	2011-12-09 13:14:50.000000000 -0800
     78 +++ ./bench/sched-pipe.c	2012-03-22 17:08:09.000000000 -0700
     79 @@ -45,6 +45,8 @@
     80  int bench_sched_pipe(int argc, const char **argv,
     81  		     const char *prefix __used)
     82  {
     83 +        /* ANDROID_CHANGE_BEGIN */
     84 +#ifndef __BIONIC__
     85  	int pipe_1[2], pipe_2[2];
     86  	int m = 0, i;
     87  	struct timeval start, stop, diff;
     88 @@ -122,6 +124,8 @@
     89  		exit(1);
     90  		break;
     91  	}
     92 +#endif
     93 +        /* ANDROID_CHANGE_END */
     94  
     95  	return 0;
     96  }
     97 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-annotate.c ./builtin-annotate.c
     98 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-annotate.c	2011-12-09 13:14:50.000000000 -0800
     99 +++ ./builtin-annotate.c	2012-03-22 17:08:09.000000000 -0700
    100 @@ -9,9 +9,17 @@
    101  
    102  #include "util/util.h"
    103  #include "util/color.h"
    104 +/* ANDROID_CHANGE_BEGIN */
    105 +#if 0
    106  #include <linux/list.h>
    107  #include "util/cache.h"
    108  #include <linux/rbtree.h>
    109 +#else
    110 +#include "util/include/linux/list.h"
    111 +#include "util/cache.h"
    112 +#include "util/include/linux/rbtree.h"
    113 +#endif
    114 +/* ANDROID_CHANGE_END */
    115  #include "util/symbol.h"
    116  
    117  #include "perf.h"
    118 @@ -252,6 +260,10 @@
    119  		    "print matching source lines (may be slow)"),
    120  	OPT_BOOLEAN('P', "full-paths", &full_paths,
    121  		    "Don't shorten the displayed pathnames"),
    122 +        /* ANDROID_CHANGE_BEGIN */
    123 +	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
    124 +		    "Look for files with symbols relative to this directory"),
    125 +        /* ANDROID_CHANGE_END */
    126  	OPT_END()
    127  };
    128  
    129 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-evlist.c ./builtin-evlist.c
    130 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-evlist.c	2011-12-09 13:14:50.000000000 -0800
    131 +++ ./builtin-evlist.c	2012-03-22 17:08:09.000000000 -0700
    132 @@ -6,7 +6,13 @@
    133  
    134  #include "util/util.h"
    135  
    136 +/* ANDROID_CHANGE_BEGIN */
    137 +#if 0
    138  #include <linux/list.h>
    139 +#else
    140 +#include "util/include/linux/list.h"
    141 +#endif
    142 +/* ANDROID_CHANGE_END */
    143  
    144  #include "perf.h"
    145  #include "util/evlist.h"
    146 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-kmem.c ./builtin-kmem.c
    147 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-kmem.c	2011-12-09 13:14:50.000000000 -0800
    148 +++ ./builtin-kmem.c	2012-03-22 17:08:09.000000000 -0700
    149 @@ -13,7 +13,13 @@
    150  
    151  #include "util/debug.h"
    152  
    153 +/* ANDROID_CHANGE_BEGIN */
    154 +#if 0
    155  #include <linux/rbtree.h>
    156 +#else
    157 +#include "util/include/linux/rbtree.h"
    158 +#endif
    159 +/* ANDROID_CHANGE_END */
    160  
    161  struct alloc_stat;
    162  typedef int (*sort_fn_t)(struct alloc_stat *, struct alloc_stat *);
    163 @@ -775,4 +781,3 @@
    164  
    165  	return 0;
    166  }
    167 -
    168 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-lock.c ./builtin-lock.c
    169 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-lock.c	2011-12-09 13:14:50.000000000 -0800
    170 +++ ./builtin-lock.c	2012-03-22 17:08:09.000000000 -0700
    171 @@ -20,8 +20,15 @@
    172  #include <math.h>
    173  #include <limits.h>
    174  
    175 +/* ANDROID_CHANGE_BEGIN */
    176 +#if 0
    177  #include <linux/list.h>
    178  #include <linux/hash.h>
    179 +#else
    180 +#include "util/include/linux/list.h"
    181 +#include "util/include/linux/hash.h"
    182 +#endif
    183 +/* ANDROID_CHANGE_END */
    184  
    185  static struct perf_session *session;
    186  
    187 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-record.c ./builtin-record.c
    188 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-record.c	2011-12-09 13:14:50.000000000 -0800
    189 +++ ./builtin-record.c	2012-03-22 17:08:09.000000000 -0700
    190 @@ -464,7 +464,13 @@
    191  		if (!fstat(STDOUT_FILENO, &st) && S_ISFIFO(st.st_mode))
    192  			pipe_output = 1;
    193  		else
    194 +                        /* ANDROID_CHANGE_BEGIN */
    195 +#ifdef __BIONIC__
    196 +			output_name = "/data/perf.data";
    197 +#else
    198  			output_name = "perf.data";
    199 +#endif
    200 +                        /* ANDROID_CHANGE_END */
    201  	}
    202  	if (output_name) {
    203  		if (!strcmp(output_name, "-"))
    204 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-report.c ./builtin-report.c
    205 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-report.c	2011-12-09 13:14:50.000000000 -0800
    206 +++ ./builtin-report.c	2012-03-22 17:08:09.000000000 -0700
    207 @@ -11,9 +11,17 @@
    208  
    209  #include "util/annotate.h"
    210  #include "util/color.h"
    211 +/* ANDROID_CHANGE_BEGIN */
    212 +#if 0
    213  #include <linux/list.h>
    214  #include "util/cache.h"
    215  #include <linux/rbtree.h>
    216 +#else
    217 +#include "util/include/linux/list.h"
    218 +#include "util/cache.h"
    219 +#include "util/include/linux/rbtree.h"
    220 +#endif
    221 +/* ANDROID_CHANGE_END */
    222  #include "util/symbol.h"
    223  #include "util/callchain.h"
    224  #include "util/strlist.h"
    225 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-sched.c ./builtin-sched.c
    226 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-sched.c	2011-12-09 13:14:50.000000000 -0800
    227 +++ ./builtin-sched.c	2012-03-22 17:08:09.000000000 -0700
    228 @@ -16,6 +16,12 @@
    229  #include <sys/prctl.h>
    230  
    231  #include <semaphore.h>
    232 +/* ANDROID_CHANGE_BEGIN */
    233 +#ifdef __BIONIC__
    234 +/* PTHREAD_STACK_MIN is defined as (2 * PAGE_SIZE) */
    235 +#include <asm/page.h>
    236 +#endif
    237 +/* ANDROID_CHANGE_END */
    238  #include <pthread.h>
    239  #include <math.h>
    240  
    241 @@ -473,6 +479,11 @@
    242  	BUG_ON(ret);
    243  
    244  	goto again;
    245 +        /* ANDROID_CHANGE_BEGIN */
    246 +#ifdef __BIONIC__
    247 +        return NULL;
    248 +#endif
    249 +        /* ANDROID_CHANGE_END */
    250  }
    251  
    252  static void create_tasks(void)
    253 @@ -484,8 +495,15 @@
    254  
    255  	err = pthread_attr_init(&attr);
    256  	BUG_ON(err);
    257 +        /* ANDROID_CHANGE_BEGIN */
    258 +#if 0
    259  	err = pthread_attr_setstacksize(&attr,
    260  			(size_t) max(16 * 1024, PTHREAD_STACK_MIN));
    261 +#else
    262 +	err = pthread_attr_setstacksize(&attr,
    263 +			(size_t) max((unsigned) 16 * 1024, (unsigned) PTHREAD_STACK_MIN));
    264 +#endif
    265 +        /* ANDROID_CHANGE_END */
    266  	BUG_ON(err);
    267  	err = pthread_mutex_lock(&start_work_mutex);
    268  	BUG_ON(err);
    269 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-stat.c ./builtin-stat.c
    270 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-stat.c	2011-12-09 13:14:50.000000000 -0800
    271 +++ ./builtin-stat.c	2012-03-22 17:08:09.000000000 -0700
    272 @@ -743,7 +743,14 @@
    273  	if (csv_output)
    274  		fmt = "%s%.0f%s%s";
    275  	else if (big_num)
    276 +                /* ANDROID_CHANGE_BEGIN */
    277 +#ifdef __BIONIC__
    278 +                /* bionic doesn't like "'" */
    279 +		fmt = "%s%18.0f%s%-25s";
    280 +#else
    281  		fmt = "%s%'18.0f%s%-25s";
    282 +#endif
    283 +                /* ANDROID_CHANGE_END */
    284  	else
    285  		fmt = "%s%18.0f%s%-25s";
    286  
    287 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-test.c ./builtin-test.c
    288 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-test.c	2011-12-09 13:14:50.000000000 -0800
    289 +++ ./builtin-test.c	2012-03-22 17:08:09.000000000 -0700
    290 @@ -453,6 +453,10 @@
    291   */
    292  static int test__basic_mmap(void)
    293  {
    294 +        /* ANDROID_CHANGE_BEGIN */
    295 +#ifdef __BIONIC__
    296 +        return 0;
    297 +#else
    298  	int err = -1;
    299  	union perf_event *event;
    300  	struct thread_map *threads;
    301 @@ -598,6 +602,8 @@
    302  	thread_map__delete(threads);
    303  	return err;
    304  #undef nsyscalls
    305 +#endif
    306 +        /* ANDROID_CHANGE_END */
    307  }
    308  
    309  static struct test {
    310 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-timechart.c ./builtin-timechart.c
    311 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-timechart.c	2011-12-09 13:14:50.000000000 -0800
    312 +++ ./builtin-timechart.c	2012-03-22 17:08:09.000000000 -0700
    313 @@ -17,9 +17,17 @@
    314  #include "util/util.h"
    315  
    316  #include "util/color.h"
    317 +/* ANDROID_CHANGE_BEGIN */
    318 +#if 0
    319  #include <linux/list.h>
    320  #include "util/cache.h"
    321  #include <linux/rbtree.h>
    322 +#else
    323 +#include "util/include/linux/list.h"
    324 +#include "util/cache.h"
    325 +#include "util/include/linux/rbtree.h"
    326 +#endif
    327 +/* ANDROID_CHANGE_END */
    328  #include "util/symbol.h"
    329  #include "util/callchain.h"
    330  #include "util/strlist.h"
    331 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-top.c ./builtin-top.c
    332 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/builtin-top.c	2011-12-09 13:14:50.000000000 -0800
    333 +++ ./builtin-top.c	2012-03-22 17:08:09.000000000 -0700
    334 @@ -31,7 +31,13 @@
    335  #include "util/thread_map.h"
    336  #include "util/top.h"
    337  #include "util/util.h"
    338 +/* ANDROID_CHANGE_BEGIN */
    339 +#if 0
    340  #include <linux/rbtree.h>
    341 +#else
    342 +#include "util/include/linux/rbtree.h"
    343 +#endif
    344 +/* ANDROID_CHANGE_END */
    345  #include "util/parse-options.h"
    346  #include "util/parse-events.h"
    347  #include "util/cpumap.h"
    348 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/perf.h ./perf.h
    349 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/perf.h	2011-12-09 13:14:50.000000000 -0800
    350 +++ ./perf.h	2012-03-22 17:08:09.000000000 -0700
    351 @@ -6,7 +6,13 @@
    352  void get_term_dimensions(struct winsize *ws);
    353  
    354  #if defined(__i386__)
    355 +/* ANDROID_CHANGE_BEGIN */
    356 +#if 0
    357  #include "../../arch/x86/include/asm/unistd.h"
    358 +#else
    359 +#include <asm/unistd.h>
    360 +#endif
    361 +/* ANDROID_CHANGE_END */
    362  #define rmb()		asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
    363  #define cpu_relax()	asm volatile("rep; nop" ::: "memory");
    364  #endif
    365 @@ -64,7 +70,13 @@
    366  #endif
    367  
    368  #ifdef __arm__
    369 +/* ANDROID_CHANGE_BEGIN */
    370 +#if 0
    371  #include "../../arch/arm/include/asm/unistd.h"
    372 +#else
    373 +#include <asm/unistd.h>
    374 +#endif
    375 +/* ANDROID_CHANGE_END */
    376  /*
    377   * Use the __kuser_memory_barrier helper in the CPU helper page. See
    378   * arch/arm/kernel/entry-armv.S in the kernel source for details.
    379 @@ -88,9 +100,16 @@
    380  #include <time.h>
    381  #include <unistd.h>
    382  #include <sys/types.h>
    383 +
    384  #include <sys/syscall.h>
    385  
    386 +/* ANDROID_CHANGE_BEGIN */
    387 +#if 0
    388  #include "../../include/linux/perf_event.h"
    389 +#else
    390 +#include "util/include/linux/added/perf_event.h"
    391 +#endif
    392 +/* ANDROID_CHANGE_END */
    393  #include "util/types.h"
    394  #include <stdbool.h>
    395  
    396 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/annotate.c ./util/annotate.c
    397 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/annotate.c	2011-12-09 13:14:50.000000000 -0800
    398 +++ ./util/annotate.c	2012-03-22 17:08:10.000000000 -0700
    399 @@ -322,12 +322,23 @@
    400  	pr_debug("annotating [%p] %30s : [%p] %30s\n",
    401  		 dso, dso->long_name, sym, sym->name);
    402  
    403 +        /* ANDROID_CHANGE_BEGIN */
    404 +#if 0
    405  	snprintf(command, sizeof(command),
    406  		 "objdump --start-address=0x%016" PRIx64
    407  		 " --stop-address=0x%016" PRIx64 " -dS -C %s|grep -v %s|expand",
    408  		 map__rip_2objdump(map, sym->start),
    409  		 map__rip_2objdump(map, sym->end),
    410  		 symfs_filename, filename);
    411 +#else
    412 +	snprintf(command, sizeof(command),
    413 +		 "arm-eabi-objdump --start-address=0x%016" PRIx64
    414 +		 " --stop-address=0x%016" PRIx64 " -d -C %s|grep -v %s|expand",
    415 +		 map__rip_2objdump(map, sym->start),
    416 +		 map__rip_2objdump(map, sym->end),
    417 +		 symfs_filename, filename);
    418 +#endif
    419 +        /* ANDROID_CHANGE_END */
    420  
    421  	pr_debug("Executing: %s\n", command);
    422  
    423 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/annotate.h ./util/annotate.h
    424 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/annotate.h	2011-12-09 13:14:50.000000000 -0800
    425 +++ ./util/annotate.h	2012-03-22 17:08:10.000000000 -0700
    426 @@ -4,8 +4,18 @@
    427  #include <stdbool.h>
    428  #include "types.h"
    429  #include "symbol.h"
    430 +/* ANDROID_CHANGE_BEGIN */
    431 +#if 0
    432  #include <linux/list.h>
    433  #include <linux/rbtree.h>
    434 +#else
    435 +#include "include/linux/list.h"
    436 +#include "include/linux/rbtree.h"
    437 +#ifdef __BIONIC__
    438 +#include <pthread.h>
    439 +#endif
    440 +#endif
    441 +/* ANDROID_CHANGE_END */
    442  
    443  struct objdump_line {
    444  	struct list_head node;
    445 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/bitmap.c ./util/bitmap.c
    446 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/bitmap.c	2011-12-09 13:14:50.000000000 -0800
    447 +++ ./util/bitmap.c	2012-03-22 17:08:10.000000000 -0700
    448 @@ -5,7 +5,13 @@
    449   * This source code is licensed under the GNU General Public License,
    450   * Version 2.  See the file COPYING for more details.
    451   */
    452 +/* ANDROID_CHANGE_BEGIN */
    453 +#if 0
    454  #include <linux/bitmap.h>
    455 +#else
    456 +#include "include/linux/bitmap.h"
    457 +#endif
    458 +/* ANDROID_CHANGE_END */
    459  
    460  int __bitmap_weight(const unsigned long *bitmap, int bits)
    461  {
    462 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/callchain.h ./util/callchain.h
    463 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/callchain.h	2011-12-09 13:14:50.000000000 -0800
    464 +++ ./util/callchain.h	2012-03-22 17:08:10.000000000 -0700
    465 @@ -2,8 +2,15 @@
    466  #define __PERF_CALLCHAIN_H
    467  
    468  #include "../perf.h"
    469 +/* ANDROID_CHANGE_BEGIN */
    470 +#if 0
    471  #include <linux/list.h>
    472  #include <linux/rbtree.h>
    473 +#else
    474 +#include "include/linux/list.h"
    475 +#include "include/linux/rbtree.h"
    476 +#endif
    477 +/* ANDROID_CHANGE_END */
    478  #include "event.h"
    479  #include "symbol.h"
    480  
    481 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/event.c ./util/event.c
    482 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/event.c	2011-12-09 13:14:50.000000000 -0800
    483 +++ ./util/event.c	2012-03-22 17:08:10.000000000 -0700
    484 @@ -91,7 +91,13 @@
    485  	}
    486  
    487  	event->comm.header.type = PERF_RECORD_COMM;
    488 +        /* ANDROID_CHANGE_BEGIN */
    489 +#ifdef __BIONIC__
    490 +	size = KERNEL_ALIGN(size, sizeof(u64));
    491 +#else
    492  	size = ALIGN(size, sizeof(u64));
    493 +#endif
    494 +        /* ANDROID_CHANGE_END */
    495  	memset(event->comm.comm + size, 0, session->id_hdr_size);
    496  	event->comm.header.size = (sizeof(event->comm) -
    497  				(sizeof(event->comm.comm) - size) +
    498 @@ -184,7 +190,13 @@
    499  			size = strlen(execname);
    500  			execname[size - 1] = '\0'; /* Remove \n */
    501  			memcpy(event->mmap.filename, execname, size);
    502 +                        /* ANDROID_CHANGE_BEGIN */
    503 +#ifdef __BIONIC__
    504 +			size = KERNEL_ALIGN(size, sizeof(u64));
    505 +#else
    506  			size = ALIGN(size, sizeof(u64));
    507 +#endif
    508 +                        /* ANDROID_CHANGE_END */
    509  			event->mmap.len -= event->mmap.start;
    510  			event->mmap.header.size = (sizeof(event->mmap) -
    511  					        (sizeof(event->mmap.filename) - size));
    512 @@ -234,7 +246,13 @@
    513  		if (pos->dso->kernel)
    514  			continue;
    515  
    516 +                /* ANDROID_CHANGE_BEGIN */
    517 +#ifdef __BIONIC__
    518 +		size = KERNEL_ALIGN(pos->dso->long_name_len + 1, sizeof(u64));
    519 +#else
    520  		size = ALIGN(pos->dso->long_name_len + 1, sizeof(u64));
    521 +#endif
    522 +                /* ANDROID_CHANGE_END */
    523  		event->mmap.header.type = PERF_RECORD_MMAP;
    524  		event->mmap.header.size = (sizeof(event->mmap) -
    525  				        (sizeof(event->mmap.filename) - size));
    526 @@ -409,7 +427,13 @@
    527  	map = machine->vmlinux_maps[MAP__FUNCTION];
    528  	size = snprintf(event->mmap.filename, sizeof(event->mmap.filename),
    529  			"%s%s", mmap_name, symbol_name) + 1;
    530 +        /* ANDROID_CHANGE_BEGIN */
    531 +#ifdef __BIONIC__
    532 +	size = KERNEL_ALIGN(size, sizeof(u64));
    533 +#else
    534  	size = ALIGN(size, sizeof(u64));
    535 +#endif
    536 +        /* ANDROID_CHANGE_END */
    537  	event->mmap.header.type = PERF_RECORD_MMAP;
    538  	event->mmap.header.size = (sizeof(event->mmap) -
    539  			(sizeof(event->mmap.filename) - size) + session->id_hdr_size);
    540 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/event.h ./util/event.h
    541 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/event.h	2011-12-09 13:14:50.000000000 -0800
    542 +++ ./util/event.h	2012-03-22 17:08:10.000000000 -0700
    543 @@ -87,7 +87,13 @@
    544  struct build_id_event {
    545  	struct perf_event_header header;
    546  	pid_t			 pid;
    547 +        /* ANDROID_CHANGE_BEGIN */
    548 +#ifdef __BIONIC__
    549 +	u8			 build_id[KERNEL_ALIGN(BUILD_ID_SIZE, sizeof(u64))];
    550 +#else
    551  	u8			 build_id[ALIGN(BUILD_ID_SIZE, sizeof(u64))];
    552 +#endif
    553 +        /* ANDROID_CHANGE_END */
    554  	char			 filename[];
    555  };
    556  
    557 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/evlist.c ./util/evlist.c
    558 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/evlist.c	2011-12-09 13:14:50.000000000 -0800
    559 +++ ./util/evlist.c	2012-03-22 17:08:10.000000000 -0700
    560 @@ -15,8 +15,15 @@
    561  
    562  #include <sys/mman.h>
    563  
    564 +/* ANDROID_CHANGE_BEGIN */
    565 +#if 0
    566  #include <linux/bitops.h>
    567  #include <linux/hash.h>
    568 +#else
    569 +#include "include/linux/bitops.h"
    570 +#include "include/linux/hash.h"
    571 +#endif
    572 +/* ANDROID_CHANGE_END */
    573  
    574  #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
    575  #define SID(e, x, y) xyarray__entry(e->sample_id, x, y)
    576 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/evlist.h ./util/evlist.h
    577 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/evlist.h	2011-12-09 13:14:50.000000000 -0800
    578 +++ ./util/evlist.h	2012-03-22 17:08:10.000000000 -0700
    579 @@ -1,7 +1,13 @@
    580  #ifndef __PERF_EVLIST_H
    581  #define __PERF_EVLIST_H 1
    582  
    583 +/* ANDROID_CHANGE_BEGIN */
    584 +#if 0
    585  #include <linux/list.h>
    586 +#else
    587 +#include "include/linux/list.h"
    588 +#endif
    589 +/* ANDROID_CHANGE_END */
    590  #include "../perf.h"
    591  #include "event.h"
    592  
    593 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/evsel.h ./util/evsel.h
    594 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/evsel.h	2011-12-09 13:14:50.000000000 -0800
    595 +++ ./util/evsel.h	2012-03-22 17:08:10.000000000 -0700
    596 @@ -1,9 +1,17 @@
    597  #ifndef __PERF_EVSEL_H
    598  #define __PERF_EVSEL_H 1
    599  
    600 +/* ANDROID_CHANGE_BEGIN */
    601 +#if 0
    602  #include <linux/list.h>
    603  #include <stdbool.h>
    604  #include "../../../include/linux/perf_event.h"
    605 +#else
    606 +#include "include/linux/list.h"
    607 +#include <stdbool.h>
    608 +#include "include/linux/added/perf_event.h"
    609 +#endif
    610 +/* ANDROID_CHANGE_END */
    611  #include "types.h"
    612  #include "xyarray.h"
    613  #include "cgroup.h"
    614 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/generate-cmdlist.sh ./util/generate-cmdlist.sh
    615 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/generate-cmdlist.sh	2011-12-09 13:14:50.000000000 -0800
    616 +++ ./util/generate-cmdlist.sh	2012-03-22 17:08:10.000000000 -0700
    617 @@ -1,5 +1,7 @@
    618  #!/bin/sh
    619  
    620 +PREFIX="$1"
    621 +
    622  echo "/* Automatically generated by $0 */
    623  struct cmdname_help
    624  {
    625 @@ -9,7 +11,7 @@
    626  
    627  static struct cmdname_help common_cmds[] = {"
    628  
    629 -sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
    630 +sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' ${PREFIX}/command-list.txt |
    631  sort |
    632  while read cmd
    633  do
    634 @@ -19,6 +21,6 @@
    635              x
    636              s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
    637  	    p
    638 -     }' "Documentation/perf-$cmd.txt"
    639 +     }' "${PREFIX}/Documentation/perf-$cmd.txt"
    640  done
    641  echo "};"
    642 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/header.c ./util/header.c
    643 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/header.c	2011-12-09 13:14:50.000000000 -0800
    644 +++ ./util/header.c	2012-03-22 17:08:10.000000000 -0700
    645 @@ -5,8 +5,15 @@
    646  #include <unistd.h>
    647  #include <stdio.h>
    648  #include <stdlib.h>
    649 +/* ANDROID_CHANGE_BEGIN */
    650 +#if 0
    651  #include <linux/list.h>
    652  #include <linux/kernel.h>
    653 +#else
    654 +#include "include/linux/list.h"
    655 +#include "include/linux/kernel.h"
    656 +#endif
    657 +/* ANDROID_CHANGE_END */
    658  
    659  #include "evlist.h"
    660  #include "evsel.h"
    661 @@ -57,10 +64,23 @@
    662  	return NULL;
    663  }
    664  
    665 +/* ANDROID_CHANGE_BEGIN */
    666 +/*
    667 + * The string in the literal pool might not be aligned properly. ARM doesn't
    668 + * support unaligned loads with NEON registers
    669 + */
    670 +#if 0
    671  static const char *__perf_magic = "PERFFILE";
    672  
    673 +#else
    674 +static const char const __perf_magic[9] __attribute__ ((aligned (8))) = 
    675 +  "PERFFILE";
    676 +#endif
    677 +/* ANDROID_CHANGE_END */
    678 +
    679  #define PERF_MAGIC	(*(u64 *)__perf_magic)
    680  
    681 +
    682  struct perf_file_attr {
    683  	struct perf_event_attr	attr;
    684  	struct perf_file_section	ids;
    685 @@ -129,7 +149,13 @@
    686  		if (!pos->hit)
    687  			continue;
    688  		len = pos->long_name_len + 1;
    689 +                /* ANDROID_CHANGE_BEGIN */
    690 +#ifdef __BIONIC__
    691 +		len = KERNEL_ALIGN(len, NAME_ALIGN);
    692 +#else
    693  		len = ALIGN(len, NAME_ALIGN);
    694 +#endif
    695 +                /* ANDROID_CHANGE_BEGIN */
    696  		memset(&b, 0, sizeof(b));
    697  		memcpy(&b.build_id, pos->build_id, sizeof(pos->build_id));
    698  		b.pid = pid;
    699 @@ -705,7 +731,13 @@
    700  	struct perf_session *session = container_of(header, struct perf_session, header);
    701  	struct {
    702  		struct perf_event_header   header;
    703 +                /* ANDROID_CHANGE_BEGIN */
    704 +#ifdef __BIONIC__
    705 +		u8			   build_id[KERNEL_ALIGN(BUILD_ID_SIZE, sizeof(u64))];
    706 +#else
    707  		u8			   build_id[ALIGN(BUILD_ID_SIZE, sizeof(u64))];
    708 +#endif
    709 +                /* ANDROID_CHANGE_END */
    710  		char			   filename[0];
    711  	} old_bev;
    712  	struct build_id_event bev;
    713 @@ -950,7 +982,13 @@
    714  	int err;
    715  
    716  	size = sizeof(struct perf_event_attr);
    717 +        /* ANDROID_CHANGE_BEGIN */
    718 +#ifdef __BIONIC__
    719 +	size = KERNEL_ALIGN(size, sizeof(u64));
    720 +#else
    721  	size = ALIGN(size, sizeof(u64));
    722 +#endif
    723 +        /* ANDROID_CHANGE_END */
    724  	size += sizeof(struct perf_event_header);
    725  	size += ids * sizeof(u64);
    726  
    727 @@ -1046,7 +1084,13 @@
    728  
    729  	ev.event_type.header.type = PERF_RECORD_HEADER_EVENT_TYPE;
    730  	size = strlen(name);
    731 +        /* ANDROID_CHANGE_BEGIN */
    732 +#ifdef __BIONIC__
    733 +	size = KERNEL_ALIGN(size, sizeof(u64));
    734 +#else
    735  	size = ALIGN(size, sizeof(u64));
    736 +#endif
    737 +        /* ANDROID_CHANGE_END */
    738  	ev.event_type.header.size = sizeof(ev.event_type) -
    739  		(sizeof(ev.event_type.event_type.name) - size);
    740  
    741 @@ -1100,7 +1144,13 @@
    742  	size = read_tracing_data_size(fd, &evlist->entries);
    743  	if (size <= 0)
    744  		return size;
    745 +        /* ANDROID_CHANGE_BEGIN */
    746 +#ifdef __BIONIC__
    747 +	aligned_size = KERNEL_ALIGN(size, sizeof(u64));
    748 +#else
    749  	aligned_size = ALIGN(size, sizeof(u64));
    750 +#endif
    751 +        /* ANDROID_CHANGE_END */
    752  	padding = aligned_size - size;
    753  	ev.tracing_data.header.size = sizeof(ev.tracing_data);
    754  	ev.tracing_data.size = aligned_size;
    755 @@ -1126,7 +1176,13 @@
    756  
    757  	size_read = trace_report(session->fd, session->repipe);
    758  
    759 +        /* ANDROID_CHANGE_BEGIN */
    760 +#ifdef __BIONIC__
    761 +	padding = KERNEL_ALIGN(size_read, sizeof(u64)) - size_read;
    762 +#else
    763  	padding = ALIGN(size_read, sizeof(u64)) - size_read;
    764 +#endif
    765 +        /* ANDROID_CHANGE_END */
    766  
    767  	if (read(session->fd, buf, padding) < 0)
    768  		die("reading input file");
    769 @@ -1157,7 +1213,13 @@
    770  	memset(&ev, 0, sizeof(ev));
    771  
    772  	len = pos->long_name_len + 1;
    773 +        /* ANDROID_CHANGE_BEGIN */
    774 +#ifdef __BIONIC__
    775 +	len = KERNEL_ALIGN(len, NAME_ALIGN);
    776 +#else
    777  	len = ALIGN(len, NAME_ALIGN);
    778 +#endif
    779 +        /* ANDROID_CHANGE_END */
    780  	memcpy(&ev.build_id.build_id, pos->build_id, sizeof(pos->build_id));
    781  	ev.build_id.header.type = PERF_RECORD_HEADER_BUILD_ID;
    782  	ev.build_id.header.misc = misc;
    783 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/header.h ./util/header.h
    784 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/header.h	2011-12-09 13:14:50.000000000 -0800
    785 +++ ./util/header.h	2012-03-22 17:08:10.000000000 -0700
    786 @@ -1,13 +1,25 @@
    787  #ifndef __PERF_HEADER_H
    788  #define __PERF_HEADER_H
    789  
    790 +/* ANDROID_CHANGE_BEGIN */
    791 +#if 0
    792  #include "../../../include/linux/perf_event.h"
    793 +#else
    794 +#include "include/linux/added/perf_event.h"
    795 +#endif
    796 +/* ANDROID_CHANGE_END */
    797  #include <sys/types.h>
    798  #include <stdbool.h>
    799  #include "types.h"
    800  #include "event.h"
    801  
    802 +/* ANDROID_CHANGE_BEGIN */
    803 +#if 0
    804  #include <linux/bitmap.h>
    805 +#else
    806 +#include "include/linux/bitmap.h"
    807 +#endif
    808 +/* ANDROID_CHANGE_END */
    809  
    810  enum {
    811  	HEADER_TRACE_INFO = 1,
    812 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/help.c ./util/help.c
    813 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/help.c	2011-12-09 13:14:50.000000000 -0800
    814 +++ ./util/help.c	2012-03-22 17:08:10.000000000 -0700
    815 @@ -74,12 +74,18 @@
    816  {
    817  	int cols = 1, rows;
    818  	int space = longest + 1; /* min 1 SP between words */
    819 -	struct winsize win;
    820  	int max_cols;
    821  	int i, j;
    822 +        /* ANDROID_CHANGE_BEGIN */
    823 +#ifdef __BIONIC__
    824 +        max_cols = 75;
    825 +#else
    826 +	struct winsize win;
    827  
    828  	get_term_dimensions(&win);
    829  	max_cols = win.ws_col - 1; /* don't print *on* the edge */
    830 +#endif
    831 +        /* ANDROID_CHANGE_END */
    832  
    833  	if (space < max_cols)
    834  		cols = max_cols / space;
    835 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/hweight.c ./util/hweight.c
    836 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/hweight.c	2011-12-09 13:14:50.000000000 -0800
    837 +++ ./util/hweight.c	2012-03-22 17:08:10.000000000 -0700
    838 @@ -1,4 +1,10 @@
    839 +/* ANDROID_CHANGE_BEGIN */
    840 +#if 0
    841  #include <linux/bitops.h>
    842 +#else
    843 +#include "include/linux/bitops.h"
    844 +#endif
    845 +/* ANDROID_CHANGE_END */
    846  
    847  /**
    848   * hweightN - returns the hamming weight of a N-bit word
    849 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/asm/byteorder.h ./util/include/asm/byteorder.h
    850 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/asm/byteorder.h	2011-12-09 13:14:50.000000000 -0800
    851 +++ ./util/include/asm/byteorder.h	2012-03-22 17:08:10.000000000 -0700
    852 @@ -1,2 +1,8 @@
    853  #include <asm/types.h>
    854 +/* ANDROID_CHANGE_BEGIN */
    855 +#if 0
    856  #include "../../../../include/linux/swab.h"
    857 +#else
    858 +#include <linux/swab.h>
    859 +#endif
    860 +/* ANDROID_CHANGE_END */
    861 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/bitmap.h ./util/include/linux/bitmap.h
    862 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/bitmap.h	2011-12-09 13:14:50.000000000 -0800
    863 +++ ./util/include/linux/bitmap.h	2012-03-22 17:08:10.000000000 -0700
    864 @@ -2,7 +2,13 @@
    865  #define _PERF_BITOPS_H
    866  
    867  #include <string.h>
    868 +/* ANDROID_CHANGE_BEGIN */
    869 +#if 0
    870  #include <linux/bitops.h>
    871 +#else
    872 +#include "bitops.h"
    873 +#endif
    874 +/* ANDROID_CHANGE_END */
    875  
    876  int __bitmap_weight(const unsigned long *bitmap, int bits);
    877  
    878 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/bitops.h ./util/include/linux/bitops.h
    879 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/bitops.h	2011-12-09 13:14:50.000000000 -0800
    880 +++ ./util/include/linux/bitops.h	2012-03-22 17:08:10.000000000 -0700
    881 @@ -1,9 +1,20 @@
    882  #ifndef _PERF_LINUX_BITOPS_H_
    883  #define _PERF_LINUX_BITOPS_H_
    884  
    885 +/* ANDROID_CHANGE_BEGIN */
    886 +#if 0
    887  #include <linux/kernel.h>
    888  #include <linux/compiler.h>
    889  #include <asm/hweight.h>
    890 +#else
    891 +#include "kernel.h"
    892 +#include "compiler.h"
    893 +#include "../asm/hweight.h"
    894 +#if defined(__BIONIC__)
    895 +#define __WORDSIZE 32
    896 +#endif
    897 +#endif
    898 +/* ANDROID_CHANGE_END */
    899  
    900  #define BITS_PER_LONG __WORDSIZE
    901  #define BITS_PER_BYTE           8
    902 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/compiler.h ./util/include/linux/compiler.h
    903 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/compiler.h	2011-12-09 13:14:50.000000000 -0800
    904 +++ ./util/include/linux/compiler.h	2012-03-22 17:08:10.000000000 -0700
    905 @@ -7,6 +7,10 @@
    906  #define __user
    907  #define __attribute_const__
    908  
    909 +/* ANDROID_CHANGE_BEGIN */
    910 +#ifndef __BIONIC__
    911  #define __used		__attribute__((__unused__))
    912 +#endif
    913 +/* ANDROID_CHANGE_END */
    914  
    915  #endif
    916 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/hash.h ./util/include/linux/hash.h
    917 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/hash.h	2011-12-09 13:14:50.000000000 -0800
    918 +++ ./util/include/linux/hash.h	2012-03-22 17:08:10.000000000 -0700
    919 @@ -1,5 +1,10 @@
    920 -#include "../../../../include/linux/hash.h"
    921 -
    922  #ifndef PERF_HASH_H
    923  #define PERF_HASH_H
    924 +/* ANDROID_CHANGE_BEGIN */
    925 +#if 0
    926 +#include "../../../../include/linux/hash.h"
    927 +#else
    928 +#include "added/hash.h"
    929 +#endif
    930 +/* ANDROID_CHANGE_END */
    931  #endif
    932 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/kernel.h ./util/include/linux/kernel.h
    933 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/kernel.h	2011-12-09 13:14:50.000000000 -0800
    934 +++ ./util/include/linux/kernel.h	2012-03-22 17:08:10.000000000 -0700
    935 @@ -8,7 +8,14 @@
    936  
    937  #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
    938  
    939 +/* ANDROID_CHANGE_BEGIN */
    940 +#ifdef __BIONIC__
    941 +/* Bionic defines ALIGN in sys/param.h */
    942 +#define KERNEL_ALIGN(x,a)	__ALIGN_MASK(x,(typeof(x))(a)-1)
    943 +#else
    944  #define ALIGN(x,a)		__ALIGN_MASK(x,(typeof(x))(a)-1)
    945 +#endif
    946 +/* ANDROID_CHANGE_END */
    947  #define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
    948  
    949  #ifndef offsetof
    950 @@ -28,7 +35,11 @@
    951  	(type *)((char *)__mptr - offsetof(type, member)); })
    952  #endif
    953  
    954 +/* ANDROID_CHANGE_BEGIN */
    955 +#ifndef __BIONIC__
    956  #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
    957 +#endif
    958 +/* ANDROID_CHANGE_END */
    959  
    960  #ifndef max
    961  #define max(x, y) ({				\
    962 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/list.h ./util/include/linux/list.h
    963 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/list.h	2011-12-09 13:14:50.000000000 -0800
    964 +++ ./util/include/linux/list.h	2012-03-22 17:08:10.000000000 -0700
    965 @@ -1,7 +1,15 @@
    966 +/* ANDROID_CHANGE_BEGIN */
    967 +#if 0
    968  #include <linux/kernel.h>
    969  #include <linux/prefetch.h>
    970 -
    971  #include "../../../../include/linux/list.h"
    972 +#else
    973 +#include "kernel.h"
    974 +#include "prefetch.h"
    975 +#include "types.h"
    976 +#include "added/list.h"
    977 +#endif
    978 +/* ANDROID_CHANGE_END */
    979  
    980  #ifndef PERF_LIST_H
    981  #define PERF_LIST_H
    982 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/poison.h ./util/include/linux/poison.h
    983 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/poison.h	2011-12-09 13:14:50.000000000 -0800
    984 +++ ./util/include/linux/poison.h	2012-03-22 17:08:10.000000000 -0700
    985 @@ -1 +1,7 @@
    986 +/* ANDROID_CHANGE_BEGIN */
    987 +#if 0
    988  #include "../../../../include/linux/poison.h"
    989 +#else
    990 +#include "added/poison.h"
    991 +#endif
    992 +/* ANDROID_CHANGE_END */
    993 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/rbtree.h ./util/include/linux/rbtree.h
    994 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/include/linux/rbtree.h	2011-12-09 13:14:50.000000000 -0800
    995 +++ ./util/include/linux/rbtree.h	2012-03-22 17:08:10.000000000 -0700
    996 @@ -1 +1,7 @@
    997 +/* ANDROID_CHANGE_BEGIN */
    998 +#if 0
    999  #include "../../../../include/linux/rbtree.h"
   1000 +#else
   1001 +#include "added/rbtree.h"
   1002 +#endif
   1003 +/* ANDROID_CHANGE_END */
   1004 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/map.h ./util/map.h
   1005 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/map.h	2011-12-09 13:14:50.000000000 -0800
   1006 +++ ./util/map.h	2012-03-22 17:08:10.000000000 -0700
   1007 @@ -1,9 +1,17 @@
   1008  #ifndef __PERF_MAP_H
   1009  #define __PERF_MAP_H
   1010  
   1011 +/* ANDROID_CHANGE_BEGIN */
   1012 +#if 0
   1013  #include <linux/compiler.h>
   1014  #include <linux/list.h>
   1015  #include <linux/rbtree.h>
   1016 +#else
   1017 +#include "include/linux/compiler.h"
   1018 +#include "include/linux/list.h"
   1019 +#include "include/linux/rbtree.h"
   1020 +#endif
   1021 +/* ANDROID_CHANGE_END */
   1022  #include <stdio.h>
   1023  #include <stdbool.h>
   1024  #include "types.h"
   1025 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/parse-events.c ./util/parse-events.c
   1026 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/parse-events.c	2011-12-09 13:14:50.000000000 -0800
   1027 +++ ./util/parse-events.c	2012-03-22 17:08:10.000000000 -0700
   1028 @@ -1,4 +1,10 @@
   1029 +/* ANDROID_CHANGE_BEGIN */
   1030 +#if 0
   1031  #include "../../../include/linux/hw_breakpoint.h"
   1032 +#else
   1033 +#include "include/linux/added/hw_breakpoint.h"
   1034 +#endif
   1035 +/* ANDROID_CHANGE_END */
   1036  #include "util.h"
   1037  #include "../perf.h"
   1038  #include "evlist.h"
   1039 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/parse-events.h ./util/parse-events.h
   1040 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/parse-events.h	2011-12-09 13:14:50.000000000 -0800
   1041 +++ ./util/parse-events.h	2012-03-22 17:08:10.000000000 -0700
   1042 @@ -4,7 +4,13 @@
   1043   * Parse symbolic events/counts passed in as options:
   1044   */
   1045  
   1046 +/* ANDROID_CHANGE_BEGIN */
   1047 +#if 0
   1048  #include "../../../include/linux/perf_event.h"
   1049 +#else
   1050 +#include "include/linux/added/perf_event.h"
   1051 +#endif
   1052 +/* ANDROID_CHANGE_END */
   1053  
   1054  struct list_head;
   1055  struct perf_evsel;
   1056 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/probe-finder.c ./util/probe-finder.c
   1057 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/probe-finder.c	2011-12-09 13:14:50.000000000 -0800
   1058 +++ ./util/probe-finder.c	2012-03-22 17:08:10.000000000 -0700
   1059 @@ -31,9 +31,16 @@
   1060  #include <string.h>
   1061  #include <stdarg.h>
   1062  #include <ctype.h>
   1063 +/* ANDROID_CHANGE_BEGIN */
   1064 +#if 0
   1065  #include <dwarf-regs.h>
   1066 -
   1067  #include <linux/bitops.h>
   1068 +#else
   1069 +#include "include/dwarf-regs.h"
   1070 +#include "include/linux/bitops.h"
   1071 +#endif
   1072 +/* ANDROID_CHANGE_END */
   1073 +
   1074  #include "event.h"
   1075  #include "debug.h"
   1076  #include "util.h"
   1077 @@ -2061,4 +2068,3 @@
   1078  	dwfl_end(dwfl);
   1079  	return (ret < 0) ? ret : lf.found;
   1080  }
   1081 -
   1082 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/probe-finder.h ./util/probe-finder.h
   1083 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/probe-finder.h	2011-12-09 13:14:50.000000000 -0800
   1084 +++ ./util/probe-finder.h	2012-03-22 17:08:10.000000000 -0700
   1085 @@ -33,10 +33,20 @@
   1086  				  struct variable_list **vls, int max_points,
   1087  				  bool externs);
   1088  
   1089 +/* ANDROID_CHANGE_BEGIN */
   1090 +#if 0
   1091  #include <dwarf.h>
   1092  #include <elfutils/libdw.h>
   1093  #include <elfutils/libdwfl.h>
   1094  #include <elfutils/version.h>
   1095 +#else
   1096 +/* These headers live under the external/elfutils */
   1097 +#include <dwarf.h>
   1098 +#include <libdw.h>
   1099 +#include <libdwfl.h>
   1100 +#include <version.h>
   1101 +#endif
   1102 +/* ANDROID_CHANGE_END */
   1103  
   1104  struct probe_finder {
   1105  	struct perf_probe_event	*pev;		/* Target probe event */
   1106 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/pstack.c ./util/pstack.c
   1107 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/pstack.c	2011-12-09 13:14:50.000000000 -0800
   1108 +++ ./util/pstack.c	2012-03-22 17:08:09.000000000 -0700
   1109 @@ -6,7 +6,13 @@
   1110  
   1111  #include "util.h"
   1112  #include "pstack.h"
   1113 +/* ANDROID_CHANGE_BEGIN */
   1114 +#if 0
   1115  #include <linux/kernel.h>
   1116 +#else
   1117 +#include "util/include/linux/kernel.h"
   1118 +#endif
   1119 +/* ANDROID_CHANGE_END */
   1120  #include <stdlib.h>
   1121  
   1122  struct pstack {
   1123 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/session.h ./util/session.h
   1124 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/session.h	2011-12-09 13:14:50.000000000 -0800
   1125 +++ ./util/session.h	2012-03-22 17:08:10.000000000 -0700
   1126 @@ -6,8 +6,15 @@
   1127  #include "header.h"
   1128  #include "symbol.h"
   1129  #include "thread.h"
   1130 +/* ANDROID_CHANGE_BEGIN */
   1131 +#if 0
   1132  #include <linux/rbtree.h>
   1133  #include "../../../include/linux/perf_event.h"
   1134 +#else
   1135 +#include "include/linux/rbtree.h"
   1136 +#include "include/linux/added/perf_event.h"
   1137 +#endif
   1138 +/* ANDROID_CHANGE_END */
   1139  
   1140  struct sample_queue;
   1141  struct ip_callchain;
   1142 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/sort.h ./util/sort.h
   1143 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/sort.h	2011-12-09 13:14:50.000000000 -0800
   1144 +++ ./util/sort.h	2012-03-22 17:08:10.000000000 -0700
   1145 @@ -5,9 +5,17 @@
   1146  #include "util.h"
   1147  
   1148  #include "color.h"
   1149 +/* ANDROID_CHANGE_BEGIN */
   1150 +#if 0
   1151  #include <linux/list.h>
   1152  #include "cache.h"
   1153  #include <linux/rbtree.h>
   1154 +#else
   1155 +#include "include/linux/list.h"
   1156 +#include "cache.h"
   1157 +#include "include/linux/rbtree.h"
   1158 +#endif
   1159 +/* ANDROID_CHANGE_END */
   1160  #include "symbol.h"
   1161  #include "string.h"
   1162  #include "callchain.h"
   1163 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/strfilter.h ./util/strfilter.h
   1164 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/strfilter.h	2011-12-09 13:14:50.000000000 -0800
   1165 +++ ./util/strfilter.h	2012-03-22 17:08:09.000000000 -0700
   1166 @@ -2,7 +2,13 @@
   1167  #define __PERF_STRFILTER_H
   1168  /* General purpose glob matching filter */
   1169  
   1170 +/* ANDROID_CHANGE_BEGIN */
   1171 +#if 0
   1172  #include <linux/list.h>
   1173 +#else
   1174 +#include "util/include/linux/list.h"
   1175 +#endif
   1176 +/* ANDROID_CHANGE_END */
   1177  #include <stdbool.h>
   1178  
   1179  /* A node of string filter */
   1180 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/strlist.h ./util/strlist.h
   1181 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/strlist.h	2011-12-09 13:14:50.000000000 -0800
   1182 +++ ./util/strlist.h	2012-03-22 17:08:10.000000000 -0700
   1183 @@ -1,7 +1,14 @@
   1184  #ifndef __PERF_STRLIST_H
   1185  #define __PERF_STRLIST_H
   1186  
   1187 +/* ANDROID_CHANGE_BEGIN */
   1188 +#if 0
   1189  #include <linux/rbtree.h>
   1190 +#else
   1191 +#include "include/linux/kernel.h"
   1192 +#include "include/linux/rbtree.h"
   1193 +#endif
   1194 +/* ANDROID_CHANGE_END */
   1195  #include <stdbool.h>
   1196  
   1197  struct str_node {
   1198 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/symbol.c ./util/symbol.c
   1199 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/symbol.c	2011-12-09 13:14:50.000000000 -0800
   1200 +++ ./util/symbol.c	2012-03-22 17:08:10.000000000 -0700
   1201 @@ -31,6 +31,12 @@
   1202  #define NT_GNU_BUILD_ID 3
   1203  #endif
   1204  
   1205 +/* ANDROID_CHANGE_BEGIN */
   1206 +#ifdef __BIONIC__
   1207 +#define roundup(x, y)  ((((x) + ((y) - 1)) / (y)) * (y))
   1208 +#endif
   1209 +/* ANDROID_CHANGE_END */
   1210 +
   1211  static bool dso__build_id_equal(const struct dso *dso, u8 *build_id);
   1212  static int elf_read_build_id(Elf *elf, void *bf, size_t size);
   1213  static void dsos__add(struct list_head *head, struct dso *dso);
   1214 @@ -2465,7 +2471,13 @@
   1215  	if (symbol_conf.initialized)
   1216  		return 0;
   1217  
   1218 +        /* ANDROID_CHANGE_BEGIN */
   1219 +#if __BIONIC__
   1220 +	symbol_conf.priv_size = KERNEL_ALIGN(symbol_conf.priv_size, sizeof(u64));
   1221 +#else
   1222  	symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64));
   1223 +#endif
   1224 +        /* ANDROID_CHANGE_END */
   1225  
   1226  	elf_version(EV_CURRENT);
   1227  	if (symbol_conf.sort_by_name)
   1228 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/symbol.h ./util/symbol.h
   1229 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/symbol.h	2011-12-09 13:14:50.000000000 -0800
   1230 +++ ./util/symbol.h	2012-03-22 17:08:10.000000000 -0700
   1231 @@ -5,8 +5,15 @@
   1232  #include <stdbool.h>
   1233  #include <stdint.h>
   1234  #include "map.h"
   1235 +/* ANDROID_CHANGE_BEGIN */
   1236 +#if 0
   1237  #include <linux/list.h>
   1238  #include <linux/rbtree.h>
   1239 +#else
   1240 +#include "include/linux/list.h"
   1241 +#include "include/linux/rbtree.h"
   1242 +#endif
   1243 +/* ANDROID_CHANGE_END */
   1244  #include <stdio.h>
   1245  
   1246  #ifdef HAVE_CPLUS_DEMANGLE
   1247 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/thread.h ./util/thread.h
   1248 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/thread.h	2011-12-09 13:14:50.000000000 -0800
   1249 +++ ./util/thread.h	2012-03-22 17:08:10.000000000 -0700
   1250 @@ -1,7 +1,13 @@
   1251  #ifndef __PERF_THREAD_H
   1252  #define __PERF_THREAD_H
   1253  
   1254 +/* ANDROID_CHANGE_BEGIN */
   1255 +#if 0
   1256  #include <linux/rbtree.h>
   1257 +#else
   1258 +#include "include/linux/rbtree.h"
   1259 +#endif
   1260 +/* ANDROID_CHANGE_END */
   1261  #include <unistd.h>
   1262  #include "symbol.h"
   1263  
   1264 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/top.h ./util/top.h
   1265 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/top.h	2011-12-09 13:14:50.000000000 -0800
   1266 +++ ./util/top.h	2012-03-22 17:08:10.000000000 -0700
   1267 @@ -5,8 +5,15 @@
   1268  #include "../perf.h"
   1269  #include <stddef.h>
   1270  #include <pthread.h>
   1271 +/* ANDROID_CHANGE_BEGIN */
   1272 +#if 0
   1273  #include <linux/list.h>
   1274  #include <linux/rbtree.h>
   1275 +#else
   1276 +#include "include/linux/list.h"
   1277 +#include "include/linux/rbtree.h"
   1278 +#endif
   1279 +/* ANDROID_CHANGE_END */
   1280  
   1281  struct perf_evlist;
   1282  struct perf_evsel;
   1283 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/trace-event.h ./util/trace-event.h
   1284 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/trace-event.h	2011-12-09 13:14:50.000000000 -0800
   1285 +++ ./util/trace-event.h	2012-03-22 17:08:10.000000000 -0700
   1286 @@ -5,7 +5,11 @@
   1287  #include "parse-events.h"
   1288  #include "session.h"
   1289  
   1290 +/* ANDROID_CHANGE_BEGIN */
   1291 +#ifndef __BIONIC__
   1292  #define __unused __attribute__((unused))
   1293 +#endif
   1294 +/* ANDROID_CHANGE_END */
   1295  
   1296  
   1297  #ifndef PAGE_MASK
   1298 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/trace-event-info.c ./util/trace-event-info.c
   1299 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/trace-event-info.c	2011-12-09 13:14:50.000000000 -0800
   1300 +++ ./util/trace-event-info.c	2012-03-22 17:08:10.000000000 -0700
   1301 @@ -34,8 +34,15 @@
   1302  #include <ctype.h>
   1303  #include <errno.h>
   1304  #include <stdbool.h>
   1305 +/* ANDROID_CHANGE_BEGIN */
   1306 +#if 0
   1307  #include <linux/list.h>
   1308  #include <linux/kernel.h>
   1309 +#else
   1310 +#include "include/linux/list.h"
   1311 +#include "include/linux/kernel.h"
   1312 +#endif
   1313 +/* ANDROID_CHANGE_END */
   1314  
   1315  #include "../perf.h"
   1316  #include "trace-event.h"
   1317 diff -r -u -d /home/bccheng/local/kernels/crespo-ics/tools/perf/util/util.h ./util/util.h
   1318 --- /home/bccheng/local/kernels/crespo-ics/tools/perf/util/util.h	2011-12-09 13:14:50.000000000 -0800
   1319 +++ ./util/util.h	2012-03-22 17:08:09.000000000 -0700
   1320 @@ -1,7 +1,11 @@
   1321  #ifndef GIT_COMPAT_UTIL_H
   1322  #define GIT_COMPAT_UTIL_H
   1323  
   1324 +/* ANDROID_CHANGE_BEGIN */
   1325 +#ifndef __BIONIC__
   1326  #define _FILE_OFFSET_BITS 64
   1327 +#endif
   1328 +/* ANDROID_CHANGE_END */
   1329  
   1330  #ifndef FLEX_ARRAY
   1331  /*
   1332 @@ -58,6 +62,11 @@
   1333  #include <limits.h>
   1334  #include <sys/param.h>
   1335  #include <sys/types.h>
   1336 +/* ANDROID_CHANGE_BEGIN */
   1337 +#ifdef __BIONIC__
   1338 +#include <pthread.h>
   1339 +#endif
   1340 +/* ANDROID_CHANGE_END */
   1341  #include <dirent.h>
   1342  #include <sys/time.h>
   1343  #include <time.h>
   1344 @@ -77,9 +86,23 @@
   1345  #include <netdb.h>
   1346  #include <pwd.h>
   1347  #include <inttypes.h>
   1348 +
   1349 +/* ANDROID_CHANGE_BEGIN */
   1350 +#if 0
   1351  #include "../../../include/linux/magic.h"
   1352 +#else
   1353 +#include <linux/magic.h>
   1354 +#endif
   1355 +/* ANDROID_CHANGE_END */
   1356 +
   1357  #include "types.h"
   1358 +
   1359 +/* ANDROID_CHANGE_BEGIN */
   1360 +#ifndef __BIONIC__
   1361  #include <sys/ttydefaults.h>
   1362 +#endif
   1363 +/* ANDROID_CHANGE_END */
   1364 +
   1365  
   1366  extern const char *graph_line;
   1367  extern const char *graph_dotted_line;
   1368 @@ -135,7 +158,13 @@
   1369  extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
   1370  extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
   1371  
   1372 +/* ANDROID_CHANGE_BEGIN */
   1373 +#if 0
   1374  #include "../../../include/linux/stringify.h"
   1375 +#else
   1376 +#include "util/include/linux/added/stringify.h"
   1377 +#endif
   1378 +/* ANDROID_CHANGE_END */
   1379  
   1380  #define DIE_IF(cnd)	\
   1381  	do { if (cnd)	\
   1382