~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/Documentation/android.txt

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/perf/Documentation/android.txt (Version linux-6.12-rc7) and /tools/perf/Documentation/android.txt (Version linux-5.17.15)


  1 How to compile perf for Android                     1 How to compile perf for Android
  2 =========================================           2 =========================================
  3                                                     3 
  4 I. Set the Android NDK environment                  4 I. Set the Android NDK environment
  5 ----------------------------------------------      5 ------------------------------------------------
  6                                                     6 
  7 (a). Use the Android NDK                            7 (a). Use the Android NDK
  8 ----------------------------------------------      8 ------------------------------------------------
  9 1. You need to download and install the Androi      9 1. You need to download and install the Android Native Development Kit (NDK).
 10 Set the NDK variable to point to the path wher     10 Set the NDK variable to point to the path where you installed the NDK:
 11   export NDK=/path/to/android-ndk                  11   export NDK=/path/to/android-ndk
 12                                                    12 
 13 2. Set cross-compiling environment variables f     13 2. Set cross-compiling environment variables for NDK toolchain and sysroot.
 14 For arm:                                           14 For arm:
 15   export NDK_TOOLCHAIN=${NDK}/toolchains/arm-l     15   export NDK_TOOLCHAIN=${NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
 16   export NDK_SYSROOT=${NDK}/platforms/android-     16   export NDK_SYSROOT=${NDK}/platforms/android-24/arch-arm
 17 For x86:                                           17 For x86:
 18   export NDK_TOOLCHAIN=${NDK}/toolchains/x86-4     18   export NDK_TOOLCHAIN=${NDK}/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-
 19   export NDK_SYSROOT=${NDK}/platforms/android-     19   export NDK_SYSROOT=${NDK}/platforms/android-24/arch-x86
 20                                                    20 
 21 This method is only tested for Android NDK ver     21 This method is only tested for Android NDK versions Revision 11b and later.
 22 perf uses some bionic enhancements that are no     22 perf uses some bionic enhancements that are not included in prior NDK versions.
 23 You can use method (b) described below instead     23 You can use method (b) described below instead.
 24                                                    24 
 25 (b). Use the Android source tree                   25 (b). Use the Android source tree
 26 ----------------------------------------------     26 -----------------------------------------------
 27 1. Download the master branch of the Android s     27 1. Download the master branch of the Android source tree.
 28 Set the environment for the target you want us     28 Set the environment for the target you want using:
 29   source build/envsetup.sh                         29   source build/envsetup.sh
 30   lunch                                            30   lunch
 31                                                    31 
 32 2. Build your own NDK sysroot to contain lates     32 2. Build your own NDK sysroot to contain latest bionic changes and set the
 33 NDK sysroot environment variable.                  33 NDK sysroot environment variable.
 34   cd ${ANDROID_BUILD_TOP}/ndk                      34   cd ${ANDROID_BUILD_TOP}/ndk
 35 For arm:                                           35 For arm:
 36   ./build/tools/build-ndk-sysroot.sh --abi=arm     36   ./build/tools/build-ndk-sysroot.sh --abi=arm
 37   export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/     37   export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/build/platforms/android-3/arch-arm
 38 For x86:                                           38 For x86:
 39   ./build/tools/build-ndk-sysroot.sh --abi=x86     39   ./build/tools/build-ndk-sysroot.sh --abi=x86
 40   export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/     40   export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/build/platforms/android-3/arch-x86
 41                                                    41 
 42 3. Set the NDK toolchain environment variable.     42 3. Set the NDK toolchain environment variable.
 43 For arm:                                           43 For arm:
 44   export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/ar     44   export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/arm-linux-androideabi-
 45 For x86:                                           45 For x86:
 46   export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/i6     46   export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/i686-linux-android-
 47                                                    47 
 48 II. Compile perf for Android                       48 II. Compile perf for Android
 49 ----------------------------------------------     49 ------------------------------------------------
 50 You need to run make with the NDK toolchain an     50 You need to run make with the NDK toolchain and sysroot defined above:
 51 For arm:                                           51 For arm:
 52   make WERROR=0 ARCH=arm CROSS_COMPILE=${NDK_T     52   make WERROR=0 ARCH=arm CROSS_COMPILE=${NDK_TOOLCHAIN} EXTRA_CFLAGS="-pie --sysroot=${NDK_SYSROOT}"
 53 For x86:                                           53 For x86:
 54   make WERROR=0 ARCH=x86 CROSS_COMPILE=${NDK_T     54   make WERROR=0 ARCH=x86 CROSS_COMPILE=${NDK_TOOLCHAIN} EXTRA_CFLAGS="-pie --sysroot=${NDK_SYSROOT}"
 55                                                    55 
 56 III. Install perf                                  56 III. Install perf
 57 ----------------------------------------------     57 -----------------------------------------------
 58 You need to connect to your Android device/emu     58 You need to connect to your Android device/emulator using adb.
 59 Install perf using:                                59 Install perf using:
 60   adb push perf /data/perf                         60   adb push perf /data/perf
 61                                                    61 
 62 If you also want to use perf-archive you need      62 If you also want to use perf-archive you need busybox tools for Android.
 63 For installing perf-archive, you first need to     63 For installing perf-archive, you first need to replace #!/bin/bash with #!/system/bin/sh:
 64   sed 's/#!\/bin\/bash/#!\/system\/bin\/sh/g'      64   sed 's/#!\/bin\/bash/#!\/system\/bin\/sh/g' perf-archive >> /tmp/perf-archive
 65   chmod +x /tmp/perf-archive                       65   chmod +x /tmp/perf-archive
 66   adb push /tmp/perf-archive /data/perf-archiv     66   adb push /tmp/perf-archive /data/perf-archive
 67                                                    67 
 68 IV. Environment settings for running perf          68 IV. Environment settings for running perf
 69 ----------------------------------------------     69 ------------------------------------------------
 70 Some perf features need environment variables      70 Some perf features need environment variables to run properly.
 71 You need to set these before running perf on t     71 You need to set these before running perf on the target:
 72   adb shell                                        72   adb shell
 73   # PERF_PAGER=cat                                 73   # PERF_PAGER=cat
 74                                                    74 
 75 IV. Run perf                                       75 IV. Run perf
 76 ----------------------------------------------     76 ------------------------------------------------
 77 Run perf on your device/emulator to which you      77 Run perf on your device/emulator to which you previously connected using adb:
 78   # ./data/perf                                    78   # ./data/perf
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php