Sync with oprofile CVS HEAD from Jan 11, 2011.
There have been a few patches to oprofile for newer ARM architectures
since 0.9.6.
Pruned out irrelevant auto-generated files from the previous dump
so this is closer to being a mirror of the actual oprofile repository.
Change-Id: I889053d30aae433a199a0a18585c66b88ff8de14
diff --git a/libpp/parse_filename.cpp b/libpp/parse_filename.cpp
index 65422cb..3346d56 100644
--- a/libpp/parse_filename.cpp
+++ b/libpp/parse_filename.cpp
@@ -82,6 +82,13 @@
string name = str2;
// Get rid of "{anon:
name.erase(0, 6);
+ // Catch the case where we end up with an empty string. This should
+ // never happen, except where things have gone awfully bad with profile
+ // data collection, resulting in one or more bogus sample files.
+ if(0 == name.size())
+ throw invalid_argument("parse_anon() invalid name: " + str2 + "\n"
+ + "This error indicates your sample data is suspect. It is "
+ + "recommended you do a --reset and collect new profile data.");
// Get rid of the trailing '}'
name.erase(name.size() - 1, 1);
vector<string> parts = separate_token(str, '.');