refactor: Remove erroneous 'qualifier' field from SystemConfig
This commit is contained in:
1 parent
450de301a9
commit
53a87530ee
7 files changed
+16
-15
No files matched your search
@@ -140,7 +140,6 @@ void ConfigurationState::initialize_builtins() {
|
||||
sys.set_process_name(os::get_application_name());
|
||||
sys.set_directory(os::get_install_path());
|
||||
sys.set_platform(os::platform_name());
|
||||
sys.set_qualifier(os::get_qualifier());
|
||||
sys.set_unittest_environment(utils::internal::is_unittest_environment());
|
||||
sys.set_data_path(os::app_data_path("data/").string());
|
||||
sys.set_os_user(os::username());
|
||||
|
||||
@@ -9,7 +9,10 @@ message SystemConfig {
|
||||
string process_name = 3;
|
||||
string directory = 4;
|
||||
string platform = 5;
|
||||
string qualifier = 6;
|
||||
// The 'qualifier' field is commented out because it doesn't seem to serve a
|
||||
// purpose. Prior to its removal, it was arbitrarily populated with the last
|
||||
// cmd line argument...smells like bad and/or lazy design.
|
||||
// string qualifier = 6;
|
||||
bool unittest_environment = 7;
|
||||
string data_path = 8;
|
||||
string version = 9;
|
||||
|
||||
@@ -168,9 +168,9 @@ void run_periodic_dumper(
|
||||
const std::set<UserSymbol> &symbols,
|
||||
uint32_t seq_mod,
|
||||
PrintFormat format,
|
||||
bool monitor_all) {
|
||||
bool monitor_all,
|
||||
std::string qualifier) {
|
||||
|
||||
auto qualifier = config::get<config::SystemConfig>().qualifier();
|
||||
auto thread_name = "tail-" + qualifier;
|
||||
threading::configure_current_thread(thread_name);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "lib/md/UserSymbol.h"
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
namespace bts {
|
||||
namespace md {
|
||||
@@ -11,7 +12,8 @@ void run_periodic_dumper(
|
||||
const std::set<UserSymbol> &,
|
||||
uint32_t seq_mod,
|
||||
PrintFormat format,
|
||||
bool monitor_all);
|
||||
bool monitor_all,
|
||||
std::string qualifier);
|
||||
|
||||
} // namespace md
|
||||
} // namespace bts
|
||||
} // namespace bts
|
||||
@@ -611,13 +611,6 @@ std::vector<std::string> get_command_line() {
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string get_qualifier() {
|
||||
std::vector<std::string> cmd_line = get_command_line();
|
||||
if (cmd_line.size() > 0)
|
||||
return cmd_line.back();
|
||||
return "";
|
||||
}
|
||||
|
||||
void enable_core_dumps() {
|
||||
#ifndef WIN32
|
||||
struct rlimit core_limits;
|
||||
|
||||
@@ -64,7 +64,6 @@ BTS_EXPORT void gen_uuid(unsigned char out[16]);
|
||||
BTS_EXPORT std::string &normalize_path(std::string &path);
|
||||
BTS_EXPORT std::string sanitize_file_name(std::string const &file_name);
|
||||
BTS_EXPORT std::vector<std::string> get_command_line();
|
||||
BTS_EXPORT std::string get_qualifier();
|
||||
BTS_EXPORT void enable_core_dumps();
|
||||
extern "C" BTS_EXPORT int get_random_port();
|
||||
extern "C" BTS_EXPORT int num_cores();
|
||||
|
||||
@@ -13,6 +13,7 @@ struct Tail::Args {
|
||||
bts::md::PrintFormat format;
|
||||
long mod;
|
||||
bool all;
|
||||
std::string qualifier;
|
||||
};
|
||||
|
||||
Tail::Tail() :
|
||||
@@ -39,6 +40,10 @@ Tail::Tail() :
|
||||
->default_val(bts::md::PrintFormat::CSV);
|
||||
// flags
|
||||
add_flag("-a,--all", _args->all, "Monitor all securities");
|
||||
add_option(
|
||||
"--qualifier", _args->qualifier,
|
||||
"Qualifier appended to the thread/proc name (formatted "
|
||||
"'tail-<qualifier>')");
|
||||
|
||||
callback([&] {
|
||||
std::set<bts::md::UserSymbol> products;
|
||||
@@ -49,7 +54,7 @@ Tail::Tail() :
|
||||
config.set_platform(co2::Platform_Name(_args->platform));
|
||||
bts::md::get_system_md_symbols(config, products);
|
||||
bts::md::run_periodic_dumper(
|
||||
products, _args->mod, _args->format, _args->all);
|
||||
products, _args->mod, _args->format, _args->all, _args->qualifier);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user