Improve oprofile scripts.

Now support importing dumps and running reports using a simple script.
Eliminated some spurious errors and warnings in the oprofile tools
when profiling Android libraries.

Change-Id: I618cf6f8937a6ab5f45b3d45bdf860792b6bebbe
diff --git a/libpp/locate_images.cpp b/libpp/locate_images.cpp
index 426adfd..87c25a0 100644
--- a/libpp/locate_images.cpp
+++ b/libpp/locate_images.cpp
@@ -185,6 +185,13 @@
 		return fixup ? result[0] : image_name;
 	}
 
+#ifdef ANDROID
+	// On Android, we often have both stripped and unstripped versions of the same
+	// library in the image path.  Choose the first one found instead of issuing a
+	// multiple match error.
+	error = image_ok;
+	return fixup ? result[0] : image_name;
+#else
 	// We can't get multiple result except if only one result is prefixed
 	// by archive_path or by root_path.
 	size_t count = 0;
@@ -212,6 +219,7 @@
 
 	error = image_multiple_match;
 	return image_name;
+#endif
 }
 
 
diff --git a/libpp/op_header.cpp b/libpp/op_header.cpp
index 041a1e8..938f5dd 100644
--- a/libpp/op_header.cpp
+++ b/libpp/op_header.cpp
@@ -114,6 +114,12 @@
 	} else {
 		static bool warned_already = false;
 
+#ifdef ANDROID
+		// Android symbol files may not have the same timestamp as the stripped
+		// files deployed to the device.  Suppress spurious warnings.
+		if (file.find("/symbols/") == string::npos) {
+#endif
+
 		cerr << "warning: the last modified time of the binary file "
 		     "does not match that of the sample file for " << file
 		     << "\n";
@@ -123,6 +129,10 @@
 			"has been modified since the sample file was created.\n";
 			warned_already = true;
 		}
+
+#ifdef ANDROID
+		}
+#endif
 	}
 }