Merge "Add atrace calls for systrace support."
diff --git a/c2hal/main.cpp b/c2hal/main.cpp
index b16772c..99b689b 100644
--- a/c2hal/main.cpp
+++ b/c2hal/main.cpp
@@ -57,12 +57,12 @@
static bool isPathPrefix(const std::string &prefix, const std::string &base) {
if (prefix.size() >= base.size()) {
- LOG(INFO) << "Not long enough";
+ LOG(DEBUG) << "Not long enough";
return false;
}
if (base[prefix.size()] != '.') {
- LOG(INFO) << "not full";
+ LOG(DEBUG) << "not full";
return false;
}
@@ -111,9 +111,10 @@
std::string package;
std::map<std::string, std::string> packageRootPaths;
bool isOpenGl = false;
+ bool verbose = false;
int res;
- while ((res = getopt(argc, argv, "gho:p:r:")) >= 0) {
+ while ((res = getopt(argc, argv, "ghvo:p:r:")) >= 0) {
switch (res) {
case 'o': {
outputDir = optarg;
@@ -127,6 +128,10 @@
isOpenGl = true;
break;
}
+ case 'v': {
+ verbose = true;
+ break;
+ }
case 'r':
{
addPackageRootToMap(optarg, packageRootPaths);
@@ -148,6 +153,10 @@
exit(0);
}
+ if (verbose) {
+ SetMinimumLogSeverity(android::base::VERBOSE);
+ }
+
applyPackageRootPath(packageRootPaths, package, outputDir);
if (package.empty()) {
@@ -165,7 +174,7 @@
for(int i = optind; i < argc; i++) {
std::string path = argv[i];
- LOG(INFO) << "Processing " << path;
+ LOG(DEBUG) << "Processing " << path;
AST ast(path, outputDir, package, isOpenGl);
diff --git a/generateCppImpl.cpp b/generateCppImpl.cpp
index bfd8950..939bcc2 100644
--- a/generateCppImpl.cpp
+++ b/generateCppImpl.cpp
@@ -148,10 +148,11 @@
out << "using " << name.cppName() << ";\n";
}
+ out << "using ::android::hardware::hidl_array;\n";
+ out << "using ::android::hardware::hidl_string;\n";
+ out << "using ::android::hardware::hidl_vec;\n";
out << "using ::android::hardware::Return;\n";
out << "using ::android::hardware::Void;\n";
- out << "using ::android::hardware::hidl_vec;\n";
- out << "using ::android::hardware::hidl_string;\n";
out << "using ::android::sp;\n";
out << "\n";
diff --git a/main.cpp b/main.cpp
index 29de12c..a4f5dc0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1171,14 +1171,14 @@
case 'L':
{
- CHECK(outputFormat == nullptr); // only one -L option
+ CHECK(outputFormat == nullptr) << "Only one -L option allowed.";
for (auto &e : formats) {
if (e.mKey == optarg) {
outputFormat = &e;
break;
}
}
- CHECK(outputFormat != nullptr);
+ CHECK(outputFormat != nullptr) << "Output format not recognized.";
break;
}