From 5e2950a9209f67bb505fbe8be4d8a3dcecbd0bd1 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Tue, 9 Jul 2013 09:49:58 -0400 Subject: [PATCH] PR14927: stapdyn: make warning/error string capitalization consistent Just like in stap and staprun, where messages that follow the "WARNING:" and "ERROR:" string are capitalized. --- stapdyn/mutatee.cxx | 8 ++++---- stapdyn/mutator.cxx | 24 ++++++++++++------------ stapdyn/stapdyn.cxx | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/stapdyn/mutatee.cxx b/stapdyn/mutatee.cxx index 1607c1d0f..9b63f5648 100644 --- a/stapdyn/mutatee.cxx +++ b/stapdyn/mutatee.cxx @@ -315,7 +315,7 @@ mutatee::instrument_dynprobe_target(BPatch_object* object, Dyninst::Address address = object->fileOffsetToAddr(probe.offset); if (address == BPatch_object::E_OUT_OF_BOUNDS) { - stapwarn() << "couldn't convert " << target.path << "+" + stapwarn() << "Couldn't convert " << target.path << "+" << lex_cast_hex(probe.offset) << " to an address" << endl; continue; } @@ -327,7 +327,7 @@ mutatee::instrument_dynprobe_target(BPatch_object* object, object->findPoints(address, points); if (points.empty()) { - stapwarn() << "couldn't find an instrumentation point at " + stapwarn() << "Couldn't find an instrumentation point at " << lex_cast_hex(address) << ", " << target.path << "+" << lex_cast_hex(probe.offset) << endl; continue; @@ -345,7 +345,7 @@ mutatee::instrument_dynprobe_target(BPatch_object* object, points[i]->getFunction()->findPoint(BPatch_locExit); if (!exits || exits->empty()) { - stapwarn() << "couldn't find a return point from " + stapwarn() << "Couldn't find a return point from " << lex_cast_hex(address) << ", " << target.path << "+" << lex_cast_hex(probe.offset) << endl; continue; @@ -379,7 +379,7 @@ mutatee::instrument_dynprobe_target(BPatch_object* object, { Dyninst::Address sem_address = object->fileOffsetToAddr(probe.semaphore); if (sem_address == BPatch_object::E_OUT_OF_BOUNDS) - stapwarn() << "couldn't convert semaphore " << target.path << "+" + stapwarn() << "Couldn't convert semaphore " << target.path << "+" << lex_cast_hex(probe.offset) << " to an address" << endl; else { diff --git a/stapdyn/mutator.cxx b/stapdyn/mutator.cxx index 5fa0c5890..b483da68f 100644 --- a/stapdyn/mutator.cxx +++ b/stapdyn/mutator.cxx @@ -313,7 +313,7 @@ mutator::init_modoptions() if (global_setter == NULL) { // Hypothetical backwards compatibility with older stapdyn: - stapwarn() << "compiled module does not support -G globals" << endl; + stapwarn() << "Compiled module does not support -G globals" << endl; return false; } @@ -327,7 +327,7 @@ mutator::init_modoptions() string::size_type separator = modoption.find('='); if (separator == string::npos) { - stapwarn() << "could not parse module option '" << modoption << "'" << endl; + stapwarn() << "Could not parse module option '" << modoption << "'" << endl; return false; // XXX: perhaps ignore the option instead? } string name = modoption.substr(0, separator); @@ -336,7 +336,7 @@ mutator::init_modoptions() int rc = global_setter(name.c_str(), value.c_str()); if (rc != 0) { - stapwarn() << "incorrect module option '" << modoption << "'" << endl; + stapwarn() << "Incorrect module option '" << modoption << "'" << endl; return false; // XXX: perhaps ignore the option instead? } } @@ -362,22 +362,22 @@ mutator::init_session_attributes() int rc = global_setter("@log_level", lex_cast(stapdyn_log_level).c_str()); if (rc != 0) - stapwarn() << "couldn't set 'log_level' global" << endl; + stapwarn() << "Couldn't set 'log_level' global" << endl; rc = global_setter("@suppress_warnings", lex_cast(stapdyn_suppress_warnings).c_str()); if (rc != 0) - stapwarn() << "couldn't set 'suppress_warnings' global" << endl; + stapwarn() << "Couldn't set 'suppress_warnings' global" << endl; rc = global_setter("@stp_pid", lex_cast(getpid()).c_str()); if (rc != 0) - stapwarn() << "couldn't set 'stp_pid' global" << endl; + stapwarn() << "Couldn't set 'stp_pid' global" << endl; if (target_mutatee) { rc = global_setter("@target", lex_cast(target_mutatee->process_id()).c_str()); if (rc != 0) - stapwarn() << "couldn't set 'target' global" << endl; + stapwarn() << "Couldn't set 'target' global" << endl; } size_t module_endpath = module_name.rfind('/'); @@ -388,7 +388,7 @@ mutator::init_session_attributes() string module_basename(module_name, module_basename_start, module_basename_len); rc = global_setter("@module_name", module_basename.c_str()); if (rc != 0) - stapwarn() << "couldn't set 'module_name' global" << endl; + stapwarn() << "Couldn't set 'module_name' global" << endl; time_t now_t = time(NULL); struct tm* now = localtime(&now_t); @@ -396,20 +396,20 @@ mutator::init_session_attributes() { rc = global_setter("@tz_gmtoff", lex_cast(-now->tm_gmtoff).c_str()); if (rc != 0) - stapwarn() << "couldn't set 'tz_gmtoff' global" << endl; + stapwarn() << "Couldn't set 'tz_gmtoff' global" << endl; rc = global_setter("@tz_name", now->tm_zone); if (rc != 0) - stapwarn() << "couldn't set 'tz_name' global" << endl; + stapwarn() << "Couldn't set 'tz_name' global" << endl; } else - stapwarn() << "couldn't discover local timezone info" << endl; + stapwarn() << "Couldn't discover local timezone info" << endl; if (stapdyn_outfile_name) { rc = global_setter("@outfile_name", lex_cast(stapdyn_outfile_name).c_str()); if (rc != 0) - stapwarn() << "couldn't set 'outfile_name' global" << endl; + stapwarn() << "Couldn't set 'outfile_name' global" << endl; } return; diff --git a/stapdyn/stapdyn.cxx b/stapdyn/stapdyn.cxx index 05a28a264..a4f07dc3d 100644 --- a/stapdyn/stapdyn.cxx +++ b/stapdyn/stapdyn.cxx @@ -144,7 +144,7 @@ main(int argc, char * const argv[]) auto_ptr session(new mutator(module, modoptions)); if (!session.get() || !session->load()) { - staperror() << "failed to create the mutator!" << endl; + staperror() << "Failed to create the mutator!" << endl; return 1; } -- 2.43.5