diff --git a/atrace/Android.mk b/atrace/Android.mk
new file mode 100644
index 0000000..c1a0d87
--- /dev/null
+++ b/atrace/Android.mk
@@ -0,0 +1,12 @@
+# Copyright 2012 The Android Open Source Project
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= atrace.c
+
+LOCAL_MODULE:= atrace
+
+LOCAL_MODULE_TAGS:= debug
+
+include $(BUILD_EXECUTABLE)
diff --git a/atrace/MODULE_LICENSE_APACHE2 b/atrace/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/atrace/MODULE_LICENSE_APACHE2
diff --git a/atrace/NOTICE b/atrace/NOTICE
new file mode 100644
index 0000000..c77f135
--- /dev/null
+++ b/atrace/NOTICE
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2012, The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/atrace/atrace.c b/atrace/atrace.c
new file mode 100644
index 0000000..a617432
--- /dev/null
+++ b/atrace/atrace.c
@@ -0,0 +1,370 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/sendfile.h>
+#include <time.h>
+
+/* Command line options */
+static int g_traceDurationSeconds = 5;
+static bool g_traceSchedSwitch = false;
+static bool g_traceCpuFrequency = false;
+static bool g_traceGovernorLoad = false;
+static bool g_traceWorkqueue = false;
+static bool g_traceOverwrite = false;
+static int g_traceBufferSizeKB = 2048;
+
+/* Global state */
+static bool g_traceAborted = false;
+
+/* Sys file paths */
+static const char* k_traceClockPath =
+    "/sys/kernel/debug/tracing/trace_clock";
+
+static const char* k_traceBufferSizePath =
+    "/sys/kernel/debug/tracing/buffer_size_kb";
+
+static const char* k_tracingOverwriteEnablePath =
+    "/sys/kernel/debug/tracing/options/overwrite";
+
+static const char* k_schedSwitchEnablePath =
+    "/sys/kernel/debug/tracing/events/sched/sched_switch/enable";
+
+static const char* k_cpuFreqEnablePath =
+    "/sys/kernel/debug/tracing/events/power/cpu_frequency/enable";
+
+static const char* k_governorLoadEnablePath =
+    "/sys/kernel/debug/tracing/events/cpufreq_interactive/enable";
+
+
+static const char* k_workqueueEnablePath =
+    "/sys/kernel/debug/tracing/events/workqueue/enable";
+
+static const char* k_tracingOnPath =
+    "/sys/kernel/debug/tracing/tracing_on";
+
+static const char* k_tracePath =
+    "/sys/kernel/debug/tracing/trace";
+
+static const char* k_traceMarkerPath =
+    "/sys/kernel/debug/tracing/trace_marker";
+
+// Write a string to a file, returning true if the write was successful.
+bool writeStr(const char* filename, const char* str)
+{
+    int fd = open(filename, O_WRONLY);
+    if (fd == -1) {
+        fprintf(stderr, "error opening %s: %s (%d)\n", filename,
+                strerror(errno), errno);
+        return false;
+    }
+
+    bool ok = true;
+    ssize_t len = strlen(str);
+    if (write(fd, str, len) != len) {
+        fprintf(stderr, "error writing to %s: %s (%d)\n", filename,
+                strerror(errno), errno);
+        ok = false;
+    }
+
+    close(fd);
+
+    return ok;
+}
+
+// Enable or disable a kernel option by writing a "1" or a "0" into a /sys file.
+static bool setKernelOptionEnable(const char* filename, bool enable)
+{
+    return writeStr(filename, enable ? "1" : "0");
+}
+
+// Enable or disable overwriting of the kernel trace buffers.  Disabling this
+// will cause tracing to stop once the trace buffers have filled up.
+static bool setTraceOverwriteEnable(bool enable)
+{
+    return setKernelOptionEnable(k_tracingOverwriteEnablePath, enable);
+}
+
+// Enable or disable tracing of the kernel scheduler switching.
+static bool setSchedSwitchTracingEnable(bool enable)
+{
+    return setKernelOptionEnable(k_schedSwitchEnablePath, enable);
+}
+
+// Enable or disable tracing of the CPU clock frequency.
+static bool setCpuFrequencyTracingEnable(bool enable)
+{
+    return setKernelOptionEnable(k_cpuFreqEnablePath, enable);
+}
+
+// Enable or disable tracing of the interactive CPU frequency governor's idea of
+// the CPU load.
+static bool setGovernorLoadTracingEnable(bool enable)
+{
+    return setKernelOptionEnable(k_governorLoadEnablePath, enable);
+}
+
+// Enable or disable tracing of the kernel workqueues.
+static bool setWorkqueueTracingEnabled(bool enable)
+{
+    return setKernelOptionEnable(k_workqueueEnablePath, enable);
+}
+
+// Enable or disable kernel tracing.
+static bool setTracingEnabled(bool enable)
+{
+    return setKernelOptionEnable(k_tracingOnPath, enable);
+}
+
+// Clear the contents of the kernel trace.
+static bool clearTrace()
+{
+    int traceFD = creat(k_tracePath, 0);
+    if (traceFD == -1) {
+        fprintf(stderr, "error truncating %s: %s (%d)\n", k_tracePath,
+                strerror(errno), errno);
+        return false;
+    }
+
+    close(traceFD);
+
+    return true;
+}
+
+// Set the size of the kernel's trace buffer in kilobytes.
+static bool setTraceBufferSizeKB(int size)
+{
+    char str[32] = "1";
+    int len;
+    if (size < 1) {
+        size = 1;
+    }
+    snprintf(str, 32, "%d", size);
+    return writeStr(k_traceBufferSizePath, str);
+}
+
+// Enable or disable the kernel's use of the global clock.  Disabling the global
+// clock will result in the kernel using a per-CPU local clock.
+static bool setGlobalClockEnable(bool enable)
+{
+    return writeStr(k_traceClockPath, enable ? "global" : "local");
+}
+
+// Enable tracing in the kernel.
+static bool startTrace()
+{
+    bool ok = true;
+
+    // Set up the tracing options.
+    ok &= setTraceOverwriteEnable(g_traceOverwrite);
+    ok &= setSchedSwitchTracingEnable(g_traceSchedSwitch);
+    ok &= setCpuFrequencyTracingEnable(g_traceCpuFrequency);
+    ok &= setGovernorLoadTracingEnable(g_traceGovernorLoad);
+    ok &= setWorkqueueTracingEnabled(g_traceWorkqueue);
+    ok &= setTraceBufferSizeKB(g_traceBufferSizeKB);
+    ok &= setGlobalClockEnable(true);
+
+    // Enable tracing.
+    ok &= setTracingEnabled(true);
+
+    if (!ok) {
+        fprintf(stderr, "error: unable to start trace\n");
+    }
+
+    return ok;
+}
+
+// Disable tracing in the kernel.
+static void stopTrace()
+{
+    // Disable tracing.
+    setTracingEnabled(false);
+
+    // Set the options back to their defaults.
+    setTraceOverwriteEnable(true);
+    setSchedSwitchTracingEnable(false);
+    setCpuFrequencyTracingEnable(false);
+    setGovernorLoadTracingEnable(false);
+    setWorkqueueTracingEnabled(false);
+    setGlobalClockEnable(false);
+
+    // Note that we can't reset the trace buffer size here because that would
+    // clear the trace before we've read it.
+}
+
+// Read the current kernel trace and write it to stdout.
+static void dumpTrace()
+{
+    int traceFD = open(k_tracePath, O_RDWR);
+    if (traceFD == -1) {
+        fprintf(stderr, "error opening %s: %s (%d)\n", k_tracePath,
+                strerror(errno), errno);
+        return;
+    }
+
+    ssize_t sent = 0;
+    while ((sent = sendfile(STDOUT_FILENO, traceFD, NULL, 64*1024*1024)) > 0);
+    if (sent == -1) {
+        fprintf(stderr, "error dumping trace: %s (%d)\n", strerror(errno),
+                errno);
+    }
+
+    close(traceFD);
+}
+
+// Print the command usage help to stderr.
+static void showHelp(const char *cmd)
+{
+    fprintf(stderr, "usage: %s [options]\n", cmd);
+    fprintf(stderr, "options include:\n"
+                    "  -b N            use a trace buffer size of N KB\n"
+                    "  -c              trace into a circular buffer\n"
+                    "  -f              trace CPU frequency changes\n"
+                    "  -l              trace CPU frequency governor load\n"
+                    "  -s              trace the kernel scheduler switches\n"
+                    "  -t N            trace for N seconds [defualt 5]\n"
+                    "  -w              trace the kernel workqueue\n");
+}
+
+static void handleSignal(int signo) {
+    g_traceAborted = true;
+}
+
+static void registerSigHandler() {
+    struct sigaction sa;
+    sigemptyset(&sa.sa_mask);
+    sa.sa_flags = 0;
+    sa.sa_handler = handleSignal;
+    sigaction(SIGHUP, &sa, NULL);
+    sigaction(SIGINT, &sa, NULL);
+    sigaction(SIGQUIT, &sa, NULL);
+    sigaction(SIGTERM, &sa, NULL);
+}
+
+int main(int argc, char **argv)
+{
+    if (argc == 2 && 0 == strcmp(argv[1], "--help")) {
+        showHelp(argv[0]);
+        exit(0);
+    }
+
+    if (getuid() != 0) {
+        fprintf(stderr, "error: %s must be run as root.", argv[0]);
+        exit(1);
+    }
+
+    for (;;) {
+        int ret;
+
+        ret = getopt(argc, argv, "b:cflst:w");
+
+        if (ret < 0) {
+            break;
+        }
+
+        switch(ret) {
+            case 'b':
+                g_traceBufferSizeKB = atoi(optarg);
+            break;
+
+            case 'c':
+                g_traceOverwrite = true;
+            break;
+
+            case 'l':
+                g_traceGovernorLoad = true;
+            break;
+
+            case 'f':
+                g_traceCpuFrequency = true;
+            break;
+
+            case 's':
+                g_traceSchedSwitch = true;
+            break;
+
+            case 't':
+                g_traceDurationSeconds = atoi(optarg);
+            break;
+
+            case 'w':
+                g_traceWorkqueue = true;
+            break;
+
+            default:
+                fprintf(stderr, "\n");
+                showHelp(argv[0]);
+                exit(-1);
+            break;
+        }
+    }
+
+    registerSigHandler();
+
+    bool ok = startTrace();
+
+    if (ok) {
+        printf("capturing trace...");
+        fflush(stdout);
+
+        // We clear the trace after starting it because tracing gets enabled for
+        // each CPU individually in the kernel. Having the beginning of the trace
+        // contain entries from only one CPU can cause "begin" entries without a
+        // matching "end" entry to show up if a task gets migrated from one CPU to
+        // another.
+        ok = clearTrace();
+
+        if (ok) {
+            // Sleep to allow the trace to be captured.
+            struct timespec timeLeft;
+            timeLeft.tv_sec = g_traceDurationSeconds;
+            timeLeft.tv_nsec = 0;
+            do {
+                if (g_traceAborted) {
+                    break;
+                }
+            } while (nanosleep(&timeLeft, &timeLeft) == -1 && errno == EINTR);
+        }
+    }
+
+    // Stop the trace and restore the default settings.
+    stopTrace();
+
+    if (ok) {
+        if (!g_traceAborted) {
+            printf(" done\nTRACE:\n");
+            fflush(stdout);
+            dumpTrace();
+        } else {
+            printf("\ntrace aborted.\n");
+            fflush(stdout);
+        }
+        clearTrace();
+    } else {
+        fprintf(stderr, "unable to start tracing\n");
+    }
+
+    // Reset the trace buffer size to 1.
+    setTraceBufferSizeKB(1);
+
+    return g_traceAborted ? 1 : 0;
+}
diff --git a/bugmailer/Android.mk b/bugmailer/Android.mk
index 9ae4fd8..1bb3099 100644
--- a/bugmailer/Android.mk
+++ b/bugmailer/Android.mk
@@ -1,9 +1,12 @@
 # Copyright 2011 The Android Open Source Project
 #
 LOCAL_PATH:= $(call my-dir)
+
+ifneq ($(TARGET_BUILD_PDK), true)
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_MODULE := send_bug
 LOCAL_MODULE_TAGS := optional
 include $(BUILD_JAVA_LIBRARY)
+endif
diff --git a/bugmailer/src/com/android/commands/sendbug/SendBug.java b/bugmailer/src/com/android/commands/sendbug/SendBug.java
index 41a550a..da8788e 100644
--- a/bugmailer/src/com/android/commands/sendbug/SendBug.java
+++ b/bugmailer/src/com/android/commands/sendbug/SendBug.java
@@ -71,8 +71,8 @@
             }
             final IActivityManager mAm = ActivityManagerNative.getDefault();
             try {
-                mAm.startActivity(null, intent, intent.getType(), null, 0, null, null, 0, false,
-                        false, null, null, false);
+                mAm.startActivity(null, intent, intent.getType(), null, null, 0, 0,
+                        null, null, null);
             } catch (RemoteException e) {
                 // ignore
             }
@@ -87,7 +87,7 @@
         if (mPm != null) {
             final List<ResolveInfo> results;
             try {
-                results = mPm.queryIntentActivities(intent, null, 0);
+                results = mPm.queryIntentActivities(intent, null, 0, 0);
             } catch (RemoteException e) {
                 return null;
             }
diff --git a/ext4_utils/Android.mk b/ext4_utils/Android.mk
index 10b6285..d12a6be 100644
--- a/ext4_utils/Android.mk
+++ b/ext4_utils/Android.mk
@@ -4,7 +4,7 @@
 include $(CLEAR_VARS)
 
 libext4_utils_src_files := \
-	make_ext4fs.c \
+        make_ext4fs.c \
         ext4fixup.c \
         ext4_utils.c \
         allocate.c \
@@ -15,8 +15,40 @@
         indirect.c \
         uuid.c \
         sha1.c \
-	sparse_crc32.c \
-	wipe.c
+        sparse_crc32.c \
+        wipe.c
+
+# -- All host/targets including windows
+
+LOCAL_SRC_FILES := $(libext4_utils_src_files)
+LOCAL_MODULE := libext4_utils
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES += external/zlib
+
+ifeq ($(HAVE_SELINUX), true)
+LOCAL_C_INCLUDES += external/libselinux/include
+LOCAL_SHARED_LIBRARIES += libselinux
+LOCAL_CFLAGS += -DHAVE_SELINUX
+endif # HAVE_SELINUX
+
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := make_ext4fs_main.c
+LOCAL_MODULE := make_ext4fs
+LOCAL_STATIC_LIBRARIES += libext4_utils libz
+ifeq ($(HOST_OS),windows)
+LOCAL_LDLIBS += -lws2_32
+endif
+
+include $(BUILD_HOST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+
+# -- All host/targets excluding windows
+
+ifneq ($(HOST_OS),windows)
 
 LOCAL_SRC_FILES := $(libext4_utils_src_files)
 LOCAL_MODULE := libext4_utils
@@ -38,7 +70,6 @@
 LOCAL_MODULE := libext4_utils
 LOCAL_MODULE_TAGS := optional
 LOCAL_C_INCLUDES += external/zlib
-LOCAL_STATIC_LIBRARIES := libz
 
 ifeq ($(HAVE_SELINUX), true)
 LOCAL_C_INCLUDES += external/libselinux/include
@@ -50,21 +81,6 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES := $(libext4_utils_src_files)
-LOCAL_MODULE := libext4_utils
-LOCAL_MODULE_TAGS := optional
-LOCAL_SHARED_LIBRARIES := libz
-
-ifeq ($(HAVE_SELINUX), true)
-LOCAL_C_INCLUDES += external/libselinux/include
-LOCAL_SHARED_LIBRARIES += libselinux
-LOCAL_CFLAGS += -DHAVE_SELINUX
-endif # HAVE_SELINUX
-
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
 LOCAL_SRC_FILES := make_ext4fs_main.c
 LOCAL_MODULE := make_ext4fs
 LOCAL_MODULE_TAGS := optional
@@ -80,20 +96,6 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES := make_ext4fs_main.c
-LOCAL_MODULE := make_ext4fs
-LOCAL_STATIC_LIBRARIES += libext4_utils libz
-
-ifeq ($(HAVE_SELINUX), true)
-LOCAL_C_INCLUDES += external/libselinux/include
-LOCAL_STATIC_LIBRARIES += libselinux
-LOCAL_CFLAGS += -DHAVE_SELINUX
-endif # HAVE_SELINUX
-
-include $(BUILD_HOST_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
 LOCAL_SRC_FILES := ext2simg.c
 LOCAL_MODULE := ext2simg
 LOCAL_MODULE_TAGS := optional
@@ -127,6 +129,7 @@
 LOCAL_SRC_FILES := simg2img.c \
 	sparse_crc32.c
 LOCAL_MODULE := simg2img
+LOCAL_MODULE_TAGS := debug
 
 include $(BUILD_HOST_EXECUTABLE)
 
@@ -135,6 +138,23 @@
 LOCAL_SRC_FILES := simg2img.c \
 	sparse_crc32.c
 LOCAL_MODULE := simg2img
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := img2simg.c
+LOCAL_MODULE := img2simg
+LOCAL_MODULE_TAGS := debug
+
+include $(BUILD_HOST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := img2simg.c
+LOCAL_MODULE := img2simg
+LOCAL_MODULE_TAGS := optional
 
 include $(BUILD_EXECUTABLE)
 
@@ -174,3 +194,15 @@
 LOCAL_IS_HOST_MODULE := true
 
 include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := simg_dump.py
+LOCAL_MODULE_TAGS := debug
+LOCAL_SRC_FILES := simg_dump.py
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_IS_HOST_MODULE := true
+
+include $(BUILD_PREBUILT)
+
+endif
diff --git a/ext4_utils/backed_block.c b/ext4_utils/backed_block.c
index f8399ef..c0070f1 100644
--- a/ext4_utils/backed_block.c
+++ b/ext4_utils/backed_block.c
@@ -150,7 +150,7 @@
 /* Frees the memory used by the linked list of data blocks */
 void free_data_blocks()
 {
-        if (!data_blocks) return;
+	if (!data_blocks) return;
 	struct data_block *db = data_blocks;
 	while (db) {
 		struct data_block *next = db->next;
@@ -167,6 +167,6 @@
 		free(db);
 		db = next;
 	}
-        data_blocks = NULL;
-        last_used = NULL;
+	data_blocks = NULL;
+	last_used = NULL;
 }
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c
index 71143bc..de38bb0 100644
--- a/ext4_utils/contents.c
+++ b/ext4_utils/contents.c
@@ -27,6 +27,10 @@
 #include "indirect.h"
 #include "xattr.h"
 
+#ifdef USE_MINGW
+#define S_IFLNK 0  /* used by make_link, not needed under mingw */
+#endif
+
 static u32 dentry_size(u32 entries, struct dentry *dentries)
 {
 	u32 len = 24;
diff --git a/ext4_utils/ext2simg.c b/ext4_utils/ext2simg.c
index 9332bad..1fe085a 100644
--- a/ext4_utils/ext2simg.c
+++ b/ext4_utils/ext2simg.c
@@ -28,6 +28,10 @@
 #include <libgen.h>
 #include <unistd.h>
 
+#ifndef USE_MINGW /* O_BINARY is windows-specific flag */
+#define O_BINARY 0
+#endif
+
 extern struct fs_info info;
 
 static int verbose = 0;
@@ -169,7 +173,7 @@
 	const char *out = NULL;
 	int gzip = 0;
 	int sparse = 1;
-	int fd;
+	int infd, outfd;
 	int crc = 0;
 
 	while ((opt = getopt(argc, argv, "cvzS")) != -1) {
@@ -211,18 +215,29 @@
 		exit(EXIT_FAILURE);
 	}
 
-	fd = open(in, O_RDONLY);
+	infd = open(in, O_RDONLY);
 
-	if (fd < 0)
+	if (infd < 0)
 		critical_error_errno("failed to open input image");
 
-	read_ext(fd);
+	read_ext(infd);
 
-	build_sparse_ext(fd, in);
+	build_sparse_ext(infd, in);
 
-	close(fd);
+	close(infd);
 
-	write_ext4_image(out, gzip, sparse, crc, 0);
+	if (strcmp(out, "-")) {
+		outfd = open(out, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
+		if (outfd < 0) {
+			error_errno("open");
+			return EXIT_FAILURE;
+		}
+	} else {
+		outfd = STDOUT_FILENO;
+	}
+
+	write_ext4_image(outfd, gzip, sparse, crc, 0);
+	close(outfd);
 
 	return 0;
 }
diff --git a/ext4_utils/ext4_utils.c b/ext4_utils/ext4_utils.c
index 3d5895e..7f226c8 100644
--- a/ext4_utils/ext4_utils.c
+++ b/ext4_utils/ext4_utils.c
@@ -23,12 +23,17 @@
 #include "extent.h"
 
 #include <fcntl.h>
-#include <arpa/inet.h>
-#include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <string.h>
 
+#ifdef USE_MINGW
+#include <winsock2.h>
+#else
+#include <arpa/inet.h>
+#include <sys/ioctl.h>
+#endif
+
 #if defined(__linux__)
 #include <linux/fs.h>
 #elif defined(__APPLE__) && defined(__MACH__)
@@ -137,11 +142,11 @@
 }
 
 /* Write the filesystem image to a file */
-void write_ext4_image(const char *filename, int gz, int sparse, int crc,
-		int wipe)
+void write_ext4_image(int fd, int gz, int sparse, int crc, int wipe)
 {
 	int ret = 0;
-	struct output_file *out = open_output_file(filename, gz, sparse,
+
+	struct output_file *out = open_output_fd(fd, gz, sparse,
 	        count_sparse_chunks(), crc, wipe);
 
 	if (!out)
@@ -446,15 +451,11 @@
 	}
 }
 
-static u64 get_block_device_size(const char *filename)
+static u64 get_block_device_size(int fd)
 {
-	int fd = open(filename, O_RDONLY);
 	u64 size = 0;
 	int ret;
 
-	if (fd < 0)
-		return 0;
-
 #if defined(__linux__)
 	ret = ioctl(fd, BLKGETSIZE64, &size);
 #elif defined(__APPLE__) && defined(__MACH__)
@@ -464,22 +465,20 @@
 	return 0;
 #endif
 
-	close(fd);
-
 	if (ret)
 		return 0;
 
 	return size;
 }
 
-u64 get_file_size(const char *filename)
+u64 get_file_size(int fd)
 {
 	struct stat buf;
 	int ret;
 	u64 reserve_len = 0;
 	s64 computed_size;
 
-	ret = stat(filename, &buf);
+	ret = fstat(fd, &buf);
 	if (ret)
 		return 0;
 
@@ -489,7 +488,7 @@
 	if (S_ISREG(buf.st_mode))
 		computed_size = buf.st_size - reserve_len;
 	else if (S_ISBLK(buf.st_mode))
-		computed_size = get_block_device_size(filename) - reserve_len;
+		computed_size = get_block_device_size(fd) - reserve_len;
 	else
 		computed_size = 0;
 
@@ -514,4 +513,3 @@
 
 	return num;
 }
-
diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/ext4_utils.h
index 94f4bc9..1d701d0 100644
--- a/ext4_utils/ext4_utils.h
+++ b/ext4_utils/ext4_utils.h
@@ -17,7 +17,13 @@
 #ifndef _EXT4_UTILS_H_
 #define _EXT4_UTILS_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #define _FILE_OFFSET_BITS 64
 #define _LARGEFILE64_SOURCE
 #include <sys/types.h>
@@ -58,7 +64,9 @@
 #define EXT4_SUPER_MAGIC 0xEF53
 #define EXT4_JNL_BACKUP_BLOCKS 1
 
+#ifndef min /* already defined by windows.h */
 #define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
 
 #define DIV_ROUND_UP(x, y) (((x) + (y) - 1)/(y))
 #define ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y)))
@@ -145,7 +153,7 @@
 }
 
 int ext4_bg_has_super_block(int bg);
-void write_ext4_image(const char *filename, int gz, int sparse, int crc,
+void write_ext4_image(int fd, int gz, int sparse, int crc,
 		int wipe);
 void ext4_create_fs_aux_info(void);
 void ext4_free_fs_aux_info(void);
@@ -154,8 +162,12 @@
 void ext4_create_journal_inode(void);
 void ext4_update_free(void);
 void ext4_queue_sb(void);
-u64 get_file_size(const char *filename);
+u64 get_file_size(int fd);
 u64 parse_num(const char *arg);
 void ext4_parse_sb(struct ext4_super_block *sb);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/ext4_utils/ext4fixup.c b/ext4_utils/ext4fixup.c
index 5e04602..c664ac3 100644
--- a/ext4_utils/ext4fixup.c
+++ b/ext4_utils/ext4fixup.c
@@ -24,10 +24,13 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
+#ifndef USE_MINGW
+#include <sys/mman.h>
+#endif
+
 #if defined(__APPLE__) && defined(__MACH__)
 #define lseek64 lseek
 #define off64_t off_t
diff --git a/ext4_utils/img2simg.c b/ext4_utils/img2simg.c
new file mode 100644
index 0000000..3b46613
--- /dev/null
+++ b/ext4_utils/img2simg.c
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2010-2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define DEFAULT_BLOCK_SIZE	"4K"
+#define DEFAULT_CHUNK_SIZE	"64M"
+#define DEFAULT_SUFFIX		"%03d"
+
+#include "ext4_utils.h"
+#include "sparse_format.h"
+#if 0 /* endian.h is not on all platforms */
+# include <endian.h>
+#else
+  /* For now, just assume we're going to run on little-endian. */
+# define my_htole32(h) (h)
+# define my_htole16(h) (h)
+#endif
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#define COPY_BUF_SIZE (1024*1024)
+static char *copy_buf;
+
+static const char *progname(const char *argv0)
+{
+    const char *prog_name;
+    if ((prog_name = strrchr(argv0, '/')))
+	return(prog_name + 1);	/* Advance beyond '/'. */
+    return(argv0);		/* No '/' in argv0, use it as is. */
+}
+
+static void error_exit(const char *fmt, ...)
+{
+    va_list ap;
+    va_start(ap, fmt);
+    vfprintf(stderr, fmt, ap);
+    fputc('\n', stderr);
+    va_end(ap);
+
+    exit(EXIT_FAILURE);
+}
+
+static void usage(const char *argv0, const char *error_fmt, ...)
+{
+    fprintf(stderr,
+	    "Usage: %s [OPTIONS] <raw_image_file>\n",
+	    progname(argv0));
+    fprintf(stderr, "The <raw_image_file> will be split into as many sparse\n");
+    fprintf(stderr, "files as needed.  Each sparse file will contain a single\n");
+    fprintf(stderr, "DONT CARE chunk to offset to the correct block and then\n");
+    fprintf(stderr, "a single RAW chunk containing a portion of the data from\n");
+    fprintf(stderr, "the raw image file.  The sparse files will be named by\n");
+    fprintf(stderr, "appending a number to the name of the raw image file.\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "OPTIONS (Defaults are enclosed by square brackets):\n");
+    fprintf(stderr, "  -s SUFFIX      Format appended number with SUFFIX [%s]\n",
+	    DEFAULT_SUFFIX);
+    fprintf(stderr, "  -B SIZE        Use a block size of SIZE [%s]\n",
+	    DEFAULT_BLOCK_SIZE);
+    fprintf(stderr, "  -C SIZE        Use a chunk size of SIZE [%s]\n",
+	    DEFAULT_CHUNK_SIZE);
+    fprintf(stderr, "SIZE is a decimal integer that may optionally be\n");
+    fprintf(stderr, "followed by a suffix that specifies a multiplier for\n");
+    fprintf(stderr, "the integer:\n");
+    fprintf(stderr, "       c         1 byte (the default when omitted)\n");
+    fprintf(stderr, "       w         2 bytes\n");
+    fprintf(stderr, "       b         512 bytes\n");
+    fprintf(stderr, "       kB        1000 bytes\n");
+    fprintf(stderr, "       K         1024 bytes\n");
+    fprintf(stderr, "       MB        1000*1000 bytes\n");
+    fprintf(stderr, "       M         1024*1024 bytes\n");
+    fprintf(stderr, "       GB        1000*1000*1000 bytes\n");
+    fprintf(stderr, "       G         1024*1024*1024 bytes\n");
+
+    if (error_fmt && *error_fmt)
+    {
+	fprintf(stderr, "\n");
+	va_list ap;
+	va_start(ap, error_fmt);
+	vfprintf(stderr, error_fmt, ap);
+	va_end(ap);
+	fprintf(stderr, "\n");
+    }
+
+    exit(EXIT_FAILURE);
+}
+
+static void cpy_file(int out_fd, char *out_path, int in_fd, char *in_path,
+		     size_t len)
+{
+    ssize_t s, cpy_len = COPY_BUF_SIZE;
+
+    while (len) {
+	if (len < COPY_BUF_SIZE)
+	    cpy_len = len;
+
+	s = read(in_fd, copy_buf, cpy_len);
+	if (s < 0)
+	    error_exit("\"%s\": %s", in_path, strerror(errno));
+	if (!s)
+	    error_exit("\"%s\": Unexpected EOF", in_path);
+
+	cpy_len = s;
+
+	s = write(out_fd, copy_buf, cpy_len);
+	if (s < 0)
+	    error_exit("\"%s\": %s", out_path, strerror(errno));
+	if (s != cpy_len)
+	    error_exit("\"%s\": Short data write (%lu)", out_path,
+		       (unsigned long)s);
+
+	len -= cpy_len;
+    }
+}
+
+static int parse_size(const char *size_str, size_t *size)
+{
+    static const size_t MAX_SIZE_T = ~(size_t)0;
+    size_t mult;
+    unsigned long long int value;
+    const char *end;
+    errno = 0;
+    value = strtoull(size_str, (char **)&end, 10);
+    if (errno != 0 || end == size_str || value > MAX_SIZE_T)
+	return -1;
+    if (*end == '\0') {
+	*size = value;
+	return 0;
+    }
+    if (!strcmp(end, "c"))
+	mult = 1;
+    else if (!strcmp(end, "w"))
+	mult = 2;
+    else if (!strcmp(end, "b"))
+	mult = 512;
+    else if (!strcmp(end, "kB"))
+	mult = 1000;
+    else if (!strcmp(end, "K"))
+	mult = 1024;
+    else if (!strcmp(end, "MB"))
+	mult = (size_t)1000*1000;
+    else if (!strcmp(end, "M"))
+	mult = (size_t)1024*1024;
+    else if (!strcmp(end, "GB"))
+	mult = (size_t)1000*1000*1000;
+    else if (!strcmp(end, "G"))
+	mult = (size_t)1024*1024*1024;
+    else
+	return -1;
+
+    if (value > MAX_SIZE_T / mult)
+	return -1;
+    *size = value * mult;
+    return 0;
+}
+
+int main(int argc, char *argv[])
+{
+    char *suffix = DEFAULT_SUFFIX;
+    char *block_size_str = DEFAULT_BLOCK_SIZE;
+    char *chunk_size_str = DEFAULT_CHUNK_SIZE;
+    size_t block_size, chunk_size, blocks_per_chunk, to_write;
+    char *in_path, *out_path, *out_fmt;
+    int in_fd, out_fd;
+    struct stat in_st;
+    off_t left_to_write;
+    struct {
+	sparse_header_t sparse_hdr;
+	chunk_header_t dont_care_hdr;
+	chunk_header_t raw_hdr;
+    } file_hdr;
+    unsigned int file_count;
+    ssize_t s;
+    int i;
+
+    /* Parse the command line. */
+    while ((i = getopt(argc, argv, "s:B:C:")) != -1)
+    {
+	switch (i) {
+	case 's':
+	    suffix = optarg;
+	    break;
+	case 'B':
+	    block_size_str = optarg;
+	    break;
+	case 'C':
+	    chunk_size_str = optarg;
+	    break;
+	default:
+	    usage(argv[0], NULL);
+	    break;
+	}
+    }
+
+    if (parse_size(block_size_str, &block_size))
+	usage(argv[0], "Can not parse \"%s\" as a block size.",
+	      block_size_str);
+    if (block_size % 4096)
+	usage(argv[0], "Block size is not a multiple of 4096.");
+
+    if (parse_size(chunk_size_str, &chunk_size))
+	usage(argv[0], "Can not parse \"%s\" as a chunk size.",
+	      chunk_size_str);
+    if (chunk_size % block_size)
+	usage(argv[0], "Chunk size is not a multiple of the block size.");
+    blocks_per_chunk = chunk_size / block_size;
+
+    if ((argc - optind) != 1)
+	usage(argv[0], "Missing or extra arguments.");
+    in_path = argv[optind];
+
+    /* Open the input file and validate it. */
+    if ((in_fd = open(in_path, O_RDONLY)) < 0)
+	error_exit("open \"%s\": %s", in_path, strerror(errno));
+    if (fstat(in_fd, &in_st))
+	error_exit("fstat \"%s\": %s", in_path, strerror(errno));
+    left_to_write = in_st.st_size;
+    if (left_to_write % block_size)
+	error_exit(
+	    "\"%s\" size (%llu) is not a multiple of the block size (%llu).\n",
+	    in_path,
+	    (unsigned long long)left_to_write, (unsigned long long)block_size);
+
+    /* Get a buffer for copying the chunks. */
+    if ((copy_buf = malloc(COPY_BUF_SIZE)) == 0)
+	error_exit("malloc copy buffer: %s", strerror(errno));
+
+    /* Get a buffer for a sprintf format to form output paths. */
+    if ((out_fmt = malloc(sizeof("%s") + strlen(suffix))) == 0)
+	error_exit("malloc format buffer: %s", strerror(errno));
+    out_fmt[0] = '%';
+    out_fmt[1] = 's';
+    strcpy(out_fmt + 2, suffix);
+
+    /* Get a buffer for an output path. */
+    i = snprintf(copy_buf, COPY_BUF_SIZE, out_fmt, in_path, UINT_MAX);
+    if (i >= COPY_BUF_SIZE)
+	error_exit("Ridulously long suffix: %s", suffix);
+    if ((out_path = malloc(i + 1)) == 0)
+	error_exit("malloc output path buffer: %s", strerror(errno));
+
+    /*
+     * Each file gets a sparse_header, a Don't Care chunk to offset to
+     * where the data belongs and then a Raw chunk with the actual data.
+     */
+    memset((void *)&file_hdr.sparse_hdr, 0, sizeof(file_hdr.sparse_hdr));
+    file_hdr.sparse_hdr.magic = my_htole32(SPARSE_HEADER_MAGIC);
+    file_hdr.sparse_hdr.major_version = my_htole16(1);
+    file_hdr.sparse_hdr.minor_version = my_htole16(0);
+    file_hdr.sparse_hdr.file_hdr_sz = my_htole16(sizeof(sparse_header_t));
+    file_hdr.sparse_hdr.chunk_hdr_sz = my_htole16(sizeof(chunk_header_t));
+    file_hdr.sparse_hdr.blk_sz = my_htole32(block_size);
+    /* The total_blks will be set in the file loop below. */
+    file_hdr.sparse_hdr.total_chunks = my_htole32(2);
+    file_hdr.sparse_hdr.image_checksum = my_htole32(0); /* Typically unused. */
+
+    memset((void *)&file_hdr.dont_care_hdr, 0, sizeof(file_hdr.dont_care_hdr));
+    file_hdr.dont_care_hdr.chunk_type = my_htole16(CHUNK_TYPE_DONT_CARE);
+    /* The Don't Care's chunk_sz will be set in the file loop below. */
+    file_hdr.dont_care_hdr.total_sz = my_htole32(sizeof(chunk_header_t));
+
+    memset((void *)&file_hdr.raw_hdr, 0, sizeof(file_hdr.raw_hdr));
+    file_hdr.raw_hdr.chunk_type = my_htole16(CHUNK_TYPE_RAW);
+    file_hdr.raw_hdr.chunk_sz = my_htole32(blocks_per_chunk);
+    file_hdr.raw_hdr.total_sz = my_htole32(chunk_size + sizeof(chunk_header_t));
+
+    /* Loop through writing chunk_size to each of the output files. */
+    to_write = chunk_size;
+    for (file_count = 1; left_to_write ; file_count++) {
+	/* Fix up the headers on the last block. */
+	if (left_to_write < (off_t)chunk_size) {
+	    to_write = left_to_write;
+	    file_hdr.raw_hdr.chunk_sz = my_htole32(left_to_write / block_size);
+	    file_hdr.raw_hdr.total_sz = my_htole32(left_to_write
+						+ sizeof(chunk_header_t));
+	}
+
+	/* Form the pathname for this output file and open it. */
+	sprintf(out_path, out_fmt, in_path, file_count);
+	if ((out_fd = creat(out_path, 0666)) < 0)
+	    error_exit("\"%s\": %s", out_path, strerror(errno));
+
+	/* Update and write the headers to this output file. */
+	s = (file_count-1) * blocks_per_chunk;
+	file_hdr.dont_care_hdr.chunk_sz = my_htole32(s);
+	file_hdr.sparse_hdr.total_blks = my_htole32(s
+						+ (to_write / block_size));
+	s = write(out_fd, (void *)&file_hdr, sizeof(file_hdr));
+	if (s < 0)
+	    error_exit("\"%s\": %s", out_path, strerror(errno));
+	if (s != sizeof(file_hdr))
+	    error_exit("\"%s\": Short write (%lu)", out_path, (unsigned long)s);
+
+	/* Copy this chunk from the input file to the output file. */
+	cpy_file(out_fd, out_path, in_fd, in_path, to_write);
+
+	/* Close this output file and update the amount left to write. */
+	if (close(out_fd))
+	    error_exit("close \"%s\": %s", out_path, strerror(errno));
+	left_to_write -= to_write;
+    }
+
+    if (close(in_fd))
+	error_exit("close \"%s\": %s", in_path, strerror(errno));
+
+    exit(EXIT_SUCCESS);
+}
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index af05eb3..6cd5ade 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -22,7 +22,9 @@
 #include "uuid.h"
 #include "backed_block.h"
 
+#include <assert.h>
 #include <dirent.h>
+#include <fcntl.h>
 #include <libgen.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -31,8 +33,33 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#ifdef ANDROID
-#include <private/android_filesystem_config.h>
+#ifdef USE_MINGW
+
+#include <winsock2.h>
+
+/* These match the Linux definitions of these flags.
+   L_xx is defined to avoid conflicting with the win32 versions.
+*/
+#define L_S_IRUSR 00400
+#define L_S_IWUSR 00200
+#define L_S_IXUSR 00100
+#define S_IRWXU (L_S_IRUSR | L_S_IWUSR | L_S_IXUSR)
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+#define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
+#define S_ISUID 0004000
+#define S_ISGID 0002000
+#define S_ISVTX 0001000
+
+#else
+
+#define O_BINARY 0
+
 #endif
 
 /* TODO: Not implemented:
@@ -67,10 +94,12 @@
 	return root_inode;
 }
 
+#ifndef USE_MINGW
 /* Read a local directory and create the same tree in the generated filesystem.
    Calls itself recursively with each directory in the given directory */
 static u32 build_directory_structure(const char *full_path, const char *dir_path,
-		     u32 dir_inode, int android, struct selabel_handle *sehnd)
+		u32 dir_inode, fs_config_func_t fs_config_func,
+		struct selabel_handle *sehnd)
 {
 	int entries = 0;
 	struct dentry *dentries;
@@ -113,13 +142,13 @@
 		dentries[i].size = stat.st_size;
 		dentries[i].mode = stat.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
 		dentries[i].mtime = stat.st_mtime;
-		if (android) {
+		if (fs_config_func != NULL) {
 #ifdef ANDROID
 			unsigned int mode = 0;
 			unsigned int uid = 0;
 			unsigned int gid = 0;
 			int dir = S_ISDIR(stat.st_mode);
-			fs_config(dentries[i].path, dir, &uid, &gid, &mode);
+			fs_config_func(dentries[i].path, dir, &uid, &gid, &mode);
 			dentries[i].mode = mode;
 			dentries[i].uid = uid;
 			dentries[i].gid = gid;
@@ -172,7 +201,7 @@
 			entry_inode = make_file(dentries[i].full_path, dentries[i].size);
 		} else if (dentries[i].file_type == EXT4_FT_DIR) {
 			entry_inode = build_directory_structure(dentries[i].full_path,
-					dentries[i].path, inode, android, sehnd);
+					dentries[i].path, inode, fs_config_func, sehnd);
 		} else if (dentries[i].file_type == EXT4_FT_SYMLINK) {
 			entry_inode = make_link(dentries[i].full_path, dentries[i].link);
 		} else {
@@ -200,6 +229,7 @@
 	free(dentries);
 	return inode;
 }
+#endif
 
 static u32 compute_block_size()
 {
@@ -269,29 +299,40 @@
 int make_ext4fs(const char *filename, s64 len,
                 const char *mountpoint, struct selabel_handle *sehnd)
 {
-    reset_ext4fs_info();
-    info.len = len;
-    return make_ext4fs_internal(filename, NULL, mountpoint, 0, 0, 0, 0, 1, 0, sehnd);
+	int fd;
+	int status;
+
+	reset_ext4fs_info();
+	info.len = len;
+
+	fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
+	if (fd < 0) {
+		error_errno("open");
+		return EXIT_FAILURE;
+	}
+
+	status = make_ext4fs_internal(fd, NULL, mountpoint, NULL, 0, 0, 0, 1, 0, sehnd);
+	close(fd);
+
+	return status;
 }
 
-int make_ext4fs_internal(const char *filename, const char *directory,
-                         const char *mountpoint,
-                         int android, int gzip, int sparse,
-                         int crc, int wipe, int init_itabs,
-                         struct selabel_handle *sehnd)
+int make_ext4fs_internal(int fd, const char *directory,
+                         char *mountpoint, fs_config_func_t fs_config_func, int gzip, int sparse,
+                         int crc, int wipe, int init_itabs, struct selabel_handle *sehnd)
 {
-        u32 root_inode_num;
-        u16 root_mode;
+	u32 root_inode_num;
+	u16 root_mode;
 
 	if (setjmp(setjmp_env))
 		return EXIT_FAILURE; /* Handle a call to longjmp() */
 
 	if (info.len <= 0)
-		info.len = get_file_size(filename);
+		info.len = get_file_size(fd);
 
 	if (info.len <= 0) {
 		fprintf(stderr, "Need size of filesystem\n");
-                return EXIT_FAILURE;
+		return EXIT_FAILURE;
 	}
 
 	if (info.block_size <= 0)
@@ -364,10 +405,17 @@
 	if (info.feat_compat & EXT4_FEATURE_COMPAT_RESIZE_INODE)
 		ext4_create_resize_inode();
 
+#ifdef USE_MINGW
+	// Windows needs only 'create an empty fs image' functionality
+	assert(!directory);
+	root_inode_num = build_default_directory_structure();
+#else
 	if (directory)
-		root_inode_num = build_directory_structure(directory, mountpoint, 0, android, sehnd);
+		root_inode_num = build_directory_structure(directory, mountpoint, 0,
+                        fs_config_func, sehnd);
 	else
 		root_inode_num = build_default_directory_structure();
+#endif
 
 	root_mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
 	inode_set_permissions(root_inode_num, root_mode, 0, 0, 0);
@@ -408,7 +456,7 @@
 			aux_info.sb->s_blocks_count_lo - aux_info.sb->s_free_blocks_count_lo,
 			aux_info.sb->s_blocks_count_lo);
 
-	write_ext4_image(filename, gzip, sparse, crc, wipe);
+	write_ext4_image(fd, gzip, sparse, crc, wipe);
 
 	return 0;
 }
diff --git a/ext4_utils/make_ext4fs.h b/ext4_utils/make_ext4fs.h
index 53ff840..c217c3d 100644
--- a/ext4_utils/make_ext4fs.h
+++ b/ext4_utils/make_ext4fs.h
@@ -20,6 +20,10 @@
 #include "ext4_utils.h"
 #include "ext4.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
 #include <selinux/label.h>
@@ -27,13 +31,18 @@
 struct selabel_handle;
 #endif
 
+typedef void (*fs_config_func_t)(const char *path, int dir, unsigned *uid, unsigned *gid,
+        unsigned *mode);
+
 void reset_ext4fs_info();
 int make_ext4fs(const char *filename, s64 len,
                 const char *mountpoint, struct selabel_handle *sehnd);
-int make_ext4fs_internal(const char *filename, const char *directory,
-                         const char *mountpoint,
-                         int android, int gzip, int sparse,
-                         int crc, int wipe, int init_itabs,
-                         struct selabel_handle *sehnd);
+int make_ext4fs_internal(int fd, const char *directory,
+                         char *mountpoint, fs_config_func_t fs_config_func, int gzip, int sparse,
+                         int crc, int wipe, int init_itabs, struct selabel_handle *sehnd);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif
diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c
index 6a885d2..d545423 100644
--- a/ext4_utils/make_ext4fs_main.c
+++ b/ext4_utils/make_ext4fs_main.c
@@ -14,8 +14,9 @@
  * limitations under the License.
  */
 
-#include <unistd.h>
+#include <fcntl.h>
 #include <libgen.h>
+#include <unistd.h>
 
 #if defined(__linux__)
 #include <linux/fs.h>
@@ -23,137 +24,166 @@
 #include <sys/disk.h>
 #endif
 
+#ifdef ANDROID
+#include <private/android_filesystem_config.h>
+#endif
+
 #include "make_ext4fs.h"
 
+#ifndef USE_MINGW /* O_BINARY is windows-specific flag */
+#define O_BINARY 0
+#endif
+
 extern struct fs_info info;
 
 
 static void usage(char *path)
 {
-        fprintf(stderr, "%s [ -l <len> ] [ -j <journal size> ] [ -b <block_size> ]\n", basename(path));
-        fprintf(stderr, "    [ -g <blocks per group> ] [ -i <inodes> ] [ -I <inode size> ]\n");
-        fprintf(stderr, "    [ -L <label> ] [ -f ] [ -a <android mountpoint> ]\n");
-        fprintf(stderr, "    [ -S file_contexts ]\n");
-        fprintf(stderr, "    [ -z | -s ] [ -t ] [ -w ] [ -c ] [ -J ]\n");
-        fprintf(stderr, "    <filename> [<directory>]\n");
+	fprintf(stderr, "%s [ -l <len> ] [ -j <journal size> ] [ -b <block_size> ]\n", basename(path));
+	fprintf(stderr, "    [ -g <blocks per group> ] [ -i <inodes> ] [ -I <inode size> ]\n");
+	fprintf(stderr, "    [ -L <label> ] [ -f ] [ -a <android mountpoint> ]\n");
+	fprintf(stderr, "    [ -S file_contexts ]\n");
+	fprintf(stderr, "    [ -z | -s ] [ -t ] [ -w ] [ -c ] [ -J ]\n");
+	fprintf(stderr, "    <filename> [<directory>]\n");
 }
 
 int main(int argc, char **argv)
 {
-        int opt;
-        const char *filename = NULL;
-        const char *directory = NULL;
-        char *mountpoint = "";
-        int android = 0;
-        int gzip = 0;
-        int sparse = 0;
-        int crc = 0;
-        int wipe = 0;
-        int init_itabs = 0;
-        struct selabel_handle *sehnd = NULL;
+	int opt;
+	const char *filename = NULL;
+	const char *directory = NULL;
+	char *mountpoint = "";
+	fs_config_func_t fs_config_func = NULL;
+	int gzip = 0;
+	int sparse = 0;
+	int crc = 0;
+	int wipe = 0;
+	int init_itabs = 0;
+	int fd;
+	int exitcode;
+	struct selabel_handle *sehnd = NULL;
 #ifdef HAVE_SELINUX
-        struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } };
+	struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } };
 #endif
 
-        while ((opt = getopt(argc, argv, "l:j:b:g:i:I:L:a:fwzJsctS:")) != -1) {
-                switch (opt) {
-                case 'l':
-                        info.len = parse_num(optarg);
-                        break;
-                case 'j':
-                        info.journal_blocks = parse_num(optarg);
-                        break;
-                case 'b':
-                        info.block_size = parse_num(optarg);
-                        break;
-                case 'g':
-                        info.blocks_per_group = parse_num(optarg);
-                        break;
-                case 'i':
-                        info.inodes = parse_num(optarg);
-                        break;
-                case 'I':
-                        info.inode_size = parse_num(optarg);
-                        break;
-                case 'L':
-                        info.label = optarg;
-                        break;
-                case 'f':
-                        force = 1;
-                        break;
-                case 'a':
-                        android = 1;
-                        mountpoint = optarg;
-                        break;
-                case 'w':
-                        wipe = 1;
-                        break;
-                case 'z':
-                        gzip = 1;
-                        break;
+	while ((opt = getopt(argc, argv, "l:j:b:g:i:I:L:a:fwzJsctS:")) != -1) {
+		switch (opt) {
+		case 'l':
+			info.len = parse_num(optarg);
+			break;
+		case 'j':
+			info.journal_blocks = parse_num(optarg);
+			break;
+		case 'b':
+			info.block_size = parse_num(optarg);
+			break;
+		case 'g':
+			info.blocks_per_group = parse_num(optarg);
+			break;
+		case 'i':
+			info.inodes = parse_num(optarg);
+			break;
+		case 'I':
+			info.inode_size = parse_num(optarg);
+			break;
+		case 'L':
+			info.label = optarg;
+			break;
+		case 'f':
+			force = 1;
+			break;
+		case 'a':
+#ifdef ANDROID
+			fs_config_func = fs_config;
+			mountpoint = optarg;
+#else
+			fprintf(stderr, "can't set android permissions - built without android support\n");
+			usage(argv[0]);
+			exit(EXIT_FAILURE);
+#endif
+			break;
+		case 'w':
+			wipe = 1;
+			break;
+		case 'z':
+			gzip = 1;
+			break;
 		case 'J':
 			info.no_journal = 1;
 			break;
 		case 'c':
 			crc = 1;
 			break;
-                case 's':
-                        sparse = 1;
-                        break;
-                case 't':
-                        init_itabs = 1;
-                        break;
-                case 'S':
+		case 's':
+			sparse = 1;
+			break;
+		case 't':
+			init_itabs = 1;
+			break;
+		case 'S':
 #ifdef HAVE_SELINUX
-                        seopts[0].value = optarg;
-                        sehnd = selabel_open(SELABEL_CTX_FILE, seopts, 1);
-                        if (!sehnd) {
-                            perror(optarg);
-                            exit(EXIT_FAILURE);
-                        }
+			seopts[0].value = optarg;
+			sehnd = selabel_open(SELABEL_CTX_FILE, seopts, 1);
+			if (!sehnd) {
+				perror(optarg);
+				exit(EXIT_FAILURE);
+			}
 #endif
-                        break;
-                default: /* '?' */
-                        usage(argv[0]);
-                        exit(EXIT_FAILURE);
-                }
-        }
-
-	if (gzip && sparse) {
-                fprintf(stderr, "Cannot specify both gzip and sparse\n");
-                usage(argv[0]);
-                exit(EXIT_FAILURE);
+			   break;
+		default: /* '?' */
+			usage(argv[0]);
+			exit(EXIT_FAILURE);
+		}
 	}
 
-        if (wipe && sparse) {
-                fprintf(stderr, "Cannot specifiy both wipe and sparse\n");
-                usage(argv[0]);
-                exit(EXIT_FAILURE);
-        }
+	if (gzip && sparse) {
+		fprintf(stderr, "Cannot specify both gzip and sparse\n");
+		usage(argv[0]);
+		exit(EXIT_FAILURE);
+	}
 
-        if (wipe && gzip) {
-                fprintf(stderr, "Cannot specifiy both wipe and gzip\n");
-                usage(argv[0]);
-                exit(EXIT_FAILURE);
-        }
+	if (wipe && sparse) {
+		fprintf(stderr, "Cannot specifiy both wipe and sparse\n");
+		usage(argv[0]);
+		exit(EXIT_FAILURE);
+	}
 
-        if (optind >= argc) {
-                fprintf(stderr, "Expected filename after options\n");
-                usage(argv[0]);
-                exit(EXIT_FAILURE);
-        }
+	if (wipe && gzip) {
+		fprintf(stderr, "Cannot specifiy both wipe and gzip\n");
+		usage(argv[0]);
+		exit(EXIT_FAILURE);
+	}
 
-        filename = argv[optind++];
+	if (optind >= argc) {
+		fprintf(stderr, "Expected filename after options\n");
+		usage(argv[0]);
+		exit(EXIT_FAILURE);
+	}
 
-        if (optind < argc)
-                directory = argv[optind++];
+	filename = argv[optind++];
 
-        if (optind < argc) {
-                fprintf(stderr, "Unexpected argument: %s\n", argv[optind]);
-                usage(argv[0]);
-                exit(EXIT_FAILURE);
-        }
+	if (optind < argc)
+		directory = argv[optind++];
 
-        return make_ext4fs_internal(filename, directory, mountpoint, android, gzip,
-                       sparse, crc, wipe, init_itabs, sehnd);
+	if (optind < argc) {
+		fprintf(stderr, "Unexpected argument: %s\n", argv[optind]);
+		usage(argv[0]);
+		exit(EXIT_FAILURE);
+	}
+
+	if (strcmp(filename, "-")) {
+		fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
+		if (fd < 0) {
+			error_errno("open");
+			return EXIT_FAILURE;
+		}
+	} else {
+		fd = STDOUT_FILENO;
+	}
+
+	exitcode = make_ext4fs_internal(fd, directory, mountpoint, fs_config_func, gzip,
+			sparse, crc, wipe, init_itabs, sehnd);
+	close(fd);
+
+	return exitcode;
 }
diff --git a/ext4_utils/output_file.c b/ext4_utils/output_file.c
index d7cf91b..40655a9 100644
--- a/ext4_utils/output_file.c
+++ b/ext4_utils/output_file.c
@@ -20,15 +20,20 @@
 #include "sparse_crc32.h"
 #include "wipe.h"
 
+#include <fcntl.h>
+#include <stdbool.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 #include <unistd.h>
-#include <fcntl.h>
-
 #include <zlib.h>
 
+#ifndef USE_MINGW
+#include <sys/mman.h>
+#define O_BINARY 0
+#endif
+
+
 #if defined(__APPLE__) && defined(__MACH__)
 #define lseek64 lseek
 #define off64_t off_t
@@ -48,6 +53,7 @@
 struct output_file {
 	int fd;
 	gzFile gz_fd;
+	bool close_fd;
 	int sparse;
 	u64 cur_out_ptr;
 	u32 chunk_cnt;
@@ -85,7 +91,9 @@
 
 static void file_close(struct output_file *out)
 {
-	close(out->fd);
+	if (out->close_fd) {
+		close(out->fd);
+	}
 }
 
 
@@ -343,7 +351,7 @@
 	out->ops->close(out);
 }
 
-struct output_file *open_output_file(const char *filename, int gz, int sparse,
+struct output_file *open_output_fd(int fd, int gz, int sparse,
         int chunks, int crc, int wipe)
 {
 	int ret;
@@ -362,25 +370,17 @@
 
 	if (gz) {
 		out->ops = &gz_file_ops;
-		out->gz_fd = gzopen(filename, "wb9");
+		out->gz_fd = gzdopen(fd, "wb9");
 		if (!out->gz_fd) {
 			error_errno("gzopen");
 			free(out);
 			return NULL;
 		}
 	} else {
-		if (strcmp(filename, "-")) {
-			out->fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
-			if (out->fd < 0) {
-				error_errno("open");
-				free(out);
-				return NULL;
-			}
-		} else {
-			out->fd = STDOUT_FILENO;
-		}
+		out->fd = fd;
 		out->ops = &file_ops;
 	}
+	out->close_fd = false;
 	out->sparse = sparse;
 	out->cur_out_ptr = 0ll;
 	out->chunk_cnt = 0;
@@ -407,6 +407,33 @@
 	return out;
 }
 
+struct output_file *open_output_file(const char *filename, int gz, int sparse,
+        int chunks, int crc, int wipe) {
+
+	int fd;
+	struct output_file *file;
+
+	if (strcmp(filename, "-")) {
+		fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
+		if (fd < 0) {
+			error_errno("open");
+			return NULL;
+		}
+	} else {
+		fd = STDOUT_FILENO;
+	}
+
+	file = open_output_fd(fd, gz, sparse, chunks, crc, wipe);
+	if (!file) {
+		close(fd);
+		return NULL;
+	}
+
+	file->close_fd = true; // we opened descriptor thus we responsible for closing it
+
+	return file;
+}
+
 void pad_output_file(struct output_file *out, u64 len)
 {
 	int ret;
@@ -447,7 +474,7 @@
 void write_data_block(struct output_file *out, u64 off, u8 *data, int len)
 {
 	int ret;
-	
+
 	if (off + len > (u64) info.len) {
 		error("attempted to write block %llu past end of filesystem",
 				off + len - info.len);
@@ -512,6 +539,7 @@
 	int ret;
 	off64_t aligned_offset;
 	int aligned_diff;
+	int buffer_size;
 
 	if (off + len >= (u64) info.len) {
 		error("attempted to write block %llu past end of filesystem",
@@ -519,7 +547,7 @@
 		return;
 	}
 
-	int file_fd = open(file, O_RDONLY);
+	int file_fd = open(file, O_RDONLY | O_BINARY);
 	if (file_fd < 0) {
 		error_errno("open");
 		return;
@@ -527,14 +555,25 @@
 
 	aligned_offset = offset & ~(4096 - 1);
 	aligned_diff = offset - aligned_offset;
+	buffer_size = len + aligned_diff;
 
-	u8 *data = mmap64(NULL, len + aligned_diff, PROT_READ, MAP_SHARED, file_fd,
+#ifndef USE_MINGW
+	u8 *data = mmap64(NULL, buffer_size, PROT_READ, MAP_SHARED, file_fd,
 			aligned_offset);
 	if (data == MAP_FAILED) {
 		error_errno("mmap64");
 		close(file_fd);
 		return;
 	}
+#else
+	u8 *data = malloc(buffer_size);
+	if (!data) {
+		error_errno("malloc");
+		close(file_fd);
+		return;
+	}
+	memset(data, 0, buffer_size);
+#endif
 
 	if (out->sparse) {
 		write_chunk_raw(out, off, data + aligned_diff, len);
@@ -549,6 +588,11 @@
 	}
 
 err:
-	munmap(data, len);
+#ifndef USE_MINGW
+	munmap(data, buffer_size);
+#else
+	write(file_fd, data, buffer_size);
+	free(data);
+#endif
 	close(file_fd);
 }
diff --git a/ext4_utils/output_file.h b/ext4_utils/output_file.h
index b448706..a578c80 100644
--- a/ext4_utils/output_file.h
+++ b/ext4_utils/output_file.h
@@ -21,6 +21,8 @@
 
 struct output_file *open_output_file(const char *filename, int gz, int sparse,
         int chunks, int crc, int wipe);
+struct output_file *open_output_fd(int fd, int gz, int sparse,
+        int chunks, int crc, int wipe);
 void write_data_block(struct output_file *out, u64 off, u8 *data, int len);
 void write_fill_block(struct output_file *out, u64 off, u32 fill_val, int len);
 void write_data_file(struct output_file *out, u64 off, const char *file,
diff --git a/ext4_utils/sha1.c b/ext4_utils/sha1.c
index 1db9134..463ec38 100644
--- a/ext4_utils/sha1.c
+++ b/ext4_utils/sha1.c
@@ -17,7 +17,9 @@
 
 #define SHA1HANDSOFF		/* Copies data before messing with it. */
 
+#ifndef USE_MINGW
 #include <sys/cdefs.h>
+#endif
 #include <sys/types.h>
 #include <assert.h>
 #include <string.h>
diff --git a/ext4_utils/sha1.h b/ext4_utils/sha1.h
index 71334c8..9a8f7e3 100644
--- a/ext4_utils/sha1.h
+++ b/ext4_utils/sha1.h
@@ -9,10 +9,21 @@
 #ifndef _SYS_SHA1_H_
 #define	_SYS_SHA1_H_
 
-#include <sys/cdefs.h>
 #include <sys/types.h>
 #include <stdint.h>
 
+#ifdef USE_MINGW
+typedef unsigned char u_char;
+typedef unsigned int uint32_t;
+typedef unsigned int u_int32_t;
+typedef unsigned int u_int;
+
+#define __BEGIN_DECLS
+#define __END_DECLS
+#else
+#include <sys/cdefs.h>
+#endif
+
 #define SHA1_DIGEST_LENGTH		20
 #define SHA1_DIGEST_STRING_LENGTH	41
 
diff --git a/ext4_utils/simg2img.c b/ext4_utils/simg2img.c
index 228d289..12b92eb 100644
--- a/ext4_utils/simg2img.c
+++ b/ext4_utils/simg2img.c
@@ -247,7 +247,7 @@
 			fprintf(stderr, "Error reading chunk header\n");
 			exit(-1);
 		}
- 
+
 		if (sparse_header.chunk_hdr_sz > CHUNK_HEADER_LEN) {
 			/* Skip the remaining bytes in a header that is longer than
 			 * we expected.
diff --git a/ext4_utils/simg_dump.py b/ext4_utils/simg_dump.py
new file mode 100755
index 0000000..6ece31d
--- /dev/null
+++ b/ext4_utils/simg_dump.py
@@ -0,0 +1,169 @@
+#! /usr/bin/env python
+
+# Copyright (C) 2012 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from __future__ import print_function
+import getopt, posixpath, signal, struct, sys
+
+def usage(argv0):
+  print("""
+Usage: %s [-v] sparse_image_file ...
+ -v             verbose output
+""" % ( argv0 ))
+  sys.exit(2)
+
+def main():
+
+  signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+  me = posixpath.basename(sys.argv[0])
+
+  # Parse the command line
+  verbose = 0			# -v
+  try:
+    opts, args = getopt.getopt(sys.argv[1:],
+                               "v",
+                               ["verbose"])
+  except getopt.GetoptError, e:
+    print(e)
+    usage(me)
+  for o, a in opts:
+    if o in ("-v", "--verbose"):
+      verbose += 1
+    else:
+      print("Unrecognized option \"%s\"" % (o))
+      usage(me)
+
+  if len(args) == 0:
+    print("No sparse_image_file specified")
+    usage(me)
+
+  for path in args:
+    FH = open(path, 'rb')
+    header_bin = FH.read(28)
+    header = struct.unpack("<I4H4I", header_bin)
+
+    magic = header[0]
+    major_version = header[1]
+    minor_version = header[2]
+    file_hdr_sz = header[3]
+    chunk_hdr_sz = header[4]
+    blk_sz = header[5]
+    total_blks = header[6]
+    total_chunks = header[7]
+    image_checksum = header[8]
+
+    if magic != 0xED26FF3A:
+      print("%s: %s: Magic should be 0xED26FF3A but is 0x%08X"
+            % (me, path, magic))
+      continue
+    if major_version != 1 or minor_version != 0:
+      print("%s: %s: I only know about version 1.0, but this is version %u.%u"
+            % (me, path, major_version, minor_version))
+      continue
+    if file_hdr_sz != 28:
+      print("%s: %s: The file header size was expected to be 28, but is %u."
+            % (me, path, file_hdr_sz))
+      continue
+    if chunk_hdr_sz != 12:
+      print("%s: %s: The chunk header size was expected to be 12, but is %u."
+            % (me, path, chunk_hdr_sz))
+      continue
+
+    print("%s: Total of %u %u-byte output blocks in %u input chunks."
+          % (path, total_blks, blk_sz, total_chunks))
+
+    if image_checksum != 0:
+      print("checksum=0x%08X" % (image_checksum))
+
+    if not verbose:
+      continue
+    print("            input_bytes      output_blocks")
+    print("chunk    offset     number  offset  number")
+    offset = 0
+    for i in xrange(1,total_chunks+1):
+      header_bin = FH.read(12)
+      header = struct.unpack("<2H2I", header_bin)
+      chunk_type = header[0]
+      reserved1 = header[1]
+      chunk_sz = header[2]
+      total_sz = header[3]
+      data_sz = total_sz - 12
+
+      print("%4u %10u %10u %7u %7u" % (i, FH.tell(), data_sz, offset, chunk_sz),
+            end=" ")
+
+      if chunk_type == 0xCAC1:
+        if data_sz != (chunk_sz * blk_sz):
+          print("Raw chunk input size (%u) does not match output size (%u)"
+                % (data_sz, chunk_sz * blk_sz))
+          break;
+        else:
+          print("Raw data", end="")
+          FH.read(data_sz)
+      elif chunk_type == 0xCAC2:
+        if data_sz != 4:
+          print("Fill chunk should have 4 bytes of fill, but this has %u"
+                % (data_sz), end="")
+          break;
+        else:
+          fill_bin = FH.read(4)
+          fill = struct.unpack("<I", fill_bin)
+          print("Fill with 0x%08X" % (fill))
+      elif chunk_type == 0xCAC3:
+        if data_sz != 0:
+          print("Don't care chunk input size is non-zero (%u)" % (data_sz))
+          break;
+        else:
+          print("Don't care", end="")
+      elif chunk_type == 0xCAC4:
+        if data_sz != 4:
+          print("CRC32 chunk should have 4 bytes of CRC, but this has %u"
+                % (data_sz), end="")
+          break;
+        else:
+          crc_bin = FH.read(4)
+          crc = struct.unpack("<I", crc)
+          print("Unverified CRC32 0x%08X" % (crc))
+      else:
+          print("Unknown chunk type 0x%04X" % (chunk_type), end="")
+          break;
+
+      if verbose > 1:
+        header = struct.unpack("<12B", header_bin)
+        print(" (%02X%02X %02X%02X %02X%02X%02X%02X %02X%02X%02X%02X)"
+              % (header[0], header[1], header[2], header[3],
+                 header[4], header[5], header[6], header[7],
+                 header[8], header[9], header[10], header[11]))
+      else:
+        print()
+
+      offset += chunk_sz
+
+    print("     %10u            %7u         End" % (FH.tell(), offset))
+
+    if total_blks != offset:
+      print("The header said we should have %u output blocks, but we saw %u"
+            % (total_blks, offset))
+
+    junk_len = len(FH.read())
+    if junk_len:
+      print("There were %u bytes of extra data at the end of the file."
+            % (junk_len))
+
+  sys.exit(0)
+
+if __name__ == "__main__":
+  main()
diff --git a/ext4_utils/uuid.c b/ext4_utils/uuid.c
index d518476..33d2494 100644
--- a/ext4_utils/uuid.c
+++ b/ext4_utils/uuid.c
@@ -15,7 +15,12 @@
  */
 
 #include <string.h>
+
+#ifdef USE_MINGW
+#include <winsock2.h>
+#else
 #include <arpa/inet.h>
+#endif
 
 #include "ext4_utils.h"
 #include "sha1.h"
diff --git a/libpagemap/include/pagemap/pagemap.h b/libpagemap/include/pagemap/pagemap.h
index 09ff29d..25c6161 100644
--- a/libpagemap/include/pagemap/pagemap.h
+++ b/libpagemap/include/pagemap/pagemap.h
@@ -129,10 +129,10 @@
                              unsigned long low, unsigned long hi,
                              uint64_t **range_out, size_t *len);
 
-#define _BITS(x, offset, bits) (((x) >> offset) & ((1LL << ((bits) + 1)) - 1))
+#define _BITS(x, offset, bits) (((x) >> offset) & ((1LL << (bits)) - 1))
 
 #define PM_PAGEMAP_PRESENT(x)     (_BITS(x, 63, 1))
-#define PM_PAGEMAP_SWAPPED(x)     (!_BITS(x, 62, 1))
+#define PM_PAGEMAP_SWAPPED(x)     (_BITS(x, 62, 1))
 #define PM_PAGEMAP_SHIFT(x)       (_BITS(x, 55, 6))
 #define PM_PAGEMAP_PFN(x)         (_BITS(x, 0, 55))
 #define PM_PAGEMAP_SWAP_OFFSET(x) (_BITS(x, 5, 50))
diff --git a/libpagemap/pm_map.c b/libpagemap/pm_map.c
index f683ba6..2d5c2f9 100644
--- a/libpagemap/pm_map.c
+++ b/libpagemap/pm_map.c
@@ -83,10 +83,6 @@
     pm_memusage_zero(&ws);
     
     for (i = 0; i < len; i++) {
-        if (!PM_PAGEMAP_PRESENT(pagemap[i]) ||
-            PM_PAGEMAP_SWAPPED(pagemap[i]))
-            continue;
-
         error = pm_kernel_flags(map->proc->ker, PM_PAGEMAP_PFN(pagemap[i]),
                                 &flags);
         if (error) goto out;
@@ -99,6 +95,7 @@
         if (error) goto out;
 
         ws.vss += map->proc->ker->pagesize;
+        if( PM_PAGEMAP_SWAPPED(pagemap[i]) ) continue;
         ws.rss += (count >= 1) ? (map->proc->ker->pagesize) : (0);
         ws.pss += (count >= 1) ? (map->proc->ker->pagesize / count) : (0);
         ws.uss += (count == 1) ? (map->proc->ker->pagesize) : (0);
diff --git a/libpagemap/pm_process.c b/libpagemap/pm_process.c
index b3c077e..dddff01 100644
--- a/libpagemap/pm_process.c
+++ b/libpagemap/pm_process.c
@@ -122,7 +122,7 @@
         free(range);
         *range_out = NULL;
         return 0;
-    } else if (error < 0 || (error > 0 && error < numpages * sizeof(uint64_t))) {
+    } else if (error < 0 || (error > 0 && error < (int)(numpages * sizeof(uint64_t)))) {
         error = (error < 0) ? errno : -1;
         free(range);
         return error;
@@ -210,7 +210,7 @@
 }
 
 #define INITIAL_MAPS 10
-#define MAX_LINE 256
+#define MAX_LINE 1024
 #define MAX_PERMS 5
 
 /* 
diff --git a/showmap/showmap.c b/showmap/showmap.c
index 5c4a26f..bb359f6 100644
--- a/showmap/showmap.c
+++ b/showmap/showmap.c
@@ -56,9 +56,7 @@
     if (line[name_pos]) {
         strlcpy(name, line + name_pos, sizeof(name));
     } else {
-        if ((start >= 0x10000000) && (start < 0x40000000)) {
-            strlcpy(name, "[stack]", sizeof(name));
-        } else if (prev && start == prev->end && is_library(prev->name)) {
+        if (prev && start == prev->end && is_library(prev->name)) {
             // anonymous mappings immediately adjacent to shared libraries
             // usually correspond to the library BSS segment, so we use the
             // library's own name
diff --git a/tests/bionic/libc/Android.mk b/tests/bionic/libc/Android.mk
index 5dcf130..52ef01e 100644
--- a/tests/bionic/libc/Android.mk
+++ b/tests/bionic/libc/Android.mk
@@ -61,6 +61,7 @@
 # First, the tests in 'common'
 
 sources := \
+    common/bench_stdio.c \
     common/test_clock.c \
     common/test_cpu_set.c \
     common/test_drand48.c \
@@ -252,4 +253,31 @@
 EXTRA_CFLAGS := -mandroid
 #$(call device-test, $(sources))
 
+# NOTE: We build both a shared and static version of bench_pthread.
+# the shared version will use the target device's C library, while
+# the static one will use the current build product implementation.
+# This is ideal to quantify pthread optimizations.
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := common/bench_pthread.c
+LOCAL_MODULE := bench_pthread_shared
+LOCAL_MODULE_TAGS := tests
+include $(BUILD_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := common/bench_pthread.c
+LOCAL_MODULE := bench_pthread_static
+LOCAL_MODULE_TAGS := tests
+LOCAL_FORCE_STATIC_EXECUTABLE := true
+LOCAL_STATIC_LIBRARIES := libc
+include $(BUILD_EXECUTABLE)
+
+ifeq ($(HOST_OS),linux)
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := common/bench_pthread.c
+LOCAL_MODULE := bench_pthread
+LOCAL_LDLIBS += -lpthread -lrt
+LOCAL_MODULE_TAGS := tests
+include $(BUILD_HOST_EXECUTABLE)
+endif
+
 endif  # BIONIC_TESTS
diff --git a/tests/bionic/libc/common/bench_pthread.c b/tests/bionic/libc/common/bench_pthread.c
new file mode 100644
index 0000000..4e46f61
--- /dev/null
+++ b/tests/bionic/libc/common/bench_pthread.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* This program is used to benchmark various pthread operations
+ * Note that we want to be able to build it with GLibc, both on
+ *  a Linux host and an Android device. For example, on ARM, one
+ * can build it manually with:
+ *
+ *     arm-linux-none-gnueabi-gcc -static -o bench_pthread_gnueabi \
+ *           bench_pthread.c -O2 -lpthread -lrt
+ */
+#define _GNU_SOURCE 1
+#include <time.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <limits.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define S(x)  S_(x)
+#define S_(x) #x
+
+#define C(x,y)  C_(x,y)
+#define C_(x,y) x ## y
+
+#ifndef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
+#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER  PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#endif
+
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER  PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#endif
+
+static int64_t now_ns(void)
+{
+    struct timespec ts;
+    /* NOTE: get thread-specific CPU-time clock to ensure
+     *       we don't measure stuff like kernel thread preemptions
+     *       that might happen during the benchmark
+     */
+    clock_gettime(CLOCK_THREAD_CPUTIME_ID,&ts);
+    return ts.tv_sec*1000000000LL + ts.tv_nsec;
+}
+
+#define SUBCOUNT   10000
+#define MAX_STATS  1000000
+
+/* Maximum time we'll wait for a single bench run */
+#define MAX_WAIT_MS  1000
+
+static int64_t  stats[MAX_STATS];
+
+static int
+compare_stats(const void* a, const void* b)
+{
+    uint64_t sa = *(const uint64_t*)a;
+    uint64_t sb = *(const uint64_t*)b;
+    if (sa < sb)
+        return -1;
+    if (sa > sb)
+        return +1;
+    else
+        return 0;
+}
+
+static void
+filter_stats(int count, const char* statement)
+{
+    int64_t  min, max, avg, median;
+
+    /* sort the array in increasing order */
+    qsort(stats, count, sizeof(stats[0]), compare_stats);
+
+    /* trim 10% to remove outliers */
+    int min_index = count*0.05;
+    int max_index = count - min_index;
+    if (max_index >= count)
+        max_index = count-1;
+
+    count = (max_index - min_index)+1;
+
+    /* the median is the center item */
+    median = stats[(min_index+max_index)/2];
+
+    /* the minimum is the first, the max the last */
+    min = stats[min_index];
+    max = stats[max_index];
+
+    /* compute the average */
+    int nn;
+    int64_t  total = 0;
+    for (nn = min_index; nn <= max_index; nn++) {
+        total += stats[nn];
+    }
+
+    printf("BENCH: %5.1f %5.1f %5.1f, %s\n",
+           min*1./SUBCOUNT,
+           max*1./SUBCOUNT,
+           median*1./SUBCOUNT,
+           statement);
+    if (0) {
+        for (nn = min_index; nn <= max_index; nn++) {
+            printf(" %lld", (long long)stats[nn]);
+        }
+        printf("\n");
+    }
+}
+
+#define BENCH_COUNT(stmnt,total) do { \
+        int64_t  count = total; \
+        int      num_stats = 0; \
+        int64_t  bench_start = now_ns(); \
+        while (num_stats < MAX_STATS && count >= SUBCOUNT) { \
+            int      tries = SUBCOUNT; \
+            int64_t  sub_start = now_ns(); \
+            count -= tries; \
+            for ( ; tries > 0; tries-- ) {\
+                stmnt;\
+            }\
+            int64_t  sub_end = now_ns(); \
+            stats[num_stats++] = sub_end - sub_start; \
+            if (sub_end - bench_start >= MAX_WAIT_MS*1e6) \
+                break; \
+        } \
+        filter_stats(num_stats, #stmnt); \
+    } while (0)
+
+#define DEFAULT_COUNT 10000000
+
+#define BENCH(stmnt) BENCH_COUNT(stmnt,DEFAULT_COUNT)
+
+/* Will be called by pthread_once() for benchmarking */
+static void _dummy_init(void)
+{
+    /* nothing */
+}
+
+/* Used when creating the key */
+static void key_destroy(void* param)
+{
+    /* nothing */
+}
+
+int main(void)
+{
+    pthread_once_t  once = PTHREAD_ONCE_INIT;
+    pthread_once(&once, _dummy_init);
+
+    pthread_key_t   key;
+    pthread_key_create(&key, key_destroy);
+    pthread_setspecific(key, (void*)(int)100);
+
+    BENCH(getpid());
+    BENCH(pthread_self());
+    BENCH(pthread_getspecific(key));
+    BENCH(pthread_once(&once, _dummy_init));
+
+    pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+    BENCH(pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex));
+
+    pthread_mutex_t errorcheck_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER;
+    BENCH(pthread_mutex_lock(&errorcheck_mutex); pthread_mutex_unlock(&errorcheck_mutex));
+
+    pthread_mutex_t recursive_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+    BENCH(pthread_mutex_lock(&recursive_mutex); pthread_mutex_unlock(&recursive_mutex));
+
+	/* TODO: Benchmark pshared mutexes */
+
+    sem_t semaphore;
+    int dummy;
+    sem_init(&semaphore, 1, 1);
+    BENCH(sem_getvalue(&semaphore,&dummy));
+    BENCH(sem_wait(&semaphore); sem_post(&semaphore));
+    return 0;
+}
diff --git a/tests/bionic/libc/common/bench_stdio.c b/tests/bionic/libc/common/bench_stdio.c
new file mode 100644
index 0000000..4c19bf1
--- /dev/null
+++ b/tests/bionic/libc/common/bench_stdio.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* This program tries to benchmark stdio operations like fread() and
+ * fwrite() with various chunk sizes. We always read/write from /dev/zero
+ * to ensure that disk speed and caching don't change our results.
+ *
+ * We really do this to measure improvements in the low-level stdio
+ * features.
+ */
+ 
+#include <stdio.h>
+#include <time.h>
+#include <string.h>
+#include <errno.h>
+
+static char buffer[1024*1024];
+
+/* Return current time in milli-seconds, as a double */
+static double
+now_ms(void)
+{
+    struct timespec  ts;
+    clock_gettime(CLOCK_MONOTONIC, &ts);
+    return ts.tv_sec*1000. + ts.tv_nsec*1e-6;
+}
+
+void read_file(FILE* fp, int chunkSize)
+{
+    int totalSize = sizeof(buffer);
+    for ( ; totalSize > 0; totalSize -= chunkSize) {
+        fread(buffer, 1, chunkSize, fp);
+    }
+}
+
+void write_file(FILE* fp, int chunkSize)
+{
+    int totalSize = sizeof(buffer);
+    for ( ; totalSize > 0; totalSize -= chunkSize) {
+        fwrite(buffer, 1, chunkSize, fp);
+    }
+}
+
+#define  BENCH(op,...) \
+    do { \
+	double  time_ms = now_ms(); \
+	op ; \
+	time_ms = now_ms() - time_ms; \
+	double  bandwidth = sizeof(buffer)*1000./1024./time_ms; \
+	printf("bench %-30s %8.2f ms  (%.1f KB/s) \n", #op, time_ms, bandwidth ); \
+    } while (0)
+
+int main(void)
+{
+    FILE* fp = fopen("/dev/zero", "rw");
+
+    if (fp == NULL) {
+	fprintf(stderr,"Could not open /dev/zero: %s\n", strerror(errno));
+	return 1;
+    }
+
+    BENCH(read_file(fp,1));
+    BENCH(read_file(fp,2));
+    BENCH(read_file(fp,3));
+    BENCH(read_file(fp,4));
+    BENCH(read_file(fp,8));
+    BENCH(read_file(fp,16));
+    BENCH(read_file(fp,32));
+    BENCH(read_file(fp,64));
+    BENCH(read_file(fp,256));
+    BENCH(read_file(fp,1024));
+    BENCH(read_file(fp,4096));
+    BENCH(read_file(fp,16384));
+    BENCH(read_file(fp,65536));
+
+    BENCH(write_file(fp,1));
+    BENCH(write_file(fp,2));
+    BENCH(write_file(fp,3));
+    BENCH(write_file(fp,4));
+    BENCH(write_file(fp,8));
+    BENCH(write_file(fp,16));
+    BENCH(write_file(fp,32));
+    BENCH(write_file(fp,64));
+    BENCH(write_file(fp,256));
+    BENCH(write_file(fp,1024));
+    BENCH(write_file(fp,4096));
+    BENCH(write_file(fp,16384));
+    BENCH(write_file(fp,65536));
+
+    fclose(fp);
+    return 0;
+}
diff --git a/tests/framebuffer/refresh.c b/tests/framebuffer/refresh.c
index 43dc7cf..38e7871 100644
--- a/tests/framebuffer/refresh.c
+++ b/tests/framebuffer/refresh.c
@@ -67,12 +67,10 @@
     if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1)
         return -errno;    
     
-    int refreshRate = 1000000000000000LLU / 
-            (
-          (uint64_t)( info.upper_margin + info.lower_margin + info.yres ) 
-                  * ( info.left_margin  + info.right_margin + info.xres )
-                  * info.pixclock
-            );
+    uint64_t denominator = (uint64_t)( info.upper_margin + info.lower_margin + info.yres )
+                         * ( info.left_margin  + info.right_margin + info.xres )
+                         * info.pixclock;
+    int refreshRate = denominator ? (1000000000000000LLU / denominator) : 0;
     
     float xdpi = (info.xres * 25.4f) / info.width; 
     float ydpi = (info.yres * 25.4f) / info.height;
diff --git a/tests/fstest/perm_checker.conf b/tests/fstest/perm_checker.conf
index 25f1b5f..580eb85 100644
--- a/tests/fstest/perm_checker.conf
+++ b/tests/fstest/perm_checker.conf
@@ -16,8 +16,8 @@
 /data/dalvik-cache/... 400 744 root 19999 root 19999
 /data/data 701 771 system system system system
 /data/data/... 000 775 system 19999 system 19999
-/data/local/ 771 771 shell shell shell shell
-/data/local/tmp/ 771 1771 shell shell shell shell
+/data/local/ 751 751 root root root root
+/data/local/tmp/ 771 771 shell shell shell shell
 /data/lost+found/ 700 770 root root root root
 /data/misc/ 1711 1771 root system root misc
 /data/misc/akmd_set.txt 600 640 root compass compass compass
diff --git a/tests/iptables/qtaguid/Android.mk b/tests/iptables/qtaguid/Android.mk
index 5eba34f..cf0a2ba 100644
--- a/tests/iptables/qtaguid/Android.mk
+++ b/tests/iptables/qtaguid/Android.mk
@@ -19,7 +19,6 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE := socketTag
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativestresstest
 LOCAL_SRC_FILES := socketTag.cpp
 LOCAL_SHARED_LIBRARIES += libcutils libutils
 LOCAL_STATIC_LIBRARIES += libtestUtil
diff --git a/tests/iptables/qtaguid/socketTag.cpp b/tests/iptables/qtaguid/socketTag.cpp
index 68d9257..fb7ecdc 100644
--- a/tests/iptables/qtaguid/socketTag.cpp
+++ b/tests/iptables/qtaguid/socketTag.cpp
@@ -14,6 +14,7 @@
  * limitations under the License.
  *
  */
+
 /*
  * This socket tagging test is to ensure that the
  * netfilter/xt_qtaguid kernel module somewhat behaves as expected
@@ -24,6 +25,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <gtest/gtest.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <string>
@@ -32,15 +34,15 @@
 #include <utils/Log.h>
 #include <testUtil.h>
 
+namespace android {
 
 class SockInfo {
 public:
-        SockInfo()
-                : fd(-1), addr(NULL) {};
-        int setup(uint64_t tag);
-        bool checkTag(uint64_t tag, uid_t uid);
-        int fd;
-        void *addr;
+    SockInfo() : fd(-1), addr(NULL) {};
+    int setup(uint64_t tag);
+    bool checkTag(uint64_t tag, uid_t uid);
+    int fd;
+    void *addr;
 };
 
 
@@ -90,6 +92,7 @@
     close(param_fd);
     return res;
 }
+
 /*----------------------------------------------------------------*/
 int SockInfo::setup(uint64_t tag) {
     fd = socket(AF_INET, SOCK_STREAM, 0);
@@ -180,528 +183,217 @@
     return pos != NULL;
 }
 
-/*----------------------------------------------------------------*/
-int testSocketTagging(void) {
-    SockInfo sock0;
-    SockInfo sock1;
-    int res;
-    int total_errors = 0;
-    int ctrl_fd = -1;
-    int dev_fd = -1;
-    const uint64_t invalid_tag1 = 0x0000000100000001llu;
-    uint64_t valid_tag1;
-    uint64_t valid_tag2;
-    uint64_t max_uint_tag = 0xffffffff00000000llu;
-    uid_t fake_uid;
-    uid_t fake_uid2;
-    const char *test_name;
-    uid_t my_uid = getuid();
-    pid_t my_pid = getpid();
 
-    srand48(my_pid * my_uid);
-    /* Adjust fake UIDs and tags so that multiple instances can run in parallel. */
-    fake_uid = testRand();
-    fake_uid2 = testRand();
-    valid_tag1 = ((uint64_t)my_pid << 48) | ((uint64_t)testRand() << 32);
-    valid_tag2 = ((uint64_t)my_pid << 48) | ((uint64_t)testRand() << 32);
-    max_uint_tag = 1llu << 63 | (((uint64_t)my_pid << 48) ^ max_uint_tag);
-    testSetLogCatTag(LOG_TAG);
+class SocketTaggingTest : public ::testing::Test {
+protected:
+    virtual void SetUp() {
+        ctrl_fd = -1;
+        dev_fd = -1;
+        my_uid = getuid();
+        my_pid = getpid();
+        srand48(my_pid * my_uid);
+        // Adjust fake UIDs and tags so that multiple instances can run in parallel.
+        fake_uid = testRand();
+        fake_uid2 = testRand();
+        valid_tag1 = ((uint64_t)my_pid << 48) | ((uint64_t)testRand() << 32);
+        valid_tag2 = ((uint64_t)my_pid << 48) | ((uint64_t)testRand() << 32);
+        valid_tag2 &= 0xffffff00ffffffffllu;  // Leave some room to make counts visible.
+        testPrintI("* start: pid=%lu uid=%lu uid1=0x%lx/%lu uid2=0x%lx/%lu"
+                   " tag1=0x%llx/%llu tag2=0x%llx/%llu",
+                   my_pid, my_uid, fake_uid, fake_uid, fake_uid2, fake_uid2,
+                   valid_tag1, valid_tag1, valid_tag2, valid_tag2);
+        max_uint_tag = 0xffffffff00000000llu;
+        max_uint_tag = 1llu << 63 | (((uint64_t)my_pid << 48) ^ max_uint_tag);
 
-    testPrintI("** %s ** ============================", __FUNCTION__);
-    testPrintI("* start: pid=%lu uid=%lu uid1=0x%lx/%lu uid2=0x%lx/%lu"
-               " tag1=0x%llx/%llu tag2=0x%llx/%llu",
-               my_pid, my_uid, fake_uid, fake_uid, fake_uid2, fake_uid2,
-               valid_tag1, valid_tag1, valid_tag2, valid_tag2);
-
-    // ---------------
-    test_name = "kernel has qtaguid";
-    testPrintI("* test: %s ", test_name);
-    ctrl_fd = openCtrl();
-    if (ctrl_fd < 0) {
-        testPrintE("qtaguid ctrl open failed: %s", strerror(errno));
-        total_errors++;
-        goto done;
-    }
-    close(ctrl_fd);
-    dev_fd = open("/dev/xt_qtaguid", O_RDONLY);
-    if (dev_fd < 0) {
-        testPrintE("qtaguid dev open failed: %s", strerror(errno));
-        total_errors++;
-    }
-    // ---------------
-    test_name = "delete command doesn't fail";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("d 0 %u", fake_uid);
-    if (res < 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-            total_errors++;
-    }
-
-    res = doCtrlCommand("d 0 %u", fake_uid2);
-    if (res < 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-            total_errors++;
-    }
-
-    res = doCtrlCommand("d 0 %u", my_uid);
-    if (res < 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-            total_errors++;
-    }
-    // ---------------
-    test_name = "setup sock0 and addr via tag";
-    testPrintI("* test: %s", test_name);
-    if (sock0.setup(valid_tag1) < 0) {
-        testPrintE("socket setup failed: %s", strerror(errno));
-        total_errors++;
-        goto done;
-
-    }
-    // ---------------
-    test_name = "setup sock1 and addr via tag";
-    testPrintI("* test: %s", test_name);
-    if (sock1.setup(valid_tag1) < 0) {
-        testPrintE("socket setup failed: %s", strerror(errno));
-        total_errors++;
-        goto done;
-    }
-    // ---------------
-    test_name = "insufficient args. Expected failure";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t");
-    if (res > 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "bad command. Expected failure";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("?");
-    if (res > 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "no tag, no uid";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d", sock0.fd);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock0.checkTag(0, my_uid)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "invalid tag. Expected failure";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu", sock0.fd, invalid_tag1);
-    if (res > 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (sock0.checkTag(invalid_tag1, my_uid)) {
-        testPrintE("! %s: Unexpected results: tag should not be there", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "valid tag with no uid";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu", sock0.fd, valid_tag1);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock0.checkTag(valid_tag1, my_uid)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-    // ---------------
-    test_name = "valid untag";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("u %d", sock0.fd);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (sock0.checkTag(valid_tag1, my_uid)) {
-        testPrintE("! %s: Unexpected results: tag not removed", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "valid 1st tag";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock0.checkTag(valid_tag2, fake_uid)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "valid re-tag";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock0.checkTag(valid_tag2, fake_uid)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "valid re-tag with acct_tag change";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag1, fake_uid);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock0.checkTag(valid_tag1, fake_uid)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "re-tag with uid change";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid2);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock0.checkTag(valid_tag2, fake_uid2)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "valid 64bit acct tag";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu", sock0.fd, max_uint_tag);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock0.checkTag(max_uint_tag, my_uid)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "tag another socket";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("t %d %llu %u", sock1.fd, valid_tag1, fake_uid2);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (!sock1.checkTag(valid_tag1, fake_uid2)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "valid untag";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("u %d", sock0.fd);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (sock0.checkTag(max_uint_tag, fake_uid)) {
-        testPrintE("! %s: Unexpected results: tag should not be there", test_name);
-        total_errors++;
-    }
-    if (!sock1.checkTag(valid_tag1, fake_uid2)) {
-        testPrintE("! %s: Unexpected results: tag not found", test_name);
-        total_errors++;
-    }
-    res = doCtrlCommand("u %d", sock1.fd);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (sock1.checkTag(valid_tag1, fake_uid2)) {
-        testPrintE("! %s: Unexpected results: tag should not be there", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "invalid sock0.fd. Expected failure";
-    testPrintI("* test: %s", test_name);
-    close(sock0.fd);
-    res = doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag1, my_uid);
-    if (res > 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (sock0.checkTag(valid_tag1, my_uid)) {
-        testPrintE("! %s: Unexpected results: tag should not be there", test_name);
-        total_errors++;
-    }
-
-    // ---------------
-    test_name = "invalid untag. Expected failure";
-    testPrintI("* test: %s", test_name);
-    close(sock1.fd);
-    res = doCtrlCommand("u %d", sock1.fd);
-    if (res > 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-
-    if (total_errors) {
-        testPrintE("! Errors found");
-    } else {
-        testPrintI("No Errors found");
-    }
-
-done:
-    if (dev_fd >= 0) {
-        close(dev_fd);
-    }
-    if (ctrl_fd >= 0) {
+        testPrintI("kernel has qtaguid");
+        ctrl_fd = openCtrl();
+        ASSERT_GE(ctrl_fd, 0) << "qtaguid ctrl open failed";
         close(ctrl_fd);
-    }
-    return total_errors;
-}
+        dev_fd = open("/dev/xt_qtaguid", O_RDONLY);
+        EXPECT_GE(dev_fd, 0) << "qtaguid dev open failed";
 
-int testTagData(void) {
-    SockInfo sock0;
-    SockInfo sock1;
-    int res;
-    int total_errors = 0;
-    int ctrl_fd = -1;
-    int dev_fd = -1;
-    const uint64_t invalid_tag1 = 0x0000000100000001llu;
-    uint64_t valid_tag1;
-    uint64_t valid_tag2;
-    uint64_t max_uint_tag = 0xffffffff00000000llu;
-    uid_t fake_uid;
-    uid_t fake_uid2;
-    const char *test_name;
-    uid_t my_uid = getuid();
-    pid_t my_pid = getpid();
-    const int max_tags = 5;
+        // We want to clean up any previous faulty test runs.
+        testPrintI("delete command does not fail");
+        EXPECT_GE(doCtrlCommand("d 0 %u", fake_uid), 0) << "Failed to delete fake_uid";
+        EXPECT_GE(doCtrlCommand("d 0 %u", fake_uid2), 0) << "Failed to delete fake_uid2";
+        EXPECT_GE(doCtrlCommand("d 0 %u", my_uid), 0) << "Failed to delete my_uid";
 
-    srand48(my_pid * my_uid);
-    /* Adjust fake UIDs and tags so that multiple instances can run in parallel. */
-    fake_uid = testRand();
-    fake_uid2 = testRand();
-    valid_tag1 = ((uint64_t)my_pid << 48) | ((uint64_t)testRand() << 32);
-    valid_tag2 = ((uint64_t)my_pid << 48) | ((uint64_t)testRand() << 32);
-    valid_tag2 &= 0xffffff00ffffffffllu;  // Leave some room to make counts visible.
-    testSetLogCatTag(LOG_TAG);
-
-    testPrintI("** %s ** ============================", __FUNCTION__);
-    testPrintI("* start: pid=%lu uid=%lu uid1=0x%lx/%lu uid2=0x%lx/%lu"
-               " tag1=0x%llx/%llu tag2=0x%llx/%llu",
-               my_pid, my_uid, fake_uid, fake_uid, fake_uid2, fake_uid2,
-               valid_tag1, valid_tag1, valid_tag2, valid_tag2);
-
-    // ---------------
-    test_name = "kernel has qtaguid";
-    testPrintI("* test: %s ", test_name);
-    ctrl_fd = openCtrl();
-    if (ctrl_fd < 0) {
-        testPrintE("qtaguid ctrl open failed: %s", strerror(errno));
-        return 1;
-    }
-    close(ctrl_fd);
-    dev_fd = open("/dev/xt_qtaguid", O_RDONLY);
-    if (dev_fd < 0) {
-        testPrintE("! %s: qtaguid dev open failed: %s", test_name, strerror(errno));
-        total_errors++;
-    }
-    // ---------------
-    test_name = "delete command doesn't fail";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("d 0 %u", fake_uid);
-    if (res < 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-            total_errors++;
+        testPrintI("setup sock0 and addr via tag");
+        ASSERT_FALSE(sock0.setup(valid_tag1))  << "socket0 setup failed";
+        testPrintI("setup sock1 and addr via tag");
+        ASSERT_FALSE(sock1.setup(valid_tag1))  << "socket1 setup failed";
     }
 
-    res = doCtrlCommand("d 0 %u", fake_uid2);
-    if (res < 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-            total_errors++;
-    }
+   virtual void TearDown() {
+       if (dev_fd >= 0) {
+           close(dev_fd);
+       }
+       if (ctrl_fd >= 0) {
+           close(ctrl_fd);
+       }
+   }
 
-    res = doCtrlCommand("d 0 %u", my_uid);
-    if (res < 0) {
-            testPrintE("! %s: Unexpected results", test_name);
-            total_errors++;
-    }
+   SockInfo sock0;
+   SockInfo sock1;
+   int ctrl_fd;
+   int dev_fd;
+   uid_t fake_uid;
+   uid_t fake_uid2;
+   uid_t my_uid;
+   pid_t my_pid;
+   uint64_t valid_tag1;
+   uint64_t valid_tag2;
+   uint64_t max_uint_tag;
+   static const uint64_t invalid_tag1 = 0x0000000100000001llu;
+   static const int max_tags = 5;
+};
 
-    // ---------------
-    test_name = "setup sock0 and addr via tag";
-    testPrintI("* test: %s", test_name);
-    if (sock0.setup(valid_tag1)) {
-        testPrintE("socket setup failed: %s", strerror(errno));
-        return 1;
-    }
-    // ---------------
-    test_name = "setup sock1 and addr via tag";
-    testPrintI("* test: %s", test_name);
-    if (sock1.setup(valid_tag1)) {
-        testPrintE("socket setup failed: %s", strerror(errno));
-        return 1;
-    }
-    // ---------------
-    test_name = "setup tag limit";
-    testPrintI("* test: %s ", test_name);
+TEST_F(SocketTaggingTest, TagData) {
+    max_uint_tag = 0xffffffff00000000llu;
     char *max_tags_str;
+
+    testPrintI("setup tag limit");
     asprintf(&max_tags_str, "%d", max_tags);
-    res = writeModuleParam("max_sock_tags", max_tags_str);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        free(max_tags_str);
-        return 1;
-    }
+    ASSERT_GE(writeModuleParam("max_sock_tags", max_tags_str), 0) << "Failed to setup tag limit";
 
-    // ---------------
-    test_name = "tag quota reach limit";
-    testPrintI("* test: %s", test_name);
+    testPrintI("tag quota reach limit");
     for (int cnt = 0; cnt < max_tags; cnt++ ) {
-        uint64_t new_tag = valid_tag2 + ((uint64_t)cnt << 32);
-        res = doCtrlCommand("t %d %llu %u", sock0.fd, new_tag , fake_uid2);
-        if (res < 0) {
-                testPrintE("! %s: Unexpected results", test_name);
-                total_errors++;
-        }
-        if (!sock0.checkTag(new_tag, fake_uid2)) {
-                testPrintE("! %s: Unexpected results: tag not found", test_name);
-                total_errors++;
-        }
-    }
-    test_name = "tag quota go over limit";
-    testPrintI("* test: %s", test_name);
-    {
-        uint64_t new_tag = valid_tag2 + ((uint64_t)max_tags << 32);
-        res = doCtrlCommand("t %d %llu %u", sock0.fd, new_tag , fake_uid2);
-        if (res > 0) {
-                testPrintE("! %s: Unexpected results", test_name);
-                total_errors++;
-        }
-        if (!sock0.checkTag(valid_tag2 + (((uint64_t)max_tags - 1) << 32), fake_uid2)) {
-                testPrintE("! %s: Unexpected results: tag not found", test_name);
-                total_errors++;
-        }
+        uint64_t tag = valid_tag2 + ((uint64_t)cnt << 32);
+        EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, tag , fake_uid2), 0)
+            << "Tagging within limit failed";
+        EXPECT_TRUE(sock0.checkTag(tag, fake_uid2))<<  "Unexpected results: tag not found";
     }
 
-    // ---------------
-    test_name = "valid untag";
-    testPrintI("* test: %s", test_name);
-    res = doCtrlCommand("u %d", sock0.fd);
-    if (res < 0) {
-        testPrintE("! %s: Unexpected results", test_name);
-        total_errors++;
-    }
-    if (sock0.checkTag(valid_tag2 + (((uint64_t)max_tags - 1) << 32), fake_uid2)) {
-        testPrintE("! %s: Unexpected results: tag should not be there", test_name);
-        total_errors++;
-    }
+    testPrintI("tag quota go over limit");
+    uint64_t new_tag = valid_tag2 + ((uint64_t)max_tags << 32);
+    EXPECT_LT(doCtrlCommand("t %d %llu %u", sock0.fd, new_tag , fake_uid2), 0);
+    EXPECT_TRUE(sock0.checkTag(valid_tag2 + (((uint64_t)max_tags - 1) << 32),
+                               fake_uid2)) << "Unexpected results: tag not found";
 
-    // ---------------
-    test_name = "tag after untag shouldn't free up max tags";
-    testPrintI("* test: %s", test_name);
-    {
-        uint64_t new_tag = valid_tag2 + ((uint64_t)max_tags << 32);
-        res = doCtrlCommand("t %d %llu %u", sock0.fd, new_tag , fake_uid2);
-        if (res > 0) {
-                testPrintE("! %s: Unexpected results", test_name);
-                total_errors++;
-        }
-        if (sock0.checkTag(valid_tag2 + ((uint64_t)max_tags << 32), fake_uid2)) {
-            testPrintE("! %s: Unexpected results: tag should not be there", test_name);
-            total_errors++;
-        }
-    }
+    testPrintI("valid untag");
+    EXPECT_GE(doCtrlCommand("u %d", sock0.fd), 0);
+    EXPECT_FALSE(sock0.checkTag(valid_tag2 + (((uint64_t)max_tags - 1) << 32), fake_uid2))
+        << "Untagged tag should not be there";
 
-    // ---------------
-    test_name = "delete one tag";
-    testPrintI("* test: %s", test_name);
-    {
-            uint64_t new_tag = valid_tag2 + (((uint64_t)max_tags / 2) << 32);
-            res = doCtrlCommand("d %llu %u", new_tag, fake_uid2);
-            if (res < 0) {
-                    testPrintE("! %s: Unexpected results", test_name);
-                    total_errors++;
-            }
-    }
+    testPrintI("tag after untag should not free up max tags");
+    uint64_t new_tag2 = valid_tag2 + ((uint64_t)max_tags << 32);
+    EXPECT_LT(doCtrlCommand("t %d %llu %u", sock0.fd, new_tag2 , fake_uid2), 0);
+    EXPECT_FALSE(sock0.checkTag(valid_tag2 + ((uint64_t)max_tags << 32), fake_uid2))
+        << "Tag should not be there";
 
-    // ---------------
-    test_name = "2 tags after 1 delete pass/fail";
-    testPrintI("* test: %s", test_name);
-    {
-        uint64_t new_tag;
-        new_tag = valid_tag2 + (((uint64_t)max_tags + 1 ) << 32);
-        res = doCtrlCommand("t %d %llu %u", sock0.fd, new_tag , fake_uid2);
-        if (res < 0) {
-                testPrintE("! %s: Unexpected results", test_name);
-                total_errors++;
-        }
-        if (!sock0.checkTag(valid_tag2 + (((uint64_t)max_tags + 1) << 32), fake_uid2)) {
-            testPrintE("! %s: Unexpected results: tag not found", test_name);
-            total_errors++;
-        }
+    testPrintI("delete one tag");
+    uint64_t new_tag3 = valid_tag2 + (((uint64_t)max_tags / 2) << 32);
+    EXPECT_GE(doCtrlCommand("d %llu %u", new_tag3, fake_uid2), 0);
 
-        new_tag = valid_tag2 + (((uint64_t)max_tags + 2 ) << 32);
-        res = doCtrlCommand("t %d %llu %u", sock0.fd, new_tag , fake_uid2);
-        if (res > 0) {
-                testPrintE("! %s: Unexpected results", test_name);
-                total_errors++;
-        }
-        if (sock0.checkTag(valid_tag2 + (((uint64_t)max_tags + 2) << 32), fake_uid2)) {
-            testPrintE("! %s: Unexpected results: tag should not be there", test_name);
-            total_errors++;
-        }
-    }
+    testPrintI("2 tags after 1 delete pass/fail");
+    uint64_t new_tag4;
+    new_tag4 = valid_tag2 + (((uint64_t)max_tags + 1 ) << 32);
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, new_tag4 , fake_uid2), 0);
+    EXPECT_TRUE(sock0.checkTag(valid_tag2 + (((uint64_t)max_tags + 1) << 32), fake_uid2))
+        << "Tag not found";
+    new_tag4 = valid_tag2 + (((uint64_t)max_tags + 2 ) << 32);
+    EXPECT_LT(doCtrlCommand("t %d %llu %u", sock0.fd, new_tag4 , fake_uid2), 0);
+    EXPECT_FALSE(sock0.checkTag(valid_tag2 + (((uint64_t)max_tags + 2) << 32), fake_uid2))
+        << "Tag should not be there";
 
     /* TODO(jpa): test tagging two different sockets with same tags and
      * check refcounts  the tag_node should be +2
      */
-
-    // ---------------
-    if (total_errors) {
-        testPrintE("! Errors found");
-    } else {
-        testPrintI("No Errors found");
-    }
-
-done:
-    if (dev_fd >= 0) {
-        close(dev_fd);
-    }
-    if (ctrl_fd >= 0) {
-        close(ctrl_fd);
-    }
-    return total_errors;
 }
 
-/*----------------------------------------------------------------*/
-
-int main(int argc, char *argv[]) {
-    int res = 0;
-    res += testTagData();
-    res += testSocketTagging();
-    if (res) {
-        testPrintE("!! %d Errors found", res);
-    } else {
-        testPrintE("No Errors found");
-    }
-    return res;
+TEST_F(SocketTaggingTest, InsufficientArgsFails) {
+    // Insufficient args. Expected failure
+    EXPECT_LE(doCtrlCommand("t"), 0) << "Insufficient args, should fail.";
 }
+
+TEST_F(SocketTaggingTest, BadCommandFails) {
+    // Bad command. Expected failure";
+    EXPECT_LE(doCtrlCommand("?"), 0) << "Bad command, should fail";
+}
+
+TEST_F(SocketTaggingTest, NoTagNoUid) {
+    // no tag, no uid
+    EXPECT_GE(doCtrlCommand("t %d", sock0.fd), 0);
+    ASSERT_TRUE(sock0.checkTag(0, my_uid))  << "Tag not found";
+}
+
+TEST_F(SocketTaggingTest, InvalidTagFail) {
+    // Invalid tag. Expected failure
+    EXPECT_LE(doCtrlCommand("t %d %llu", sock0.fd, invalid_tag1), 0);
+    ASSERT_FALSE(sock0.checkTag(invalid_tag1, my_uid)) << "Tag should not be there";
+}
+
+TEST_F(SocketTaggingTest, ValidTagWithNoUid) {
+    // Valid tag with no uid
+    EXPECT_GE(doCtrlCommand("t %d %llu", sock0.fd, valid_tag1), 0);
+    EXPECT_TRUE(sock0.checkTag(valid_tag1, my_uid)) << "Tag not found";
+}
+
+TEST_F(SocketTaggingTest, ValidUntag) {
+    // Valid untag
+    EXPECT_GE(doCtrlCommand("t %d %llu", sock0.fd, valid_tag1), 0);
+    EXPECT_TRUE(sock0.checkTag(valid_tag1, my_uid)) << "Tag not found";
+    EXPECT_GE(doCtrlCommand("u %d", sock0.fd), 0);
+    EXPECT_FALSE(sock0.checkTag(valid_tag1, my_uid)) << "Tag should be removed";
+}
+
+TEST_F(SocketTaggingTest, ValidFirsttag) {
+    // Valid 1st tag
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid), 0);
+    EXPECT_TRUE(sock0.checkTag(valid_tag2, fake_uid)) << "Tag not found.";
+}
+
+TEST_F(SocketTaggingTest, ValidReTag) {
+    // Valid re-tag
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid), 0);
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid), 0);
+    EXPECT_TRUE(sock0.checkTag(valid_tag2, fake_uid)) << "Tag not found.";
+}
+
+TEST_F(SocketTaggingTest, ValidReTagWithAcctTagChange) {
+    // Valid re-tag with acct_tag change
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid), 0);
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag1, fake_uid), 0);
+    EXPECT_TRUE(sock0.checkTag(valid_tag1, fake_uid)) << "Tag not found.";
+}
+
+TEST_F(SocketTaggingTest, ReTagWithUidChange) {
+    // Re-tag with uid change
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag1, fake_uid), 0);
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag2, fake_uid2), 0);
+}
+
+TEST_F(SocketTaggingTest, Valid64BitAcctTag) {
+    // Valid 64bit acct tag
+    EXPECT_GE(doCtrlCommand("t %d %llu", sock0.fd, max_uint_tag), 0);
+    EXPECT_TRUE(sock0.checkTag(max_uint_tag, my_uid)) << "Tag not found.";
+}
+
+TEST_F(SocketTaggingTest, TagAnotherSocket) {
+    testPrintI("Tag two sockets");
+    EXPECT_GE(doCtrlCommand("t %d %llu", sock0.fd, max_uint_tag), 0);
+    EXPECT_GE(doCtrlCommand("t %d %llu %u", sock1.fd, valid_tag1, fake_uid2), 0);
+    EXPECT_TRUE(sock1.checkTag(valid_tag1, fake_uid2)) << "Tag not found.";
+    testPrintI("Untag socket0 of them only.");
+    EXPECT_GE(doCtrlCommand("u %d", sock0.fd), 0);
+    EXPECT_FALSE(sock0.checkTag(max_uint_tag, fake_uid)) << "Tag should not be there";
+    EXPECT_TRUE(sock1.checkTag(valid_tag1, fake_uid2)) << "Tag not found";
+    testPrintI("Now untag socket1 as well.");
+    EXPECT_GE(doCtrlCommand("u %d", sock1.fd), 0);
+    EXPECT_FALSE(sock1.checkTag(valid_tag1, fake_uid2)) << "Tag should not be there";
+}
+
+TEST_F(SocketTaggingTest, TagInvalidSocketFail) {
+    // Invalid tag. Expected failure
+    close(sock0.fd);
+    EXPECT_LE(doCtrlCommand("t %d %llu %u", sock0.fd, valid_tag1, my_uid), 0);
+    EXPECT_FALSE(sock0.checkTag(valid_tag1, my_uid)) << "Tag should not be there";
+}
+
+TEST_F(SocketTaggingTest, UntagInvalidSocketFail) {
+    // Invalid untag. Expected failure";
+    close(sock1.fd);
+    EXPECT_LE(doCtrlCommand("u %d", sock1.fd), 0);
+}
+
+}  // namespace android
diff --git a/tests/lib/testUtil/testUtil.c b/tests/lib/testUtil/testUtil.c
index d63fbba..b4edbd6 100644
--- a/tests/lib/testUtil/testUtil.c
+++ b/tests/lib/testUtil/testUtil.c
@@ -150,9 +150,9 @@
     va_start(args, fmt);
     vsnprintf(line, sizeof(line), fmt, args);
     if (stream == stderr) {
-        LOG(LOG_ERROR, logCatTag, "%s", line);
+        ALOG(LOG_ERROR, logCatTag, "%s", line);
     } else {
-        LOG(LOG_INFO, logCatTag, "%s", line);
+        ALOG(LOG_INFO, logCatTag, "%s", line);
     }
     vfprintf(stream, fmt, args);
     fputc('\n', stream);
diff --git a/tests/wifi/stress/wifiLoadScanAssoc.c b/tests/wifi/stress/wifiLoadScanAssoc.c
index 62b179c..17536e4 100644
--- a/tests/wifi/stress/wifiLoadScanAssoc.c
+++ b/tests/wifi/stress/wifiLoadScanAssoc.c
@@ -285,7 +285,7 @@
 
         // Start Supplicant
         randBind(&availCPU, &cpu);
-        if ((rv = wifi_start_supplicant()) != 0) {
+        if ((rv = wifi_start_supplicant(false)) != 0) {
             testPrintE("CPU: %i wifi_start_supplicant() failed, rv: %i\n",
                 cpu, rv);
             exit(21);
@@ -341,7 +341,7 @@
         }
 
         // Start supplicant
-        if ((rv = wifi_start_supplicant()) != 0) {
+        if ((rv = wifi_start_supplicant(false)) != 0) {
             testPrintE("main start supplicant failed, rv: %i", rv);
             exit(26);
         }
