Skip to content

Teambaez #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 52 additions & 7 deletions README
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
Modified from https://github.com/royzhao/memtester4Android.git to build
using `ndk-build` without any dependencies other than Android NDK.

This is based on memtester version 4.3.0, tested on 32-bit ARM (armeabi-v7a).
Requires root to test more than 64MB of memory.

## Prerequisites

Install Android NDK. The easiest way to do this is:

1. [Install Android Studio](https://developer.android.com/studio/install).

2. Open Android Studio, and under Configure or Tools, open the SDK Manager.

3. Under Appearance and Behavior > System Settings > Android SDK, click on
the SDK Tools tab.

4. Note the Android SDK Location (you will need this path later, typically it
will be ~/Android/Sdk), and make sure that it doesn't contain spaces.

5. Tick the checkbox next to NDK (Side by side) and Apply.

6. Accept the EULAs and install the NDK (default path is ~/Android/Sdk/ndk/).

=====================================
usage:
cd android/
source ./build/envsetup.sh
lunch xx
cd android/external/
git clone https://github.com/royzhao/memtester4Android.git

Usage:
# Clone this repository.
git clone https://github.com/akovacs/memtester4Android
cd memtester4Android
mm

# Make sure there are no spaces in the path to this directory:
pwd

# Configure environment variables
export NDK_PROJECT_PATH=`pwd`
export APP_PLATFORM=android-16

# Compile the binary using your version of the Android NDK's ndk-build
# Path to ndk-build within the Android SDK Location you recorded earlier
~/Android/Sdk/ndk/23.0.7123448/ndk-build .

# Push the appropriate binary to your device (here I'm using 32-bit ARM)
# You can also use arm64-v8a for 64-bit ARM, or x86
adb push libs/armeabi-v7a/memtester /data/local/tmp/
adb shell chmod 777 /data/local/tmp/memtester

# Open an adb shell into your device
adb shell
# Run as root, otherwise you will be limited to testing only 64MB memory
su
# Acquire and test 600MB of memory, run 3 loops
/data/local/tmp/memtester 600M 3

=====================================

memtester
Expand Down
1 change: 1 addition & 0 deletions Android.mk → jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ LOCAL_SRC_FILES:= \
LOCAL_MODULE:= memtester
LOCAL_MODULE_FILENAME:=memtester
LOCAL_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_LDFLAGS := -static
#LOCAL_C_INCLUDES :=
#LOCAL_STATIC_LIBRARIES :=
#LOCAL_SHARED_LIBRARIES :=
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions tests.c → jni/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ char progress[] = "-\\|/";
#define PROGRESSOFTEN 2500
#define ONE 0x00000001L

union mword8_type mword8;
union mword16_type mword16;

/* Function definitions. */

int compare_regions(ulv *bufa, ulv *bufb, size_t count) {
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions types.h → jni/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ struct test {
int (*fp)();
};

union {
union mword8_type {
unsigned char bytes[UL_LEN/8];
ul val;
} mword8;
};

union {
union mword16_type {
unsigned short u16s[UL_LEN/16];
ul val;
} mword16;
};
File renamed without changes.